A full-stack, real-time implementation of the Dots and Boxes game. This project demonstrates backend game logic, real-time communication, and a modern frontend.
- Real-time multiplayer gameplay using WebSockets
- Server-authoritative game logic and move validation
- Interactive SVG-based UI in React
- Persistent game state and chat stored in a database
- Solo play against a bot
Backend
- Go (Echo framework)
- WebSockets for real-time gameplay and chat
Frontend
- React
- SVG-based board rendering
- Real-time updates via WebSockets
Database
- Postgres: persistent storage for users, game state, and chat history
Infrastructure
- Redis: in-memory Pub/Sub for events
- Docker: containerized environment
- Caddy: reverse proxy and HTTPS handling
Prerequisites: Go (1.24+), Node.js (18+), npm
One-command setup for running the full stack
# clone repository
# from project root
docker compose --env-file .env up --build This will:
- Build and run the Go API server
- Build the React frontend
- Start Caddy, Redis, and Postgres
Access the frontend at https://localhost (Caddy handles routing to backend API and WebSockets)
- backend: Go + Echo backend (serves API and WebSockets)
- frontend: React frontend container
- db: Postgres container
- caddy: Caddy reverse proxy container
- redis Redis container
# clone repository
# install dependencies
go mod tidy
# run API server
go run ./cmdThe backend runs on http://localhost:8484 and serves both the API and WebSocket connections.
cd frontend
npm install
npm run devMust have docker setup running, tests need a running redis setup.
Usertests (needs updating will fail)GametestsInfratestsLobbytests
go test ./internal/user
go test ./internal/game
go test ./internal/infra
go test ./internal/lobby- Users authenticate and join a global chat
- Players create or join a game session or play against a bot
- Each move selects a side of a square
- The server validates moves and updates state
- Completing a box awards a point and an extra turn
- Designing a turn-based multiplayer game
- Real-time synchronization across clients
- Managing shared state safely on the server
- Deploying full-stack applications with Docker and Caddy
Actively developed. Core gameplay and multiplayer features are complete.