A complete checkers game with FastAPI backend and modern frontend, featuring real-time multiplayer gameplay with WebSocket connections.
Play Now: https://app-production-af65.up.railway.app
The Checkers/ directory is intentionally self-contained so it can be split into its own repository without code changes.
To create a standalone repository history from this monorepo:
git subtree split --prefix=Checkers -b checkers-standalone.
├── backend/ # FastAPI backend with authentication
│ ├── main.py # FastAPI application
│ ├── routers/ # API endpoints (auth, game, websocket)
│ ├── services/ # Game logic and security
│ ├── models/ # Database models
│ └── database.py # Database configuration
├── frontend/ # React + TypeScript frontend
│ ├── src/ # Source code
│ ├── public/ # Static assets
│ └── package.json # Dependencies
├── checkers-frontend/ # Alternative React implementation
├── Dockerfile # Production deployment
├── docker-compose.yml # Local development
└── railway.toml # Railway deployment config
- JWT Authentication - Secure user login/signup
- REST API - Game management endpoints
- WebSocket - Real-time multiplayer communication
- Database - SQLite with SQLAlchemy ORM
- Game Logic - Complete checkers rules implementation
- Modern UI - Tailwind CSS styling
- Interactive Board - Click-to-move gameplay
- Real-time Updates - WebSocket integration
- Authentication - Login/signup forms
- Responsive Design - Works on all devices
- Python 3.8+
- Node.js (for frontend dependencies)
cd backend
pip install -r requirements.txt
python -m uvicorn main:app --host 127.0.0.1 --port 8000cd frontend
npm install
python -m http.server 3000- Open
http://localhost:3000in your browser - Sign up for a new account or login with existing credentials
- Create a game or join an existing game using the game ID
- Play checkers - click pieces to select, click destination to move
- Real-time multiplayer - both players see moves instantly
POST /auth/Signup- Create new userPOST /auth/Login- User login
POST /game/create_game- Create new gamePOST /game/join_game/{game_id}- Join existing game
WS /ws/{game_id}?player_id={id}&token={token}- Real-time gameplay
- Red pieces move first
- Diagonal movement only on dark squares
- Must capture if possible
- Kings can move in any diagonal direction
- Win by capturing all opponent pieces
- JWT Tokens for authentication
- Password hashing with bcrypt
- WebSocket authentication via tokens
- CORS protection for API security
- Beautiful UI with Tailwind CSS
- Interactive board with hover effects
- Visual feedback for selected pieces
- Possible move indicators
- King piece symbols (♔)
- Responsive design for mobile/desktop
cd backend
python -m uvicorn main:app --reload --host 127.0.0.1 --port 8000cd frontend
npm run dev # For Tailwind CSS compilation
python -m http.server 3000- Chrome/Edge (recommended)
- Firefox
- Safari
- Mobile browsers
- Port conflicts - Make sure ports 8000 and 3000 are available
- CORS errors - Backend includes CORS middleware
- WebSocket connection - Check firewall settings
- Authentication - Clear localStorage if token issues occur
- Open browser DevTools (F12)
- Check Console for errors
- Monitor Network tab for API calls
- WebSocket messages in Console
Your checkers game is now fully integrated with:
- ✅ Authentication system
- ✅ Real-time multiplayer
- ✅ Modern UI/UX
- ✅ Complete game logic
- ✅ WebSocket communication
Happy gaming! 🎮