Commit graph

13 commits

Author SHA1 Message Date
Danny
547b07dba6 docs: add muscle emoji to README heading
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-17 14:41:40 +02:00
Danny
a4ccd9a107 docs: add LICENSE (MIT) and README
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-17 14:21:12 +02:00
Danny
42d79c9d90 chore(tg-fitness-bot): remove obsolete prototype subdirectory
The telegram-fitness-bot/ subdirectory was the initial scaffold,
superseded by the top-level implementation and unused since.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-17 11:29:59 +02:00
Danny
3703d87426 feat(tg-fitness-bot): /feedback command, feedback SQLite table
Users can send /feedback <text> to record feedback. Stored in a new
feedback table with user_id, text, created_at. Updated /start help text.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-17 11:22:43 +02:00
Danny
a529416599 feat(tg-fitness-bot): structured mini-app, edit workouts, draft persistence
Rebuilt Log view: exercise name input with autocomplete, per-set
entry (reps x weight), exercise cards with edit/remove. Comma and
dot both work as decimal separators. Notes field. Collapsible raw
text input as fallback.

Edit saved workouts from History (pencil icon). Loads exercises
into editor, Save becomes Update, Cancel returns to History.

localStorage draft persistence: auto-saves on every state change,
restores on reopen (24h expiry), clears on save.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 20:41:47 +02:00
Danny
6fb6207041 feat(tg-fitness-bot): soft delete, edit workouts, notes via API
Deleted workouts are marked with deleted_at instead of being removed.
All queries filter on deleted_at IS NULL. New update_workout() does
soft-delete + recreate preserving the original timestamp. PUT endpoint
at /api/workouts/{id}. POST /api/workouts now accepts a note field.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 20:41:37 +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
a934c46746 feat(tg-fitness-bot): multi-set format, delete, export, SQL stats
Parser now supports per-set notation (8x25, 5x35, 6x40),
bodyweight exercises (3x10), and asterisk separators.
Failed parse lines get user-facing error feedback instead of
being silently ignored.

Added /delete <id> and /export commands. Stats computed in SQL
instead of loading all workouts into memory. API gains DELETE,
CSV and JSON export endpoints.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 22:46:10 +02:00
Danny
ae09ab2eec feat(tg-fitness-bot): add telegram fitness bot with web app
Telegram workout tracker bot with Mini App web UI, SQLite database,
API server, and cloudflared tunnel support.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 22:46:10 +02:00
Danny
7288d93741 fix(start): force http2 protocol and drain cloudflared output 🐛
QUIC tunnels consistently returned 1033 errors. Forcing http2 fixes it.
Added a daemon thread to drain cloudflared's stdout pipe to prevent
buffer-full blocking that would kill the tunnel.
2026-03-29 18:58:16 +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