Skip to content

mateuseap/chesskernel

Repository files navigation

♟️ ChessKernel

The open-source chess platform you actually control.
Real-time multiplayer · Stockfish analysis · Zero subscriptions.

CI Publish Images version license stars visitors


ChessKernel starting position

Why ChessKernel?

Chess platforms today lock features behind subscriptions, harvest your game data, and push ads on free users. ChessKernel is different: it runs entirely on your own server, gives every user the full experience for free, and keeps your games in a database you control.

  • No subscriptions. Every feature is available to every user.
  • No ads, no tracking. Your games belong to you.
  • Own your data. PostgreSQL, full PGN export, no vendor lock-in.
  • Batteries included. Stockfish engine, ELO matchmaking, and Glicko-2 ratings out of the box.

Features

Real-time Multiplayer WebSocket-powered live games with spectator support
🤖 Stockfish Engine Play against the world's strongest engine at any difficulty
📊 Game Analysis Move-by-move review with brilliant / good / mistake / blunder classifications
🏆 Rating System Glicko-2 with separate ladders for bullet, blitz, rapid, and classical
👥 Social Friend system, game invitations, shareable challenge links
📜 Game History Full archive with PGN export
🌍 Multilingual English, Portuguese, and Spanish
🐳 Docker-first One command to run the entire stack

Architecture

A React client served by nginx, which reverse-proxies the API and the realtime socket to a NestJS server. The server holds authoritative game state, drives Stockfish for analysis and bots, persists to PostgreSQL, and uses Redis for caching and pub/sub.

flowchart LR
    browser(["browser: React client"])
    nginx["nginx<br/>static assets + /api and /socket.io proxy"]
    server["NestJS server :3001<br/>authoritative games, Socket.IO"]
    stockfish["Stockfish<br/>analysis and bots"]
    postgres[("PostgreSQL<br/>users, games, ratings")]
    redis[("Redis<br/>cache + pub/sub")]

    browser -->|HTTPS static| nginx
    browser <-->|/api REST| nginx
    browser <-->|/socket.io WebSocket| nginx
    nginx <--> server
    server --> stockfish
    server --> postgres
    server --> redis
Loading

Moves are validated server-side with chess.js; ratings use Glicko-2. See docs/architecture and docs/backend for the full design.

Quick Start

git clone https://github.com/mateuseap/chesskernel.git && cd chesskernel
cp .env.example .env          # fill in your secrets
docker compose -f docker/docker-compose.prod.yml up -d

Open http://localhost and that's it.

Full configuration options, environment variables, and development setup: docs/deployment/setup.md

Stack

Layer Technology
Frontend React 18, Vite, TypeScript, Tailwind CSS, shadcn/ui
Backend NestJS, TypeScript, Prisma ORM
Database PostgreSQL
Cache & Pub/Sub Redis
Realtime Socket.IO
Chess Engine chess.js + Stockfish (binary / WASM)
DevOps Docker, Nginx, GitHub Actions

Documentation

Doc Description
System Overview Architecture diagram and component map
System Design Sequences, state machines, scaling plan
Backend Architecture Module map, auth flow, game state machine
Frontend Architecture Component tree, data flow, i18n
Database Schema ER diagram and table definitions
API Contracts REST endpoints and Socket.IO events
Security Auth model, move validation, rate limiting
Deployment Guide Docker setup, environment variables

Contributing

Read CONTRIBUTING.md and docs/development/git-workflow.md before opening a PR. The develop branch is the integration target; main is production-stable.

License

MIT, see LICENSE.

About

Free, open-source chess platform: real-time multiplayer, Stockfish analysis, Glicko-2 ratings. Self-host with Docker.

Resources

Contributing

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages