Caltrax

Premium nutrition & health tracking. Next.js 14 (App Router) + TypeScript (strict) + Tailwind + Prisma/PostgreSQL.

Getting started

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.

What’s built (Phase 1 foundation)

Roadmap (not yet built — in priority order)

Phase 1 — finish the core loop

  1. Auth (email/password + session, OAuth-ready) and onboarding flow that collects the UserProfileInput fields and calls calculateGoals() to create the Profile row.
  2. Food search + barcode lookup against Open Food Facts (primary) and USDA FoodData Central (secondary), normalized into the Food model.
  3. Meal logging UI (breakfast/lunch/dinner/snack) writing MealEntry rows, with the dashboard reading real aggregates instead of the sample data.
  4. Weight/water logging UI writing to WeightLog/WaterLog.

Phase 2 — camera & AI

  1. Browser camera access (getUserMedia) for barcode/QR scanning (a zxing-wasm dependency is already in package.json for this) and nutrition-label OCR.
  2. AI meal photo recognition + AI daily/weekly/monthly insights, calling the Anthropic API server-side with structured JSON output.

Phase 3 — depth

  1. Recipes, meal templates, weekly meal planner, favourites/recent foods.
  2. Full micronutrient tracking (vitamins A/B/C/D/E/K, minerals, omega-3/6) end to end through logging, storage and dashboard charts.
  3. Reminders (meal/water/exercise/weight-check/supplement) with push notifications.
  4. Achievements/badges, weekly/monthly/yearly reports.

Phase 4 — platform

  1. PWA packaging (manifest + service worker + offline cache).
  2. Wearable/health-platform integrations (Apple Health, Health Connect, Garmin, Fitbit, Whoop, Oura, smart scales, CGMs).
  3. Premium subscription, social features, family accounts, multi-language.

Notes on scope

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.