Checkiski is a modern, real-time multiplayer chess platform built with a Next.js React frontend and a .NET 8 WebApi backend. It features an integrated custom C# chess engine, real-time WebSocket communication, and an interactive UI powered by Stockfish WebAssembly.
- Frontend: Next.js (React), TypeScript, Tailwind/Custom CSS,
chess.js(for UI board validation), SignalR Client, Stockfish.js (WebAssembly). - Backend: .NET 8 WebApi, MediatR (CQRS Pattern), Entity Framework Core (PostgreSQL), ASP.NET Core SignalR (Real-time events).
- Caching & Matchmaking: Redis.
- Authentication: JWT Bearer Tokens.
- Live move broadcasting via SignalR.
- Seamless reconnects and persistent game states using PGN loading.
- Sub-second synchronized Game Clocks for true Bullet/Blitz/Rapid gameplay.
- Custom Game Creation: Select Time Controls (Bullet 1|0, Blitz 3|0, Rapid 10|0, Classical 30|0), Color (White, Black, Random), and Ranked status.
- In-Game Actions: Resign, Offer Draw, Abort Game.
- Live Chat: Send messages instantly to your opponent within the match room.
- Move Tracking: Interactive Move History panel with step-by-step PGN review.
- Built-in Stockfish 16.1 engine running directly in the browser via WebAssembly.
- Analysis mode after game completion, rendering evaluation bars and drawing arrows for the best mathematical move on the board.
- User authentication and secure JWT validation.
- User Profiles: View and edit Username, Avatar URL, Bio, and Country.
- ELO tracking framework.
Extensive testing has been done to ensure engine stability and network reliability. Below are the key test cases executed:
- Pawn Mechanics: Validated standard pushes, double-step pushes, diagonal captures, En Passant edge cases, and automated Queen promotion.
- King & Castling: Tested absolute bounds limits, ensuring castling calculations don't throw Out-Of-Bounds exceptions. Ensured castling is prohibited if moving through check.
- Mate Detection: Validated deep Checkmate and Stalemate scenarios. Ensured the color checking logic perfectly switches turns and evaluates the correct king.
- Game Creation: Validated complex JSON payloads, fixing initial 400 Bad Request issues by mapping parameters cleanly to DTOs.
- Circular Serialization: Confirmed EF Core navigational loops (e.g.
Game->WhitePlayer->GamesAsWhite) do not break API responses, successfully mitigated by DTO mapping and.IgnoreCyclesconfiguration.
- Clock Synchronization: Validated that the backend properly broadcasts
WhiteClockandBlackClockremaining times upon every move, and that the frontend updates its timers accurately. - State Preservation: Confirmed that refreshing the browser fetches the latest PGN and FEN, cleanly rebuilding the board state without desynchronizing.
- Verified automated login flows.
- Automated tests simulating piece dragging/dropping.
- Validated real-time UI reactions to game end conditions (Checkmate overlays, Resign handshakes).
To run this project on your local machine, ensure you have the following prerequisites installed:
- Node.js (v18 or higher)
- .NET 8 SDK
- PostgreSQL (Running on default port 5432)
- Redis (Running on default port 6379)
(Note: On Windows, you can right-click and run install_dbs.ps1 with PowerShell to automatically install PostgreSQL and Redis via Chocolatey).
We have included a startup script to make running the project as easy as possible:
- Open PowerShell and navigate to the root of the project.
- Run the
start_project.ps1script:.\start_project.ps1
This script will automatically:
- Install all Node.js dependencies (
npm install) for the frontend. - Apply Entity Framework Core database migrations to create the PostgreSQL tables.
- Launch the Backend API in a new window (
http://localhost:5000). - Launch the Next.js Frontend in a new window (
http://localhost:3000).
If you are on macOS/Linux or prefer to run the commands manually:
-
Database Setup: Ensure PostgreSQL and Redis are running. Verify your connection string in
Checkiski.WebApi/appsettings.json.cd Checkiski.Infrastructure dotnet ef database update --startup-project ../Checkiski.WebApi -
Start Backend:
cd Checkiski.WebApi dotnet run -
Start Frontend:
cd Checkiski.Client npm install npm run dev
Open http://localhost:3000 in your browser and enjoy the game!