# server/ — not in this pass PORT.md steps 4–6 land here: the sync API, the tutor SSE endpoint, and the Docker Compose deployment beside the Pi's existing Postgres and Caddy. Nothing here yet, on purpose. Steps 1–3 give a fully working offline app with no server at all, and that is the version that gets used first. What is already shaped for it: - every syncable table carries `updated_at`, and seeded rows are pinned to 0 (see `app/src/db/writes.ts`) — the artifact's clobbering bug cannot be expressed; - `change_seq` is deliberately absent: it is server-assigned and arrives with the sync layer; - the dictionary is fetched by URL from `app/src/domain/dictionary.ts`, so per-band deltas can come from the Pi instead of the bundle by changing a base URL; - the tutor goes through one `Sample` function (`app/src/domain/stub-tutor.ts`). The real endpoint implements the same contract — `onText` receives cumulative text, and an aborted turn stops billing — so only that file changes. When the SSE endpoint lands, Caddy needs `flush_interval -1` on the proxy or the stream buffers and the tutor appears to hang.