Die Trying · 05

Architecture

Diagram: players and the DM use browsers on phones, laptops and the TV. On Cloudflare, a SvelteKit Worker serves the new phone-first interface (built, not yet deployed), and a Python Worker running FastAPI on Pyodide serves today's interface and the JSON API, which browsers call directly with a JWT. The API Worker binds to D1 (characters, campaigns, loot ledger, transcripts), R2 (session audio), Workers AI (Nova-3 for transcripts; Llama 3.2 Vision and Qwen2.5-Coder for sheet scans) and Email Service (account verification). Workers Builds runs D1 migrations and deploys on every push to main.
One Python Worker and its bindings, all on Cloudflare. AI runs only when someone asks.
  • Python on Workers. Stock FastAPI on the Pyodide runtime. No threads, no filesystem; state lives in D1.
  • Data rules. Currency changes only through an append-only ledger, loot writes are idempotent, and DM-only fields are removed on the server, not hidden in the browser.
  • Party board refresh. A thirty-second poll. Tabletop pace does not need a socket.
  • Deploys. Workers Builds runs D1 migrations and deploys on every push to main.