/boldchess-web-app

A responsive web-based chess app and graphical user interface (GUI) for the Stockfish chess engine, featuring analysis, evaluation, and graphical representations. It is the official chess app of BoldChess.com.

Primary LanguageJavaScriptGNU Affero General Public License v3.0AGPL-3.0

BoldChess Web App

Web GUI JavaScript Node.js Version Express.js Stockfish Chess Engine Mobile Ready Issues License

The official chess web-based app of BoldChess.com. It is a responsive web GUI for the Stockfish chess engine, offering analysis, evaluation, and graphical features.


Mission

Our mission is to develop a modern, responsive, free, and open-source web-based chess app powered by the Stockfish chess engine.


Live Version


Features

  • Load your chess position or game using FEN, PGN, or a move list.
  • Set up pieces manually in edit mode.
  • Browse game history with arrows or mouse wheel.
  • List and show all legal moves on the chessboard.
  • Analyze positions and legal moves using the JavaScript version of Stockfish.
  • Display an evaluation graph with visual indicators for blunders.
  • Open a position or game in a new window via a URL.
  • Play against the computer (Stockfish) and set its difficulty level.
  • Detect opening categories or ECO codes.
  • Customize the styling of the chessboard.
  • Print arrows or mark squares on the chessboard.
  • Visualize relevant squares based on Stockfish's static evaluation terms.
  • Dark interface with a pitch-black background for OLED screens, enhancing battery life and user experience.
  • Support for PCs, tablets, smartphones, and touch devices.

Available Windows

  • Chess Openings
  • Chessboard
  • Edit Board
  • Game History
  • Evaluation Graph
  • List of Moves
  • Static Evaluation

GUI Instructions

  • To open your FEN or PGN, copy it to the clipboard and paste it into the input box above the chessboard.
  • To browse the game, use the mouse wheel on the chessboard or the arrow buttons.
  • To open or hide windows, click on the small icons at the top of the GUI.
  • To play against the engine or set its difficulty level, click on the hamburger menu.
  • To change the board styling, flip the board, or open it in a new window, click on the hamburger menu.

Installation

  1. Prerequisites:

  2. Repository Setup:

    • Clone the repository to your local machine.
    • Navigate to the project directory.
  3. Dependency Installation:

    • Install the project dependencies:
      npm install
  4. Local Server:

    • Start the local development server:
      npm run start
    • Access the application at http://localhost:3000 in a web browser.

HTTP Headers Setup

The app is currently using Stockfish NNUE 16 JS, which utilizes the SharedArrayBuffer. To ensure the engine functions correctly, you need to enable SharedArrayBuffer support both locally and on your server. This involves setting appropriate HTTP headers.

To enable SharedArrayBuffer, you must configure the following HTTP headers:

  1. Cross-Origin-Opener-Policy (COOP): This should be set to same-origin.
  2. Cross-Origin-Embedder-Policy (COEP): This should be set to require-corp.

These headers isolate the context of your page and provide the necessary security guarantees for using SharedArrayBuffer. Properly configuring these headers will allow the Stockfish NNUE 16 JS engine to operate efficiently. Alternatively, you can switch to the Stockfish NNUE 16 Single JS which does not utilize the SharedArrayBuffer.

Read more about ShreadArrayBuffer at this link.


Server and Deployment

The application is designed for easy deployment in any standard Node.js environment.

Running the Server: The main entry point is server.js, which serves the static files in the public directory, eliminating the need for a build process. This simplifies deployment and development.

No Build Required: Reflecting the application's simplicity and the direct use of vanilla JavaScript, the 'build' script in package.json is intentionally minimal: echo 'No build required'. This is due to the architecture's focus on serving static assets without complex build processes or server-side rendering.


Important Improvements & Issues

For a list of important improvements and known issues, visit our GitHub Issues page.


Contribution

We welcome all developers to contribute by adding features or fixing bugs.

Current Contributors:

Visit the Contributors page to see the list of contributors.


License

This project is licensed under the GNU AFFERO GENERAL PUBLIC LICENSE (AGPLv3). For more details, see the AGPLv3 License.


Credits