docs: replace implementation plans with architecture and API reference docs
Remove phase implementation plans, design notes, and source spreadsheet that are no longer needed. Add architecture.md, API_REFERENCE.md, and database_schema.md for ongoing development and debugging reference. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,85 +1,30 @@
|
||||
# SneakySwole Roadmap
|
||||
|
||||
## Phase 1: Scaffold & Infrastructure
|
||||
## Completed
|
||||
|
||||
Set up the project foundation — everything needed before writing features.
|
||||
### Phase 1: Scaffold & Infrastructure
|
||||
FastAPI project structure, Dockerfile + docker-compose.yaml, Pico CSS dark theme base template, `.env` config, structlog logging, health check endpoint.
|
||||
|
||||
- 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
|
||||
8-table SQLite schema via SQLModel + Alembic migrations. YAML-driven seed script (`config/exercises.yaml`, `config/user_programs.yaml`). Service layer for all DB access. Admin user auto-created from `.env` with bcrypt.
|
||||
|
||||
## Phase 2: Data Layer & Seeding
|
||||
### Phase 3: Workout UI
|
||||
Admin login (bcrypt + signed session cookies), profile switcher, workout day viewer with warmups and exercise cards, HTMX-powered exercise browser with search/filter. NavContextMiddleware for automatic template context.
|
||||
|
||||
Build the database schema and seed it from YAML config files.
|
||||
### Phase 4: Logging & Tracking
|
||||
Inline set logging from the workout day view via HTMX. Auto-created workout sessions. Log history with per-session detail view. Edit and delete log entries.
|
||||
|
||||
- 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 5: Progression & Analytics
|
||||
Auto-progression engine (+reps/+weight/deload rules), 4-week schedule calendar, progress dashboard with Chart.js charts, per-exercise progress pages with suggestions.
|
||||
|
||||
### Phase 3: Workout UI ✅
|
||||
---
|
||||
|
||||
**Completed:** 2026-02-24
|
||||
## Future Ideas
|
||||
|
||||
**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)
|
||||
- Multi-user login (replace profile switcher with individual logins)
|
||||
- REST API for mobile clients
|
||||
- Exercise video/image attachments
|
||||
- Custom workout program builder
|
||||
- Export/import workout data (CSV/JSON)
|
||||
- Notifications/reminders
|
||||
- Social features (sharing workouts)
|
||||
|
||||
Reference in New Issue
Block a user