Daeseon Yoo
Back to project
·Tech retro·3 min

Phase 10 — standalone Go WebSocket game server (scaffold → game loop → hardening)

Three commits stood up the Go game-server tier from DR-1's hybrid 2-tier design: a WebSocket scaffold, a full game-loop port wired for prod, and a hardening pass adding cross-instance reconnect, metrics, Sentry, unit tests, and a load harness.

Phase 10 stands up the Go game-server tier as three milestones on 2026-06-01. This realizes decision DR-1: a hybrid 2-tier backend (Python platform + Go game server).

What changed

Milestone 1 — scaffold (1bf0f7b). Initial structure of the Go game-server tier: main.go, handler.go, auth.go, store.go, types.go, a Dockerfile, go.mod/go.sum, a .gitignore, and a README.md.

Milestone 2 — game loop + prod wiring (0ec0bb8). Ported the full game loop and wired it for production. Added engine.go (game loop), messages.go, pubsub.go, session.go, and an e2e test (test_e2e.py). Edited docker-compose.prod.yml (adding the game service built from go-server/), handler.go, main.go, store.go, types.go, and modified the existing Caddyfile (it already existed from 7266d18) to route /api/v1/ws/game/* to the Go game:8001 service while everything else stays on Python api:8000.

Milestone 3 — hardening (8d0a431). Per its subject, adds cross-instance reconnect, metrics, Sentry, unit tests, and a load harness. Reflected in new files:

It also edited docker-compose.prod.yml, Dockerfile, handler.go, main.go, session.go, and store.go.

Why Go for this tier

DR-1's reasoning grounds the language choice:

These commits are the planned beginning of the Go port. DR-1 deferred the rewrite until DAU passes ~500 ("build for 100 users, optimize when they stress the system").

Decisions

Notes

Commits