Screens
Key engineering
Under the hood
One durable coordinator per room makes each session a single-threaded authority, which removes distributed locking and split-brain votes from the problem instead of solving them.
Room state lives in that coordinator and is persisted at the edge, so a refresh, a dropped socket or a closed laptop rejoins the same round. The message protocol is a shared package, so client and server cannot drift apart silently.
Edge only. No origin server, and nothing left running between sessions.
The failure that matters is a vote counted twice or a reveal racing a late ballot. A single writer per room makes both structurally impossible rather than carefully handled.
Stack
What it took
- One Durable Object per room makes each session a single-threaded authority — no distributed locking, no split-brain votes, no race between a reveal and a late ballot.
- The protocol is a package. Message contracts and constants are shared by client and Worker, so a change to the game rules fails at build time rather than in a sprint planning meeting.
