Play · architecture profile
Protocol 11
A responsive card table with rooms and matchmaking. A React client backed by a Cloudflare Worker, D1 and two Durable Objects.
How it is built.
Protocol 11 is the portfolio's stateful game. A Worker owns the API, D1 holds durable platform rows, and two Durable Objects — GameRoom and Matchmaker — coordinate live rooms. The client also runs a jukebox through LoftwahFM and reports anonymous play to Woodhouse, but the game remains playable when the hub is unavailable.
- Stack
- React 19.3, Vite 7, TypeScript, Cloudflare Workers, Durable ObjectsEvidence: package.json; worker
- Runtime
- Worker `protocol-11` with Durable Objects GameRoom and Matchmaker, static assets and a daily cronEvidence: wrangler.jsonc
- Storage
- D1 `protocol-11-platform` for durable rows; live room state in Durable ObjectsEvidence: wrangler.jsonc; worker
- Identity
- Email magic-link accounts with opaque `p11_account` and `p11_guest_session` cookies; guests can play without creating an account.Evidence: worker/platform/auth.ts; worker/platform/identity.ts
- Delivery
- Cloudflare custom domain protocol11.loftwah.com, preview Worker and daily cronEvidence: wrangler.jsonc
- Integrations
- LoftwahFM radio client 1.2.0 with the cartridge-club station; Resend runtime email for sign-in; anonymous engagement posted to WoodhouseEvidence: package.json; src/client/jukebox.ts; worker/platform/email.ts; src/client/gameplay-analytics.ts
The shape of the system.
- Table clientReact renders the table and controls; the same layout is a legal playing surface on a phone.Evidence: src/ui/GameTable.tsx
- Worker APIAuthenticates room requests, routes commands and serves the built client.Evidence: worker/index.ts
- GameRoomOne Durable Object coordinates a live room so two clients cannot disagree about whose turn it is.Evidence: wrangler.jsonc durable_objects GameRoom
- MatchmakerA second Durable Object owns public matchmaking state.Evidence: wrangler.jsonc durable_objects Matchmaker
- AccountsMagic-link sign-in issues opaque account and guest session cookies; a guest can take a seat without registering.Evidence: worker/platform/auth.ts; worker/platform/identity.ts
- JukeboxLoftwahFM's client supplies the station and queue; the table keeps its own volume and effects.Evidence: src/client/jukebox.ts; src/ui/MusicControls.tsx
Two Durable Objects for one card table.
Most games in this portfolio can be understood from their client alone. Protocol 11 cannot: the interesting decisions are on the server, where a table has to agree on a single turn order while two people tap at once.
The Worker splits durable platform data from live room state. D1 holds the rows that should survive a room — records that belong to the platform rather than to a hand in progress. GameRoom holds the hand. Because Cloudflare routes all requests for one room to one Durable Object, the room has a serialised writer and does not need a separate lock service.
Matchmaker is deliberately a second object. Public matchmaking has different contention and lifetime from a private table; folding them together would make one slow queue delay live play. The cost is a second stateful component to deploy and observe, which is a fair trade only because the game actually has two different coordination problems.
Engineering decisions worth knowing.
- A card table needs one authority per room
D1 alone would leave two players racing to write the same turn. A Durable Object gives each room one serialised writer, which is the smallest correct shape for turn order.
- Measurement is not on the playing path
Engagement reports are fire-and-forget and anonymous. A failed report cannot roll back a move or block a turn.
What it connects to.
Protocol 11LoftwahFMradio client 1.2.0two-way
Protocol 11's jukebox pins the same client with the cartridge-club station. The client owns station selection and queue state and sends anonymous listening events back to LoftwahFM; the table keeps volume and effects.
Evidence: Protocol 11 package.json; src/client/jukebox.ts; LoftwahFM docs/radio-game-integration.md
Protocol 11Woodhouseengagement ingress
The client posts woodhouse.engagement/1 events to Woodhouse without credentials. A failed report cannot block a turn; the game stays playable if the hub is unavailable.
Evidence: Protocol 11 src/client/gameplay-analytics.ts; Woodhouse src/worker.ts /api/engagement; src/data/engagement.ts
Authoritative public sources
What this review does not know.
- Room capacity under concurrent load was not re-measured in this review.
- Durable Object storage growth and eviction behaviour were not audited.
- No physical-device test was repeated for the table's touch controls.