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
53
backend/app/schemas/food.py
Normal file
53
backend/app/schemas/food.py
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
from datetime import date, datetime
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class FoodCreate(BaseModel):
|
||||
meal_type: str # breakfast, lunch, dinner, snack
|
||||
food_name: str
|
||||
brand: str | None = None
|
||||
barcode: str | None = None
|
||||
serving_size: str | None = None
|
||||
servings: float = 1.0
|
||||
calories: float | None = None
|
||||
protein_g: float | None = None
|
||||
carbs_g: float | None = None
|
||||
fat_g: float | None = None
|
||||
fiber_g: float | None = None
|
||||
sodium_mg: float | None = None
|
||||
sugar_g: float | None = None
|
||||
food_date: date
|
||||
off_product_id: str | None = None
|
||||
off_data: dict = {}
|
||||
|
||||
|
||||
class FoodResponse(BaseModel):
|
||||
id: str
|
||||
meal_type: str
|
||||
food_name: str
|
||||
brand: str | None
|
||||
barcode: str | None
|
||||
serving_size: str | None
|
||||
servings: float
|
||||
calories: float | None
|
||||
protein_g: float | None
|
||||
carbs_g: float | None
|
||||
fat_g: float | None
|
||||
food_date: date
|
||||
logged_at: datetime
|
||||
|
||||
model_config = {"from_attributes": True}
|
||||
|
||||
|
||||
class FoodSearchResult(BaseModel):
|
||||
barcode: str | None = None
|
||||
product_name: str | None = None
|
||||
brand: str | None = None
|
||||
calories_100g: float | None = None
|
||||
protein_100g: float | None = None
|
||||
carbs_100g: float | None = None
|
||||
fat_100g: float | None = None
|
||||
fiber_100g: float | None = None
|
||||
sugar_100g: float | None = None
|
||||
serving_size: str | None = None
|
||||
image_url: str | None = None
|
||||
Loading…
Add table
Add a link
Reference in a new issue