A simple online chess game via websockets.
Live Demo:
- asyncio
- FastAPI for the server
- msgspec for message serialization
- WebSockets for real-time communication
- python-chess for server-side chess logic
- chessboard.js for client rendering
- chess.js for client-side chess logic
- Prometheus and prometheus-fastapi-instrumentator for metrics
- Real-time chess game
- Client and server-side move validation
- Automatic matchmaking
- Reconnection is not supported
docker build -t pyws-chess .
docker run -p 8000:8000 pyws-chess
- uv
- Python 3.11+
cd src
uv run uvicorn app.main:app
The server will be running on http://localhost:8000
.
MIT