sports-app — the client, the state service, and sign-in

sports-app — the client, the state service, and sign-in An architecture diagram generated by Archify. Phone on the floor · installed PWA · Architecture component Phone on the floor installed PWA client/ · React + Vite · the device — fully usable alone · works offline client/ React + Vite works offline Local state · the authoritative copy · the device — fully usable alone Local state the authoritative copy Caddy · one domain :443 · One origin — sub-paths, no subdomains Caddy one domain :443 server/ · accounts + three routes · One origin — sub-paths, no subdomains · logger: false server/ accounts + three routes logger: false Ward · optional second way in · One origin — sub-paths, no subdomains Ward optional second way in SQLite · whole-document snapshots · One origin — sub-paths, no subdomains · capped per user SQLite whole-document snapshots capped per user twelve minutes read + crash-safe save sync, when online /sports-app-api OpenID Connect store verbatim, prune One origin — sub-paths, no subdomains the device — fully usable alone Legend Frontend Backend Database Cloud Security External

Offline-first is structural

  • • The client owns the state; the service is somewhere to put a copy
  • • With the service unreachable the app does not degrade, it just does not sync
  • • A change that makes a screen wait on the network breaks the product's promise

Whole documents, not tables

  • • One JSON snapshot row per save, one stream per user
  • • Recovery is a single sqlite3 SELECT with no application code running
  • • Bytes are preserved exactly — which is why GET has no response schema

What the session closed

  • • One shared secret used to authenticate the INSTALLATION, not a person
  • • Anyone holding it could read any history by editing ?user=
  • • The session's username is now the key, so the target is not caller-chosen