GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - LabinatorSolutions/stockfish-chess-web-gui: Responsive chess web GUI to play against the Stockfish 18 chess engine. Multiple web GUI implementations have also been included.

BranchesTags
Open more actions menu

Latest commit

 

History

177 Commits
177 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
assets
assets
 
 
public
public
 
 
scripts
scripts
 
 
src
src
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.node-version
.node-version
 
 
CLAUDE.md
CLAUDE.md
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE.md
LICENSE.md
 
 
README.md
README.md
 
 
SECURITY.md
SECURITY.md
 
 
biome.json
biome.json
 
 
bun.lock
bun.lock
 
 
favicon.png
favicon.png
 
 
headers.js
headers.js
 
 
headers.test.js
headers.test.js
 
 
index.html
index.html
 
 
netlify.toml
netlify.toml
 
 
package.json
package.json
 
 
server.js
server.js
 
 
tsconfig.json
tsconfig.json
 
 

Repository files navigation

Stockfish Chess Web GUI

License Package mgr · Bun Language · JavaScript Lint · Biome Hosting · Netlify

A modern, responsive, and fully functional web-based chess application powered by the Stockfish 19 engine.


📖 Table of Contents

  • Overview
  • Live Demo
  • Mission
  • Features
  • Tech Stack
  • Project Structure
  • Installation & Development
  • Configuration
  • Security Requirements
  • Development & Contribution
  • Credits
  • License

Overview

It is a web graphical user interface (GUI) for the Stockfish Chess engine. It allows you to play against one of the strongest chess engines in the world directly in your browser, with professional-grade analysis tools and a highly customizable interface.


Live Demo

There's no hosted public demo right now. The app itself is free — Stockfish runs client-side as WebAssembly in your own browser, so we don't pay per-user compute costs. The blocker is bandwidth/hosting: a public demo draws uncontrolled traffic, and serving the app (plus WASM binaries and assets) at scale isn't free for us to host indefinitely.

Run it locally instead — see Installation & Development below, it takes two commands.

More free BoldChess tools, all in the browser: play the computer, analyze a game, solve tactics and explore openings. For Android there is also the BoldChess Trainer app (human-picked puzzles and game analysis, a one-time purchase).


Mission

Our mission is to develop a modern, responsive, free, and open-source web-based chess GUI that brings the power of Stockfish to everyone, anywhere, on any device.


Features

  • Multi-Mode Gameplay:

    • vs. Stockfish (Engine): Play against the engine with customizable strength.
    • Local PvP (Pass-and-Play): Two players on the same device.
    • Side Swap: Switch colors mid-game; the board flips and the engine takes over the other side instantly.
    • Analysis Mode: Infinite analysis for post-game review.
  • Board & Piece Customization:

    • 12 Board Themes: Brown Wood, Red Wine, Green Forest, Blue Sky, and more, optimized for eye comfort.
    • Piece Sets: Choose between Standard and Staunty sets.
    • Persistent Settings: Your preferences are automatically saved in local storage.
  • Advanced Analysis Tools:

    • Multi-threaded Analysis: Leverage your CPU's power (requires COOP/COEP headers).
    • Customizable Engine Parameters: Adjust Skill Level (1-20), Elo Rating, Fixed Depth (1-36), and Thinking Time.
    • Visual Aids: Hint button for best-move visualization and a toggleable analysis arrow.
    • Real-time Eval: Display real-time evaluation and the top 2 Principal Variations (PVs).
    • Annotations: Right-click to draw arrows and markers on the board.

Tech Stack

  • Bun: Fast runtime, package manager, and native bundler.
  • Biome: Ultra-fast linter and formatter.
  • cm-chessboard: High-quality chessboard visualization.
  • chess-console: Robust game logic and state management.
  • Stockfish.js / cm-engine-runner: Seamless chess engine abstraction.
  • Bootstrap 5: Responsive UI styling.

Project Structure

