Skip to content

About

Realtime multiplayer chess built with Vite, chess.js, Stockfish WASM and Supabase, hosted on Netlify.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

FreeChess

Multiplayer chess in the browser, with Stockfish analysis built in

I built FreeChess because every big chess site either wants a subscription or shows ads. Here you open the page and play. No account needed, nothing to pay for. React 19, TypeScript, Vite, Supabase Realtime, and Stockfish running in your browser.

Live Demo React 19 TypeScript Vite Supabase License


Overview

FreeChess is a chess site I built and run on my own. You can play online against other people, against the computer at 20 levels, or pass-and-play on one device. Online games are created from the lobby in a couple of clicks. You play as a guest by default; an account is only there if you want a permanent username and rating.

Moves are checked on the server side, not just in the browser tab. Game state lives in Postgres, moves go through Supabase Edge Functions that validate them with chess.js, and Row-Level Security policies keep players from touching games that are not theirs. Realtime channels carry the moves, chat, draw offers and rematch requests between the two players.

After a game you can review it with Stockfish 19 compiled to WebAssembly, running in a Web Worker in your own browser. It marks blunders and mistakes, shows the best line, and draws the best-move arrow. The same review on Chess.com is limited on the free plan. Here there is no plan.


Interface Preview

Live Match Board

Live game
Clocks, move list, captured pieces, legal-move dots
Engine Analysis Board

Analysis board
Eval bar, engine lines, best-move arrow, opening explorer

Key Features

  • Play in seconds. Pick a time control and you are in a game. Guest play by default, private links for playing a friend.
  • Online play on Supabase Realtime: moves, chat, draw offers, takebacks in casual games, rematches, and disconnect detection.
  • Stockfish in the browser. Stockfish 19 (WASM) in a Web Worker powers the analysis board, hints, and the full game review with blunder detection.
  • Server-checked moves. Edge Functions validate every move with chess.js; Postgres RLS policies protect the game rows.
  • Puzzles. Daily puzzle, rated practice sets, and a 5-minute puzzle rush, all generated and verified with the rules engine.
  • Works on phones. Responsive layout, seven board themes, piece sets, and synthesized move sounds. No app install.
  • Tests. Vitest unit tests plus a Playwright end-to-end suite that plays full games between two browser contexts.

Tech Stack

Component Technology Purpose
Frontend Framework React 19 UI
Language TypeScript 5.9 Types across the app
Build Tool Vite 8 Dev server and production build
Chess Engine Stockfish WASM & chess.js Rules, move validation, engine evaluation
Backend & Realtime Supabase Postgres, Auth, Edge Functions, Realtime
Hosting & CI/CD Netlify & GitHub Actions Deploys on push to main
Testing Vitest & Playwright Unit and end-to-end tests

Getting Started

Prerequisites

  • Node.js: >= 20.x
  • npm: >= 10.x
  • Free Supabase account (for self-hosting backend)

Setup & Local Development

  1. Clone the repository:

    git clone https://github.com/CodeByPartho/chess-multiplayer.git
    cd chess-multiplayer
  2. Install dependencies:

    npm install
  3. Configure environment variables:

    cp .env.example .env

    Provide your Supabase URL and anonymous public key in .env:

    VITE_SUPABASE_URL=https://your-project-id.supabase.co
    VITE_SUPABASE_ANON_KEY=your-anon-key
  4. Start the local development server:

    npm run dev

    Open http://localhost:5173 in your browser.

  5. Run test suites:

    npm run test        # Unit tests via Vitest
    npm run test:e2e    # E2E tests via Playwright

License

This project is licensed under the MIT License.


Built by Partho

About

Realtime multiplayer chess built with Vite, chess.js, Stockfish WASM and Supabase, hosted on Netlify.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages