ChessWess is a real-time multiplayer chess application with authentication, lobby matchmaking, and live game sync over WebSockets.
Vision: evolve standard online chess into a timeline/branching experience (see
PLAN.md).
- User registration and login (JWT-based auth)
- Create and join games from a lobby
- Configurable time controls (including unlimited)
- Real-time move sync using WebSockets
- Move history persistence in PostgreSQL
- Resign flow and game-over status updates
- Responsive React UI with chessboard, clocks, and move list
- React + TypeScript + Vite
- Zustand for state management
chess.jsfor move logic- TailwindCSS + Framer Motion
- Go (net/http)
- PostgreSQL (game/users/moves persistence)
- Redis (optional cache/realtime support)
- Gorilla WebSocket
- Docker + Docker Compose
.
├── backend/ # Go API + WebSocket server
│ ├── db/ # DB connection + migrations
│ ├── models/ # Domain models
│ └── server/ # Routes, auth, game + ws handlers
├── frontend/ # React app
│ └── src/
│ ├── components/ # Board and game UI components
│ ├── pages/ # Auth, lobby, and game pages
│ ├── store/ # Zustand stores
│ └── utils/ # API + WebSocket clients
├── docker-compose.yml
├── .env.example
├── setup_db.sql
├── Setup.md
└── PLAN.md
- Docker + Docker Compose
docker compose up --buildThis starts:
- Frontend:
http://localhost:5173 - Backend:
http://localhost:8080 - Postgres:
localhost:5432 - Redis:
localhost:6379
cp .env.example .envdocker compose up postgres redis -dcd backend
go run main.gocd frontend
npm ci
npm run devFrontend dev server: http://localhost:5173
Create .env in repository root.
Example below is production-oriented:
DATABASE_URL=postgres://your_db_user:your_db_password@localhost:5432/your_db_name?sslmode=require
REDIS_URL=redis://localhost:6379
PORT=8080
JWT_SECRET=REPLACE_WITH_SECURE_RANDOM_SECRET
VITE_API_URL=http://localhost:8080
VITE_WS_URL=ws://localhost:8080For local Docker defaults in this repo (INSECURE — LOCAL DEVELOPMENT ONLY), use:
postgres://<POSTGRES_USER>:<POSTGRES_PASSWORD>@localhost:5432/<POSTGRES_DB>?sslmode=disable.
In docker-compose.yml, those values are currently set for local development and should be changed before any shared or production deployment.
For production, use secure DB credentials and strict SSL settings (e.g., sslmode=require or stronger).
For JWT secrets, generate a strong random value (e.g., openssl rand -base64 32).
POST /api/auth/registerPOST /api/auth/login
GET /api/games— list open gamesPOST /api/games— create gameGET /api/games/{id}— get gameGET /api/games/{id}/moves— get move historyPOST /api/games/{id}/join— join gamePOST /api/games/{id}/resign— resign game
GET /ws?game_id=<id>&token=<jwt>
Common WS messages: move, player_joined, player_connected, player_disconnected, game_over.
GET /health
cd backend
go test ./...
go build ./...cd frontend
npm ci
npm run buildThe long-term product direction (timeline branching / multiverse chess) is documented in PLAN.md.
This project is currently unlicensed (no LICENSE file is present yet).