This project is a real-time multiplayer chess game designed for engaging and competitive play. It features real-time updates, robust move validation using the chess.js library, and efficient game state management with persistent and recoverable game states.
- Real-Time Gameplay: Instant move updates and live game interaction.
- Move Validation: Leveraging chess.js for accurate move validation and game rules enforcement.
- Efficient Move Handling: Implemented a queue system to handle and store game moves, reducing WebSocket response delays.
- Game State Recovery: Persistent game state with mechanisms for recovery to prevent progress loss during server failures.
- Customizable Time Controls: Configurable countdown timers for each player.
- Frontend: React for a dynamic user interface.
- Backend: Node.js for server-side logic and real-time WebSocket communication.
- Database: PostgreSQL for persistent storage.
- In-Memory Database: For fast access and performance optimization.
- Chess.js: For handling chess game logic and validation.
Client
SOCKET_URL=ws://localhost:8080
Server
PORT=3000
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
SESSION_SECRET=
CALLBACK_URL=
JWT_SECRET=
CLIENT_URL=
SOCKET_URL=
DB in packages
DATABASE_URL=
-
Clone the Repository
git clone https://github.com/azamalijafri/chess.git cd chess
-
Install dependencies
npm install
-
Generate prisma client
npm run db:generate
-
Start development server
turbo run dev