An iOS app that cuts through conflicting nutrition advice by showing how different dietary frameworks evaluate the same food — personalized to your profile and goals.
Nutrition advice is everywhere and contradicts itself constantly. Is white rice good or bad? Depends who you ask. Instead of claiming one truth, Nutrition Lens shows you multiple perspectives at once so you can decide what fits your life.
- Complete a one-time profile (age, height, weight, lifestyle, primary goal)
- Type any food
- Select a lens to emphasize
- Get instant verdicts across 5 frameworks — tailored to you
- Tap any suggested alternative to analyze it directly
| Lens | Focus |
|---|---|
| 🔥 Fat Loss | Calories, satiety, glycemic impact |
| 💪 Muscle Gain | Protein quality, amino acid profile |
| 🌿 Whole Foods | Processing level, ingredient quality |
| ⚡ Athletic Performance | Energy, recovery, timing |
| 💵 Budget | Cost per gram of protein, availability |
iOS App
- SwiftUI
- AppStorage for user profile persistence
Backend
- Node.js + Express + TypeScript
- Anthropic Claude Haiku — analyzes any food via structured prompt
- In-memory cache keyed by food + goal (resets on restart)
cd nutrition_app/backend
npm installCreate a .env file:
ANTHROPIC_API_KEY=your-key-here
PORT=3000
Start the server:
npm run devYou should see:
✅ Nutrition Lens backend running on http://localhost:3000
Open nutrition_app/nutrition_app.xcodeproj in Xcode and run on simulator or device. Make sure the backend is running first — the app falls back to mock data if it can't reach localhost:3000.
nutrition2/
├── nutrition_app/
│ ├── backend/
│ │ ├── server.ts # Express server + Claude integration
│ │ ├── .env # API key (not committed)
│ │ └── package.json
│ └── nutrition_app/
│ ├── ContentView.swift # Root router (onboarding → search)
│ ├── OnboardingView.swift # 4-step profile setup
│ ├── SearchView.swift # Food input + lens selection
│ ├── ResultsView.swift # Lens cards + alternatives
│ ├── NutritionService.swift # Backend networking + mock fallback
│ └── Models.swift # Data models
POST /analyze
Request:
{
"food": "white rice",
"goal": "Fat Loss",
"profile": {
"ageRange": "18–25",
"height": "5'10\"",
"weight": "165",
"lifestyle": "Moderately Active",
"healthGoal": "Fat Loss"
}
}Response:
{
"food": "White Rice",
"summary": "White rice is a fast-digesting carb that works well around workouts but isn't ideal for fat loss on its own.",
"lenses": [
{ "name": "Fat Loss", "verdict": "⚠️", "reason": "High glycemic index — pair with protein to blunt spike." },
{ "name": "Muscle Gain", "verdict": "✅", "reason": "Fast carbs replenish glycogen quickly post-training." }
],
"alternatives": ["Brown rice", "Quinoa", "Sweet potato"]
}