A multiplayer mini-golf demo running entirely on the Cloudflare Developer Platform. Each room code maps to a single GolfRoom Durable Object that accepts hibernatable WebSockets, stores room state in Durable Object SQLite, validates turns, and runs deterministic shot physics on the server. Clients send only { angle, power }; the Durable Object computes the authoritative trajectory and broadcasts synchronized shot animations, scores, chat, cursors, and reactions to every connected player. The Worker routes WebSocket upgrades to the Durable Object and delegates all other requests to TanStack Start for SSR.
Browser clients (React + Canvas)
│ HTTPS pages + WebSocket /ws/golf/:roomId
▼
Cloudflare Worker (src/server.ts)
├── Non-WS requests → TanStack Start SSR
└── getByName(roomId) → GolfRoom Durable Object
├── Hibernatable WebSockets (ctx.acceptWebSocket)
├── Durable Object SQLite (players, chat, strokes, leaderboard)
├── Server-authoritative shot physics
└── Broadcasts state, chat, cursors, reactions
▼
All connected browsers