A sleek, real-time multiplayer chess application built with Node.js, Socket.io, and Chess.js. Play classic chess against friends or random opponents instantly!
⚠️ Important: This is a real-time multiplayer game.
If you are the first person to join, you will see a "Waiting for opponent" screen.
To test it yourself immediately: Open the link in two different browser tabs
- Real-Time Gameplay: Instant move updates and board synchronization using WebSockets.
- Click-to-Move Interface: Simple and intuitive piece movement (desktop & mobile friendly).
- Move Validation: Legal moves are highlighted; illegal moves are prevented automatically.
- Game States: Automatic detection of Check, Checkmate, Draw, and Stalemate.
- Player Roles: Automatic assignment of White (first player) and Black (second player) pieces.
- Spectator Mode: Additional users can watch the game in progress.
- Responsive Design: Fully responsive UI built with Tailwind CSS.
- Frontend: HTML5, EJS (Templating), Vanilla JavaScript, Tailwind CSS
- Backend: Node.js, Express.js
- Real-Time Communication: Socket.io
- Game Logic: Chess.js (Move validation and state management)
-
Start a Game:
- Open the Live Link.
- If no one else is online, you will wait in the lobby.
- Share the link with a friend or open a second tab to simulate an opponent.
-
Gameplay:
- White moves first.
- Click on a piece to select it, then click on a valid square to move.
- Valid moves are highlighted with a small dot 🟢.
- Capture moves are highlighted with a ring ⭕.
-
Winning:
- Checkmate your opponent's King to win!
- The game will announce the winner or the reason for a draw/stalemate.
To run this project locally on your machine:
-
Clone the Repository
git clone https://github.com/addy015/chessyy.git cd chessyy -
Install Dependencies
npm install
-
Run the Server
npx nodemon app.js # OR npm start -
Play Locally
- Open your browser and go to
http://localhost:3000. - Open a second tab to
http://localhost:3000to play as the second player.
- Open your browser and go to
Contributions are welcome! Feel free to open an issue or submit a pull request.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is open source and available under the MIT License.