All projects

LearnBG

FastAPI · GNU Backgammon / 2025-26
LearnBG home page with sign-in for the backgammon tools

Inside a match review

Match report. Side-by-side columns compare the players’ errors in checker play and doubling decisions.
Match report. Side-by-side columns compare the players’ errors in checker play and doubling decisions.
Mistake review. The table below the board shows the move played and how the alternatives compare.
Mistake review. The table below the board shows the move played and how the alternatives compare.
Position editor. Move the checkers, change the roll or adjust the match score to evaluate a move again.
Position editor. Move the checkers, change the roll or adjust the match score to evaluate a move again.
Simplified analysis flow
  1. 01Telegram / Web
  2. 02FastAPI
  3. 03RQ + Redis
  4. 04GNU Backgammon CLI
  5. 05Analysis and exports

3

processes on two servers

7

paid services

2

interfaces: Telegram and web

Live productlearnbg.ruBackgammon web tools

A web platform for backgammon players. After a match, a player can upload the record, find a mistake and use the board to see which move was stronger.

Where it started

The first request was a small Telegram bot that sent match files. I continued developing the system as new needs emerged.

The problem

GNU Backgammon had no suitable API for the workflow. Its analysis was available through a CLI, while users needed clear results in a web interface.

What I built

  • Built an API wrapper around the GNU Backgammon CLI and parsed its console output
  • Added visualizations, an editable landing page and an article system
  • Separated the aiogram bot, FastAPI web service and RQ analysis worker into three processes on two servers
  • Kept Redis and PostgreSQL inside a private Tailscale network
  • Queued match files through S3 and RQ, with a Redis lock around the analysis engine
  • Decoupled the analysis worker from Telegram: the worker writes status to Redis and the bot sends notifications
  • Unified Telegram and web accounts, with seven paid services and balance checks in middleware
  • Added Flask-AppBuilder administration, match playback, error analysis, a position editor and PDF/Excel exports

How it evolved

The file delivery bot grew into a website for independent practice. Players can replay a game move by move, collect mistakes from several matches and revisit them in training.

The outcome

Users upload a match and receive error analysis, statistics and exports. A tool without a ready-made API is now integrated through a dedicated wrapper, queue and result processing.

What this demonstrates

Integrating a CLI tool, designing the backend and growing a product from a small initial feature.