Files
SneakySwole/docs/roadmap.md
Phillip Tarrant 23754ea239 feat: add Phase 3 Workout UI — auth, profiles, workout viewer, exercise browser
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>
2026-02-24 11:14:52 -06:00

86 lines
4.0 KiB
Markdown

# 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, `.env` support)
- Pico CSS dark theme base template (Jinja2 with `data-theme="dark"`)
- `.env` / `.env.example` with admin credentials (`ADMIN_USERNAME`, `ADMIN_PASSWORD`)
- `uv` for dependency management, `requirements.txt` with 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 `.env` credentials 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_id`
- `app/routes/auth.py` — login/logout routes
- `app/routes/profiles.py` — profile list, switch, edit routes
- `app/routes/workouts.py` — workout day list + detail viewer
- `app/routes/exercises.py` — exercise browser with HTMX search
- `app/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 form
- `POST /login` — authenticate and set session cookie
- `GET /logout` — clear session, redirect to /login
- `GET /profiles` — list user profiles
- `POST /profiles/switch` — set active profile cookie
- `GET /profiles/{id}/edit` — profile edit form
- `POST /profiles/{id}/edit` — update profile
- `GET /workouts` — workout day cards
- `GET /workouts/{day_name}` — warmups + exercises + programming targets
- `GET /exercises` — exercise browser with filter dropdowns
- `GET /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 `NavContextMiddleware` into `request.state` (admin, profiles, active_profile)
- Session cookie: httponly=True, samesite="lax", max_age=86400 (24h)
- `itsdangerous>=2.2.0` added to requirements.txt
- `python-multipart>=0.0.20` added 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)