Skip to content

Repository files navigation

BGAnalyze

CI

BGAnalyze screenshot

BGAnalyze is a web-based frontend for GNU Backgammon analysis, delivered as a set of static files with no server or backend requirement. Upload a match file and get move-by-move analysis with an interactive board, move arrows, and match statistics -- entirely in your browser, via a WebAssembly build of the GNU Backgammon engine (gnubg-web). History is stored locally in the browser (IndexedDB); nothing leaves your browser.

Supported file formats: .mat, .sgf, .gam, .sgg, .tmg, .txt

Installation

  • Download the latest static build from the latest release and unzip it.

  • Serve the unzipped files with any static file server, e.g.:

    npx serve bganalyze-vX.Y.Z/
    # or
    python3 -m http.server 8000 --directory bganalyze-vX.Y.Z
  • Open the printed URL in your browser.

Opening index.html directly from disk (file://) will not work -- the in-browser analysis engine loads via fetch(), which browsers block for local files. Any HTTP server, local or otherwise, is sufficient.

Development

Prerequisites

  • Node.js 18+
  • Emscripten (emcc) -- only needed to build the gnubg WASM engine; see below

Build

make build

This regenerates the gnubg WASM engine (if public/gnubg/gnubg.wasm is missing or the build script/patch changed) and then builds the static site into dist/. The gnubg engine is built from the vendored source in third_party/gnubg-web (see third_party/gnubg-web/PROVENANCE.md) via scripts/build-gnubg-wasm.sh; the resulting public/gnubg/* artifacts are gitignored (gnubg.data alone is ~8MB) and regenerated on demand rather than committed.

Run

make dev      # Vite dev server with hot reload
make preview  # build, then serve dist/ as a production-like static site

Test

make test

Runs the frontend test suite (Vitest). Does not require Emscripten -- the WASM engine itself isn't exercised by the unit tests.

License

BGAnalyze's own code is licensed under the MIT License.

It bundles a WebAssembly build of gnubg-web (an Emscripten port of GNU Backgammon), which is licensed separately under the GNU General Public License v3.0. Corresponding source for that component is vendored at third_party/gnubg-web; see public/gnubg/ATTRIBUTION.md for details.

About

A web UI for backgammon analysis with gnubg

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages