Architecture

How it's built

Telegram, one router in an Edge Function, independent modules, Supabase as the database and importers on GitHub Actions. Few parts, each with one clear job.

The path of a message

A Telegram message arrives through a webhook at an Edge Function in Supabase. The function confirms right away, so Telegram doesn’t resend it, and finishes the work in the background. The router uses plain rules to find the module and the command. Text without a command goes straight to the trainer.

Data

Importers are small Python scripts that run on GitHub Actions once a day. They fetch new data, turn it into table rows and save them. Running them again creates no duplicates. When something fails, an alert arrives on Telegram and a row lands in the operations log. Nothing fails silently.

AI

The router has no AI. Claude Sonnet writes the trainer’s answers, Claude Haiku pulls details out of free text, such as “I’ve been sick since yesterday”. Every call is logged with its cost, so it’s always clear what the system costs to run.

Two environments

dev and prod are fully separate: their own database, their own bot, their own secrets. Everything goes to dev first. Deploying to prod is just a merge into main.

Builder agents

Two agents in Claude Code help build the system. The requirements-agent turns an idea into a clear task with acceptance criteria. The dev-agent implements it on its own branch, with tests and docs, and opens a pull request. Each task’s status lives on a GitHub project board. Merging and deploying is always done by a person.

This site

A static Astro site on Vercel. No backend, no cookies, no third-party scripts. Before every build, a privacy check looks for anything that doesn’t belong on a public site and stops the build.