Commit graph

5 commits

Author SHA1 Message Date
Danny
17248e239b refactor: drop the slash-command bot — Mini App is the only interface
bot.py is gone. /start, /history, /stats, /delete, /export,
/feedback, and the text-message workout parser are no longer
exposed. Everything those commands did is already available in
the Mini App (history listing, stats, edit/delete, JSON export
via /api/export/json, etc.).

Why: prod runs behind a Mini App URL, and shipyard staging is a
tenant under the existing shipyard_poc_bot which polls Telegram
itself. A second polling process on the same token would 409. By
removing polling entirely, prod and staging share one
architecture: a pure HTTP server validated against whatever
BOT_TOKEN is provided.

Changes:
- delete bot.py
- start.py: stop spawning the bot subprocess; load token, start
  server, optionally start cloudflared. WEBAPP_URL still skips
  the tunnel.
- flake.nix / requirements.txt: drop python-telegram-bot.
- README: rewrite to reflect Mini-App-only architecture.

The prod systemd unit doesn't need to change — its ExecStart is
`python start.py`, which now boots only the server (+ no tunnel
since WEBAPP_URL is set in the unit env).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-10 13:40:28 +02:00
Danny
e7ac2b174f feat(tg-fitness-bot): add test suite with pre-commit hook
pytest + pytest-asyncio in flake.nix. 53 tests covering parser
(all formats, error cases) and db (CRUD, soft delete, update,
stats, pagination). Pre-commit hook runs tests when fitness bot
files are staged.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 20:41:03 +02:00
Danny
f2cfe72d63 Switch from localtunnel to cloudflared, fix static file serving
- Replace localtunnel with cloudflared (no interstitial password page)
- Wait for "Registered tunnel connection" before starting bot
- Serve index.html at / instead of directory listing
- Remove localtunnel npm package build from flake.nix

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 20:35:05 +01:00
Danny
f025e5fd19 Add Telegram Mini App (web UI + API server + localtunnel)
- server.py: aiohttp API serving webapp/ and REST endpoints using existing db.py
- start.py: orchestrator that loads token, starts server + localtunnel + bot
- webapp/: Mini App frontend (Log, History, Stats) with Telegram-native theming
- bot.py: added Mini App menu button and inline button on /start
- flake.nix: added aiohttp + localtunnel, nix run now uses start.py
2026-03-24 20:17:36 +01:00
Danny
817cf8fd95 feat(tg-fitness-bot): initial Telegram workout tracker bot
Python bot that parses workout messages (Exercise: SetsxRepsxWeight),
detects supersets from consecutive lines, extracts machine IDs, stores
both raw message text and parsed data in SQLite, and reads original
timestamps from forwarded Saved Messages.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 15:50:05 +01:00