
PROJECT 01
Chess
Live chess with server-owned moves and clocks
Real-time multiplayer. A browser chess platform for online matchmaking, private invite games, and local pass & play, with a React board and server-validated rules.
An authenticated WebSocket connects players to a Node.js game server. PostgreSQL persists accounts, sessions, and game snapshots; reconnecting players recover the current position and running clocks.
Architecture & trade-offs
- HTTP-only cookie sessions authenticate HTTP and WebSocket access. Matchmaking pairs time controls; private rooms use shareable invite codes. The server validates moves, clocks, and terminal results with chess.js.
- Accepted moves and snapshots are stored before broadcasting. Active clocks are checkpointed each second; restart recovery charges elapsed downtime. Players can review game history and export PGN.
Design boundary. Live connections, matchmaking, and game coordination are process-local, so deployment requires one API replica. Horizontal scaling needs shared coordination and game ownership; an abrupt crash may lose the last clock checkpoint.





