The problem
An online chess game web app with multiplayer and move history solves a simple frustration: playing chess with a friend online usually means a bare board with no record of what happened, no clock and no way to review the game. Players lose memorable games the moment the tab closes, and students who want to study their play have nothing to analyse. Existing free chess sites solve this, but their code is closed, so a student cannot open the engine, the room system or the history store to learn how any of it works. This project builds the whole loop as a working web app: players create or join rooms, play full-rule chess over WebSockets, and every move is validated, stored in standard algebraic notation and replayed in a review view with timers and captured pieces. The result is a complete real-time multiplayer system a student can demonstrate live, explain move by move and extend with ratings, chat or analysis.
Signs in, browses the lobby and clicks a piece to see its legal moves.
Follow the working sequence
How it works
The online chess game web app works as a short loop from the lobby to the review screen. A player signs in, browses the lobby and joins a room or creates one with a chosen time control; the server seats two players, assigns colours and starts both clocks. When a player clicks a piece, the frontend asks the rules engine for that piece's legal moves and highlights them on the board; clicking a highlighted square sends the move to the server, which validates it again, applies it, flips the clock and broadcasts the new position to both players. Every validated move is appended to the game's history in standard algebraic notation and stored in PostgreSQL with the clock readings. When the game ends by checkmate, stalemate or timeout, the server records the result, updates both ratings and opens the review view, where either player can step through the game move by move.
- The player signs in and the lobby shows open rooms with host, rating, time control and player count.
- Joining a room (or creating one) seats two players; the server assigns colours and starts both clocks.
- Clicking a piece highlights only its legal moves; illegal squares cannot be selected.
- The chosen move is sent to the server, validated a second time, applied, and broadcast to both players over Socket.io.
- The server appends the move to the game history in standard algebraic notation and stores it in PostgreSQL with the clock readings.
- Checkmate, stalemate or a timeout ends the game; the server records the result and updates both players' ratings.
- Either player opens the review view and steps through the finished game from the first move to the last.
Tech stack:
- React with Vite (frontend)
- Node.js with Express (game server)
- Socket.io (real-time moves and clocks)
- PostgreSQL (accounts, ratings, stored games)
- chess.js rules engine (legal-move validation)
- Tailwind CSS (interface styling)
- JSON Web Tokens (sign-in sessions)
- Docker (deployment packaging)
| Parameter | Value |
|---|---|
| Board | 8 × 8 squares, 64 squares total (standard chess board) |
| Pieces | 32 pieces at the start of a game (design) |
| Legal moves in the demo position | 28 moves for White from the Ruy Lopez position after 9...b5 (measured in the demo build) |
| Move validation speed | Under 1 ms per full legal-move list (measured: approximately 0.09 ms per generation in the demo build) |
| Time controls | 4 options in the base build: 1, 3, 10 and 15 minutes (design) |
| Players per room | 2 players per game room (design) |
| Move history | Every move stored as standard algebraic notation text (design) |
| Review game used in the demo | 33 plies, 12 captures, 17 full moves (counted from the Morphy 1858 game) |
| Stack | React, Node.js with Socket.io, PostgreSQL |
| Demo | Single-file HTML demo, runs offline after download |
Project features
The online chess game web app stands on four capabilities that work together: real-time multiplayer rooms, a rules engine that only allows legal moves, a complete move history in standard algebraic notation, and a review view that replays finished games. The multiplayer rooms carry the live game — players join a room, the server pairs them, and every move travels over WebSockets in milliseconds. The rules engine is the trust layer: it generates legal moves with check detection, castling, en passant and promotion, so an illegal move can never reach the board. The move history turns each game into a record: every move is stored with its notation, the clock readings and the captured pieces, and the review view steps through the game from the opening to checkmate. Timers, lobby browsing and accounts complete the system.
- [Real-time multiplayer rooms] Players create or join rated or casual rooms from the lobby; moves, clocks and results travel over Socket.io, and the server is the single source of truth for the board state.
- [Full legal-move validation] The rules engine generates only legal moves with check detection, castling, en passant and auto-queen promotion; illegal moves are rejected before they reach the board or the history.
- [Move history in standard algebraic notation] Every move is stored as SAN text with its move number, so any finished game can be replayed exactly, shared as a score sheet, or exported.
- [Finished-game review view] Step forward and back through a completed game on the board, with the full move list, captures, result and game statistics beside it.
- [Player timers] Each player gets a configurable clock (1, 3, 10 or 15 minutes in the base build); the clock runs for the side to move and a timeout decides the game.
- [Lobby with open rooms] The lobby lists waiting rooms with host, rating, time control and player count, plus a create-room form for rated or casual games.
- [Accounts and stored games] Players sign up, their ratings and finished games are stored in PostgreSQL, and past games can be reopened from the review view.
What is included
- Complete source code: React frontend, Node.js with Socket.io game server, PostgreSQL schema
- Working demo HTML with a playable board, lobby view and finished-game review view
- Setup instructions for running the server locally and deploying with Docker
- Project report PDF (background, architecture, WebSocket flow, rules engine, methodology)
- PPT presentation for final review
- Viva Q&A preparation document (WebSockets, chess rules, SAN notation, database design)
- Project abstract PDF
Limitations & prerequisites
- The base build has no strong computer opponent — the demo plays random legal moves, and a rated engine such as Stockfish is an optional extension.
- No anti-cheating detection: a player could consult a chess engine in another tab during a game.
- 2 players per room by design; there is no spectator mode in the base build.
- A dropped WebSocket connection pauses the game rather than auto-resigning the disconnected player.
- The review view shows moves, captures and the result only; there is no built-in move analysis or hint system.
- Ratings are stored per account inside the app; there is no official FIDE rating integration.
Frequently Asked Questions
Is this project suitable for a final-year project?
Yes — for Computer Science, IT and Web Development students. It demonstrates real-time WebSocket communication, a rules engine with legal-move generation, database-backed game storage, authentication and a polished interface in one complete system. The demo board, lobby and review view give a live demonstration, and the report explains the server flow, the validation logic and the data model for the viva.
How does multiplayer work without refreshing the page?
Through a persistent Socket.io connection between each browser and the Node.js server. When a player moves, the server validates the move, updates the game state and pushes the new position to both players instantly, so the board, clocks and move history stay in sync without any page reload.
Can a player make an illegal move?
No. The frontend only highlights legal moves for the selected piece, and the server validates every move again before applying it. The rules engine covers check detection, castling, en passant and promotion, so a move that leaves the player's own king in check or breaks a piece's movement rule is rejected.
What does the move history store, and can games be replayed?
Each game stores every move as standard algebraic notation text with its move number, plus the clock readings and the result. The review view reads that stored list and steps through the game on the board from the first move to checkmate, so any finished game can be replayed exactly.
Can this be hosted online?
Yes. The frontend is a static React build and the game server runs on Node.js with PostgreSQL; the included Docker setup packages both for a small cloud server. The demo HTML runs offline after download, but live multiplayer needs the server and database running.
Can ratings, chat or computer analysis be added?
Yes, all three are realistic extensions. Ratings are already stored per account, so a leaderboard is a small addition; chat is a standard Socket.io room channel, and engine analysis with Stockfish is listed as an optional extension in the report.
Components & software requirements
- React with Vite (frontend)
- Node.js with Express (game server)
- Socket.io (real-time moves and clocks)
- PostgreSQL (accounts, ratings, stored games)
- chess.js rules engine (legal-move validation)
- Tailwind CSS (interface styling)
- JSON Web Tokens (sign-in sessions)
- Docker (deployment packaging)
Delivery information
Built-to-order project. Delivery timeline is shared after order confirmation based on current queue.
Support terms
Complete documentation, setup guide, and viva preparation included. Support for setup and explanation provided.
Download free synopsis (PDF)
Enter your name and WhatsApp number — the synopsis PDF downloads immediately. We may send occasional project updates on WhatsApp; no spam.