Commit Graph

11 Commits

Author SHA1 Message Date
Christoph K.
063aa67615 Add exercise numbers, image uploads, version display, session resume, and training sparklines
- Exercise number (UF#): optional field on exercises, displayed in cards, training, and sets
- Import training plan numbers via migration 005 (UPDATE by name)
- Exercise images: JPG upload with multi-image support per exercise (migration 006)
- Version endpoint (GET /api/v1/version) with ldflags injection in Makefile and Dockerfile
- Version displayed on settings page
- Session resume: GET /api/v1/sessions/active endpoint, auto-resume on training page load
- Block new session while one is active (409 Conflict)
- e1RM sparkline chart per exercise during training (Epley formula)
- Fix CORS: add X-User-ID to allowed headers

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-27 08:37:29 +01:00
Christoph K.
833ad04a6f Add delete session functionality
- DELETE /api/v1/sessions/{id}: only closed sessions, user-scoped
- Returns 404 if not found/wrong user, 409 if session still open
- Deletes session_logs first, then session (no CASCADE)
- Frontend: trash button per session in SessionList (closed sessions only)
- Confirm dialog before delete, toast feedback, list reloads after

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 20:50:48 +01:00
Christoph K.
6d7d353ea2 Add database backup script
scripts/backup-db.sh copies the remote DB via scp to ./backups/
with a timestamp. Backups older than 30 days are auto-deleted.
Backup directory is gitignored.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 20:43:58 +01:00
Christoph K.
344bcfc755 Update deployment docs to reflect current Docker setup
- Docker is now the recommended variant
- Documents bind mount at /home/christoph/fitnesspad instead of Docker volume
- Adds DB import workflow via scp + docker compose down/up
- Notes that docker restart does NOT pick up compose changes
- Updates Go version in image table to 1.26
- Removes outdated Docker volume backup commands

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 20:43:21 +01:00
Christoph K.
f601c2030e Switch Docker volume to bind mount at /home/christoph/fitnesspad
Makes the database directly accessible on the host filesystem instead
of an opaque Docker volume.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 20:31:41 +01:00
Christoph K.
17dc9dbf3b Update Dockerfile to Go 1.26 to match go.mod requirement
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 00:01:11 +01:00
Christoph K.
c992e2775c Add systemd service file and installation guide
Adds krafttrainer.service for running as a systemd unit and expands
deployment.md with step-by-step instructions for both systemd and Docker deployment.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-21 23:59:04 +01:00
Christoph K.
a954f2c59d Add multi-user support with export feature
- New users table (migration 004) with user_id on exercises, training_sets, sessions
- User CRUD endpoints (GET/POST /api/v1/users, DELETE /api/v1/users/{id})
- All existing endpoints scoped to X-User-ID header
- CSV export endpoint (GET /api/v1/export) for completed sessions
- UserGate in PageShell: blocks app until a user is selected
- Settings page for managing users (create, switch, delete)
- BottomNav/Sidebar updated with settings navigation
- Fix: nil pointer panic in handleDeleteUser on success path
- Fix: export download now uses fetch with X-User-ID header instead of window.location.href

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-21 23:55:51 +01:00
Christoph K.
bff85908c3 make file update 2026-03-21 18:49:46 +01:00
Christoph K.
150ebe7d1d deployment improved 2026-03-21 15:10:12 +01:00
Christoph K.
dfd66e43c6 Initial commit
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-21 15:03:55 +01:00