The sync backend for journal. FastAPI + SQLite + JWT auth + WebSocket realtime.
python -m venv .venv
.venv/bin/pip install -r requirements.txt
.venv/bin/uvicorn journal_server.app:app --host 127.0.0.1 --port 8000
Or with Docker (SQLite volume at /srv; build from the repo root):
docker build -t journal-server .
docker run -p 8000:8000 -v journal-data:/srv journal-server
| Var | Default | Purpose |
|---|---|---|
JOURNAL_DB |
./journal.db |
SQLite file path (when no Postgres URL) |
JOURNAL_SECRET |
random per boot | JWT signing secret |
JOURNAL_CORS_ORIGINS |
* |
comma-separated allowed origins (set to your web app origin in prod) |
DATABASE_URL / JOURNAL_DATABASE_URL |
— | PostgreSQL URL (postgres://…); enables Postgres mode (Supabase/Render) |
Two backends, selected automatically:
DATABASE_URL or
JOURNAL_DATABASE_URL starts with postgres/postgresql. The schema is
created on startup. This is the way to persist on Render’s free tier,
which does not allow persistent disks.The repo ships a render.yaml blueprint — Render detects it automatically.
klcombr/journal repo and apply.JOURNAL_SECRET.postgresql://… one, port 5432 — not the pooler).journal-server → Environment → add
DATABASE_URL with that string → save (triggers a redeploy).Without
DATABASE_URLon the free plan, data lives on an ephemeral disk and is lost on redeploy — fine for trying the service out.
The free plan sleeps after ~15 min of inactivity; the first request after
waking takes ~50 s. JOURNAL_CORS_ORIGINS is pre-set to
https://klcombr.github.io for the hosted web app.
Point any client at the service URL:
journal sync --register --base https://journal-server.onrender.com
Tip: set a fixed
JOURNAL_SECRETso existing tokens survive redeploys.
See docs/specs/api.md. Interactive docs at /docs when running.