All projects

Realtime · Multiplayer games · 2026

Realtime board-game platform — Go, Dou Shou Qi & more

Two players join a room and play a fully validated match in real time. The server rules on every move and broadcasts each board state from a single source of truth, on an engine designed to add new games without a rewrite.

Role
Full-stack developer
Year
2026
Backend
Go + WebSockets
Frontend
SvelteKit
Realtime board-game platform — Go, Dou Shou Qi & more

Overview

The platform began as a real-time Go (Baduk/Weiqi) game and was deliberately refactored into a multi-game engine — it already hosts Dou Shou Qi, and the architecture is built so that adding new games is a first-class extension point, not a rewrite. The Go server is the single source of truth: clients never trust each other, every move is validated against a pure rules engine, and the resulting state is broadcast to both players over WebSockets.

REST handles only session and room lifecycle; all live gameplay and the lobby feed happens over WebSockets. Each game's rules engine is pure and deterministic — no I/O — so it round-trips through JSON snapshots that the store persists and rehydrates, with a pluggable in-memory or PostgreSQL backend chosen at compile time.

Key features

  • Extensible multi-game engineGo and Dou Shou Qi share one room, lobby and protocol layer; new games slot into a clean extension point.
  • Server-authoritative rulesPure, exhaustively unit-tested engines enforce legality, ko, handicap, and area scoring per game.
  • Live WebSocket play & lobbyPer-room gameplay and a shared lobby feed broadcast every state change in real time.
  • Reconnect & pluggable persistenceGrace timers survive disconnects, and the store runs in-memory by default or on PostgreSQL via a build tag.

The challenge

The hardest part was keeping two parallel state machines in sync: the engine phase (playing → scoring → finished) that governs move legality, and the persisted room lifecycle that drives the lobby and rehydration. Routing every transition through a single set of choke-point methods, each holding the right lock, kept the live game and its stored record from drifting apart. The same discipline is what makes adding a game safe instead of risky.

Gallery

Next project
INTEGRAZOO — livestock management platform