Premium nutrition & health tracking. Next.js 14 (App Router) + TypeScript (strict) + Tailwind + Prisma/PostgreSQL.
npm install
cp .env.example .env # fill in DATABASE_URL
npx prisma migrate dev --name init
npm run dev
Open http://localhost:3000 — it redirects to /dashboard, which renders live against
the goal engine (see below) using a sample profile until auth + real data wiring lands.
npm install and run.tailwind.config.ts, globals.css): near-black dark-mode-first
palette, glass card primitive (24px blur, 22px radius per spec), semantic accent
colors (blue/green/orange/red mapped to info/success/warning/danger), macro-specific
hues, reduced-motion support, visible focus rings.src/lib/goalEngine.ts): real, tested-by-hand math — Mifflin-St
Jeor BMR, activity-multiplier TDEE, goal-specific protein/fat/carb splits, a hard
safety floor on minimum calories, and rate-of-change capped at 1% bodyweight/week
regardless of user input. Pure functions, no UI coupling.prisma/schema.prisma): Users, Profiles, Foods (multi-source:
Open Food Facts / USDA / custom), MealEntries, WeightLogs, WaterLogs, Reminders.src/app/dashboard/page.tsx + src/components/dashboard/*):
Calories-remaining hero ring, macro rings (protein/carbs/fat/fibre), hydration
widget with quick-add, weight trend chart (Recharts) — all live components, not
static mockups, wired to calculateGoals().src/lib/supplements.ts): the 12 supplements listed
in the spec, each with a general evidence-based range, timing, interactions and a
source link — paired with a mandatory disclaimer constant that must render
alongside every card. This is reference information, not personalized dosing.Phase 1 — finish the core loop
UserProfileInput fields and calls calculateGoals() to create the Profile row.Food model.MealEntry rows, with the
dashboard reading real aggregates instead of the sample data.WeightLog/WaterLog.Phase 2 — camera & AI
getUserMedia) for barcode/QR scanning (a zxing-wasm
dependency is already in package.json for this) and nutrition-label OCR.Phase 3 — depth
Phase 4 — platform
This spec describes a product on the scale of MyFitnessPal/MacroFactor — a realistic build is months of engineering, not one pass. This foundation is real, working code (not mockups) for the pieces most projects get wrong if rushed: the math, the schema, and the visual system. Everything above builds directly on top of it without needing rework.