A real-time multiplayer chess game built using Node.js, Express, Socket.IO, and chess.js. Players can play online in real-time, while spectators can watch games live. The app handles check, checkmate, stalemate, and draws automatically.
- Two-player real-time chess with white and black roles.
- Spectator mode to watch games live.
- Drag-and-drop UI for piece movement.
- Automatic move validation using chess.js.
- Game-over detection for checkmate, stalemate, and draws.
- Unicode chess piece display.
- Board flips for black player.
- Prevents moves after game-over.
- Node.js - Backend runtime
- Express - Web server and routing
- Socket.IO - Real-time communication
- chess.js - Chess rules and game logic
- EJS - Frontend templating
- HTML/CSS/JavaScript - Frontend UI
This project uses the following Node.js packages:
- express - Web server and routing
- socket.io - Real-time communication
- chess.js - Chess game rules and validation
- ejs - Frontend templating engine
Install them via:
npm install express socket.io chess.js ejs
Installation
Clone the repository:
git clone https://github.com/your-username/Chess-app.git
cd Chess-app
Install dependencies:
npm install
Start the server:
node app.js
Open your browser at:
http://localhost:8080