user@gryczka.dev: ~/garden/multiplayer-mini-golf
$ cat ~/garden/multiplayer-mini-golf/README.md
Multiplayer Mini Golf — Durable Object Coordinated Game screenshot

Multiplayer Mini Golf — Durable Object Coordinated Game

June 17, 2026 | Patrick Gryczka

## Overview

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.

## Highlights

  • -> One GolfRoom Durable Object per room code coordinates all shared state
  • -> Hibernatable WebSockets (ctx.acceptWebSocket) for efficient room fanout
  • -> Server-authoritative shot physics — clients submit only { angle, power }
  • -> Durable Object SQLite persists players, chat, strokes, and leaderboard
  • -> Synchronized shot animations, live cursors, chat, and emoji reactions

## Architecture

Multiplayer Mini Golf architecture diagram
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

## Tech Stack

WorkersDurable ObjectsWebSocketsSQLiteTanStack StartTypeScript
$ _