Telegram bot + Mini App for splitting shared expenses (trips, parties, shared flats).
GitHub Pages (static) Your PC: python run.py
https://prostoyus.github.io/split-bot/ ┌────────────────────────────────────┐
webapp/ ── fetch() ──► │ cloudflared quick tunnel (https) │
│ └► FastAPI 127.0.0.1:8080 │
│ aiogram bot (long polling) │
│ SQLite data/split.db │
└────────────────────────────────────┘
webapp/ — the Mini App (plain HTML/CSS/JS), served by GitHub Pages.app/ — backend: FastAPI API, SQLite database, business logic, Telegram initData auth.bot/ — aiogram 3 bot: /start, /debts, /help, invite links, notifications, reminders.tunnel.py — starts a free Cloudflare quick tunnel so the Mini App can reach the API on your PC.run.py — starts everything in one process.The bot and the API work only while run.py is running. The tunnel URL changes on every start;
the bot passes it to the Mini App automatically.
See SPEC.md for the full technical spec (data model, API, auth).
/newbot) and copy the token.Install dependencies:
python -m venv .venv
.\.venv\Scripts\python.exe -m pip install -r requirements.txt
cloudflared-windows-amd64.exe from
cloudflare/cloudflared releases
and save it as tools\cloudflared.exe..env.example to .env and set BOT_TOKEN.Run:
.\.venv\Scripts\python.exe run.py
.\.venv\Scripts\python.exe -m pytest -q
.env (bot token) and data/ (database) are never committed.initData (HMAC with the bot token, max age 24h).*.trycloudflare.com or localhost API addresses.webapp/app.js whitelist.