Initial commit: full fitness-rewards app
Backend: FastAPI + PostgreSQL + SQLAlchemy async - Auth (JWT), onboarding (PAR-Q+, TTM, BREQ-2), activities, food log - Points engine with daily gate + weekly targets - Strava + Polar OAuth integration - Open Food Facts barcode lookup - Resource recommendation engine - 10 seeded Darebee/StrongLifts/YouTube programs Frontend: React + Vite, mobile-first dark theme - Login/Register, 8-step onboarding flow - Dashboard with daily gate status - Activity logger, food logger (manual + barcode scan + search) - Reward shop with redemption - Weekly summary view - Settings (point rules, targets, integrations) Deployment: Docker Compose for Coolify (Traefik)
This commit is contained in:
commit
4db2b0846b
61 changed files with 4280 additions and 0 deletions
42
backend/app/schemas/onboarding.py
Normal file
42
backend/app/schemas/onboarding.py
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class Phase1Request(BaseModel):
|
||||
primary_goal: str # lose_weight, build_strength, get_active, feel_better
|
||||
ttm_stage: str # precontemplation, contemplation, preparation, action, maintenance
|
||||
|
||||
|
||||
class Phase2Request(BaseModel):
|
||||
# Body metrics (optional)
|
||||
age: int | None = None
|
||||
height_cm: float | None = None
|
||||
weight_kg: float | None = None
|
||||
gender: str | None = None
|
||||
|
||||
# PAR-Q+
|
||||
parq_heart_condition: bool = False
|
||||
parq_joint_issues: bool = False
|
||||
parq_medications: bool = False
|
||||
parq_other_conditions: str | None = None
|
||||
|
||||
# BREQ-2 motivation (1-5 scale)
|
||||
motivation_external: float | None = None
|
||||
motivation_introjected: float | None = None
|
||||
motivation_identified: float | None = None
|
||||
motivation_intrinsic: float | None = None
|
||||
motivation_amotivation: float | None = None
|
||||
|
||||
# Preferences
|
||||
activity_preferences: list[str] = []
|
||||
equipment_access: str | None = None # none, basic_home, full_gym
|
||||
days_per_week: int = 3
|
||||
minutes_per_session: int = 30
|
||||
|
||||
|
||||
class OnboardingStatusResponse(BaseModel):
|
||||
phase1_completed: bool
|
||||
phase2_completed: bool
|
||||
primary_goal: str | None = None
|
||||
ttm_stage: str | None = None
|
||||
|
||||
model_config = {"from_attributes": True}
|
||||
Loading…
Add table
Add a link
Reference in a new issue