├── src/
│   ├── Config.js                # Core app and engine configuration
│   ├── CustomStockfishRunner.js # Engine communication layer (UCI options, info-line parsing)
│   ├── GameImport.js            # FEN/PGN validation for Setup / Import
│   ├── StockfishAnalysis.js     # Analysis panel (second engine instance, MultiPV)
│   ├── StockfishGameControl.js  # Extra toolbar buttons
│   ├── StockfishNewGameDialog.js# Game setup modal
│   ├── StockfishPlayer.js       # Engine move generation logic
│   ├── StockfishStateView.js    # Engine status and evaluation UI
│   ├── main.js                  # App initialization and wiring
│   ├── *.test.js                # Unit tests (bun test)
│   └── extensions/              # RightClickAnnotator: right-click arrows and markers
├── public/                      # Copied to dist/ as-is (engine worker + .wasm, manifest, icons)
│   └── _headers                 # Security headers: the single source for Netlify and server.js
├── scripts/                     # Build steps: copy-assets, inject-static-tags
├── server.js                    # Local server for dist/ with security headers
├── headers.js                   # Reads public/_headers for server.js
├── index.html                   # Main entry point
└── assets/                      # Styles, sounds, and opening books

Installation & Development

1. Install Dependencies

bun install

2. Start Development Server

bun run dev

Open http://localhost:3737. This runs the Bun bundler in watch mode and serves the app via server.js to ensure the required security headers are present. Set PORT to use another port, e.g. PORT=4000 bun run dev.

3. Build for Production

bun run build
bun run preview   # serve dist/ locally

The optimized output will be in the dist directory.

4. Checks

bun run lint        # Biome lint + format check (lint:fix to apply)
bun run typecheck   # tsc over the JS sources (checkJs)
bun run test        # unit tests

Configuration

Core constants and default settings are located in src/Config.js.

Setting Default Description
NAME Stockfish 19 Engine display name; keep in sync with the worker file
DEFAULT_SKILL_LEVEL 20 Engine strength (1-20)
DEFAULT_DEPTH 16 Default thinking depth
WORKER_PATH /engine/...js Path to the Stockfish Web Worker
DEFAULT_THEME brown-wood Initial board theme

Security Requirements

Stockfish 19 utilizes multi-threaded WebAssembly, which depends on SharedArrayBuffer. For security reasons (Spectre/Meltdown mitigation), modern browsers only enable this feature if the page is cross-origin isolated.

The following headers MUST be present in your hosting environment:

  • Cross-Origin-Opener-Policy: same-origin
  • Cross-Origin-Embedder-Policy: require-corp

They are defined once, in public/_headers (with the Content Security Policy). Netlify and Cloudflare Pages read that file from dist/; server.js reads it too. On other hosts, set the same headers in the server config.

If these headers are missing, the engine will either fail to initialize or fall back to a slower, single-threaded mode. The bundled coi-serviceworker.js tries to add them client-side as a fallback.


Development & Contribution

We welcome contributions! Please feel free to open issues or submit pull requests.

Interested in more advanced chess tools? Check out our flagship app: 👉 BoldChess Web App


Credits

  • Stockfish: Official Engine
  • Stockfish.js: WASM Port
  • BoldChess: boldchess.com
  • Labinator: labinator.com

License

This project is licensed under the GNU AGPLv3. See the LICENSE file for details.


Verified and maintained by BoldChess.com | A project by Labinator.com

About

Responsive chess web GUI to play against the Stockfish 18 chess engine. Multiple web GUI implementations have also been included.

boldchess.com/

Topics

chesschess-boardchess-enginechess-engine-guichess-gamechess-interfacechess-javascriptchess-jschess-webaplicationchessboardstockfishstockfish-engineweb-appweb-gui

Resources

Readme
AGPL-3.0 license

Code of conduct

Code of conduct

Contributing

Contributing

Security policy

Security policy
Activity

Stars

74 stars

Watchers

3 watching

Forks

52 forks
Report repository

Sponsor this project

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.