Build the core user-facing experience with admin login (bcrypt + signed session cookies), profile switcher, workout day viewer with warmups and exercise cards, and HTMX-powered exercise browser with search/filter. - AuthService with bcrypt password verification and itsdangerous session tokens - Auth dependency redirects to /login (303) for unauthenticated requests - NavContextMiddleware injects admin/profiles/active_profile into all templates - Profile management (list, switch, edit) with cookie-based active profile - Workout day viewer shows warmups + exercises + per-user programming targets - Exercise browser with HTMX filter dropdowns (no page reloads) - Flash message partial for success/error feedback - 12 new tests (66 total passing) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
4.0 KiB
4.0 KiB
SneakySwole Roadmap
Phase 1: Scaffold & Infrastructure
Set up the project foundation — everything needed before writing features.
- FastAPI project structure (
app/with routes, services, models, templates, static, utils) - Dockerfile + docker-compose.yaml (SQLite volume, port 8000,
.envsupport) - Pico CSS dark theme base template (Jinja2 with
data-theme="dark") .env/.env.examplewith admin credentials (ADMIN_USERNAME,ADMIN_PASSWORD)uvfor dependency management,requirements.txtwith pinned versions- Structlog logging setup
- Basic health check route (
/health)
Phase 2: Data Layer & Seeding
Build the database schema and seed it from YAML config files.
- SQLite schema via Alembic migrations
- Tables: users, exercises, warmups, workout_days, user_exercise_programs, sets, progress_log
config/exercises.yaml— exercise library (name, muscle group, workout day, sets, tempo, form cues)config/user_programs.yaml— per-user week 1/4 reps and weights for each exercise- Seed script that loads YAML into DB on first run
- Admin user auto-created from
.envcredentials on startup (password hashed with bcrypt) - Two initial user profiles seeded: Phillip and Daughter
- Service layer for all DB access (no direct queries from routes)
Phase 3: Workout UI ✅
Completed: 2026-02-24
Summary: Built the core user-facing experience — admin login with bcrypt + signed session cookies, profile switcher, workout day viewer with warmups and exercise cards, and HTMX-powered exercise browser with search/filter. Added Jinja2 context processor middleware for automatic nav context injection.
Key files:
app/services/auth_service.py— AuthService (bcrypt auth + itsdangerous session tokens)app/utils/auth.py—get_current_admin_user(303 redirect to /login),get_active_profile_idapp/routes/auth.py— login/logout routesapp/routes/profiles.py— profile list, switch, edit routesapp/routes/workouts.py— workout day list + detail viewerapp/routes/exercises.py— exercise browser with HTMX searchapp/templates/partials/nav.html— profile switcher dropdown (reads from request.state)app/main.py— NavContextMiddleware, secret_key, all routers registered
Endpoints created:
GET /login— render login formPOST /login— authenticate and set session cookieGET /logout— clear session, redirect to /loginGET /profiles— list user profilesPOST /profiles/switch— set active profile cookieGET /profiles/{id}/edit— profile edit formPOST /profiles/{id}/edit— update profileGET /workouts— workout day cardsGET /workouts/{day_name}— warmups + exercises + programming targetsGET /exercises— exercise browser with filter dropdownsGET /exercises/search— HTMX partial for filtered exercise list
Key details:
- Auth uses 303 redirect to /login (not 401) for browser UX
- Nav context injected via
NavContextMiddlewareintorequest.state(admin, profiles, active_profile) - Session cookie: httponly=True, samesite="lax", max_age=86400 (24h)
itsdangerous>=2.2.0added to requirements.txtpython-multipart>=0.0.20added for form data parsing- 66 tests pass (12 new Phase 3 tests + 54 existing)
Phase 4: Logging & Tracking
Enable workout logging so users can track what they actually did.
- Per-exercise logging: sets completed, reps, weight used, "felt easy?" toggle
- Workout session model (date, user profile, workout day)
- HTMX inline logging — log directly from the workout day view
- Log history view per user profile
- Edit/delete past log entries
Phase 5: Progression & Analytics
Smart suggestions and visual progress tracking.
- Auto-progression engine based on log history
- +1-2 reps/week, +5 lbs every 2 weeks
- Deload detection at week 5 (-20% weight)
- 4-week schedule view (calendar-style, shows which day maps to which date)
- Progress dashboard per user profile
- Per-exercise progress history and trends
- Summary stats (total volume, streak tracking)