https://github.com/krutarth-2004/chess
A real-time multiplayer Chess game built with Node.js, Express, Socket.IO, and Chess.js. Supports drag-and-drop moves, move validation, board sync, player roles (White, Black, Spectator), pawn promotion, game restart, draw offers, and resign feature — all in a modern responsive UI.
https://github.com/krutarth-2004/chess
browser-game chess chessjs draggable-ui expressjs javascript multiplayer-game nodejs real-time socket-io tailwindcss websocket
Last synced: 2 months ago
JSON representation
A real-time multiplayer Chess game built with Node.js, Express, Socket.IO, and Chess.js. Supports drag-and-drop moves, move validation, board sync, player roles (White, Black, Spectator), pawn promotion, game restart, draw offers, and resign feature — all in a modern responsive UI.
- Host: GitHub
- URL: https://github.com/krutarth-2004/chess
- Owner: Krutarth-2004
- Created: 2025-06-23T11:35:52.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-06-23T12:04:40.000Z (12 months ago)
- Last Synced: 2025-06-23T12:39:25.699Z (12 months ago)
- Topics: browser-game, chess, chessjs, draggable-ui, expressjs, javascript, multiplayer-game, nodejs, real-time, socket-io, tailwindcss, websocket
- Language: JavaScript
- Homepage: https://chess-ca2j.onrender.com
- Size: 1.93 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ♟️ Real-Time Multiplayer Chess Game
A real-time, multiplayer chess game built with **Node.js**, **Socket.IO**, and **Chess.js**. This project enables players to play chess online against each other in real time, featuring elegant UI, move validation, game controls like restart, draw, and resign, and dynamic board updates.
---
## 🚀 Features
- ♞ Real-time gameplay with Socket.IO
- ♜ Player roles: White, Black, and Spectator
- ♟ Move validation via `chess.js`
- 🔁 Restart game with confirmation
- 🤝 Draw offer and acceptance flow
- 🏳️ Resignation handling
- ♛ Pawn promotion UI
- 🌐 Spectator mode for extra connections
- 🎨 Beautiful UI with Tailwind CSS
- 📦 Fully modular, clean code structure
---
## 🧩 Tech Stack
| Technology | Purpose |
|--------------|--------------------------------|
| Node.js | Backend runtime |
| Express.js | Web framework |
| Socket.IO | Real-time WebSocket handling |
| Chess.js | Chess rules and move validation |
| EJS | HTML Templating engine |
| Tailwind CSS | Responsive and modern styling |
---
## 🛠️ Project Structure
📦 chess-game/
- public/
- js/
- chess.js # Frontend logic
- views/
- index.ejs # Main game page
- index.js # Server entry point
- package.json # Project metadata and dependencies
---
## 🔧 Installation & Run Locally
1. **Clone the repository**
```bash
git clone https://github.com/Krutarth-2004/Chess.git
cd Chess
```
2. **Install dependencies**
```bash
npm install
```
3. **Run the server**
```bash
npm start
```
4. **Open in browser**
```bash
http://localhost:5000
```
---
## 🌐 How It Works
The server assigns players as White or Black.
Additional players become Spectators.
Moves are validated server-side using chess.js.
Board state is synchronized in real time via Socket.IO.
Players can offer a draw, resign, or restart the game.
---
## 🧠 Future Improvements
User authentication
Match history or leaderboard
Chat support
Invite-based private rooms
Timed games (countdown per move)
---
## 🙌 Credits
Inspired by real-time chess tutorials and customized for a clean, interactive multiplayer experience.
---
## 🙋♂️ Author
Krutarth Kadia
- 📧 krutarthkadia@gmail.com
- 🐙 GitHub: @Krutarth-2004
- 🔗 LinkedIn: https://www.linkedin.com/in/krutarth-kadia-76652931a/
---
## ⭐️ If you like this project...
Please consider giving it a ⭐ on GitHub! It helps others discover it 🙌