A full-stack real-time chess application built with React + TypeScript on the frontend and Node.js + Socket.IO on the backend. It supports multiplayer games, move validation, check/checkmate detection, and highlights all possible moves for a selected piece.
-
Real-time multiplayer using WebSockets
-
Full chess rules:
-
Legal move validation
-
Check, checkmate, stalemate detection
-
En passant, castling, promotion
-
-
Interactive UI:
-
Highlights selected pieces and possible moves
-
Displays captured pieces and current turn
-
-
Configurable board themes and piece skins.
-
Clone the repository:
git clone https://github.com/Yusha254/2D-Chess.git
-
Install Dependencies:
Frontend:
npm i
Backend:
cd chess-backend npm i -
Run the project:
Start frontend:
npm run dev
Start backend:
cd chess-backend npm run startThe frontend will run on http://localhost:5173/ and connect to the backend WebSocket server at http://localhost:4000.
- ChessBoard - Main interactive board where players make moves.
- GameInfo - Shows turn, check/checkmate status, resign/draw options.
- ChessPiece - The different game pieces.
- Move Highlighting - Selected Piece + all legal moves shown.
This project lets two players play a complete chess game in real time.
-
The frontend handles UI rendering and move highlighting.
-
The backend ensures rules are followed, validates moves, and broadcasts game state to both players.
It’s a foundation for extending into tournaments, user accounts, or AI opponents.