💡 Inspiration

We built NutriSnap AI because most people want to eat better and exercise more, but tracking calories, understanding macros, and planning meals feels overwhelming. We envisioned a single app where you snap a photo of your food and instantly get everything you need — nutrition facts, health insights, a personalized plan, and motivation to keep going. The goal was to remove friction from healthy behavior change.


✨ What It Does

NutriSnap AI is a comprehensive health platform built on four core pillars:

1. 🔍 AI Food Scanner

Snap any meal photo and get instant analysis:

Data Point Description
Macronutrients Calories, protein, carbs, fats, sugar, sodium
Micronutrients Vitamins and minerals
Quality Metrics Ingredient quality, cooking method
Health Score 0–100 composite score
Safety Allergen warnings
Guidance Personalized insights and recommendations

No typing. No searching databases.

2. 📋 Personalized Plans

Generate AI-crafted 7-day diet plans and workout routines tailored to:

  • Age, weight, and goals
  • Dietary restrictions and fitness level
  • Available equipment

Plans include meal schedules, shopping lists, macro targets, and progressive exercise routines.

3. 📊 Tracking & Analytics

  • Log workouts and daily nutrition
  • Visualize trends with rich charts
  • Monitor calorie burn vs. intake using the energy balance equation:

$$ \Delta W = E_{\text{intake}} - E_{\text{expenditure}} $$

where total daily energy expenditure is estimated via the Mifflin–St Jeor equation:

$$ \text{BMR} = 10m + 6.25h - 5a + s $$

$$ \text{TDEE} = \text{BMR} \times \text{Activity Factor} $$

  • Watch your Health Score \( H \in [0,\ 100] \) evolve over time:

$$ H = \frac{1}{N} \sum_{i=1}^{N} w_i \cdot s_i $$

where \( w_i \) are feature weights and \( s_i \) are individual metric scores (macros, sleep, activity, etc.).

4. 🏆 Gamification & Community

  • Earn points and badges for healthy meals and workouts
  • Maintain streaks and join challenges:
    • 🥦 Clean Eating
    • 🚫🍬 Sugar Detox
    • 👟 Step Master
  • Compete on leaderboards and share progress in community groups

Points formula for a logged meal:

$$ P_{\text{meal}} = \text{BasePoints} \times \left(1 + \frac{H_{\text{meal}}}{100}\right) \times \text{StreakMultiplier} $$


🛠️ How We Built It

Frontend  →  React 18 + TypeScript + Vite + Tailwind CSS + shadcn/ui
Backend   →  Supabase (PostgreSQL, RLS, Auth, Storage, Edge Functions)
AI Engine →  Google Gemini 3.0 Flash (Vision + NLP)
Data      →  12+ table schema (meals, workouts, challenges, rewards, …)

Architecture Overview

User Photo
    │
    ▼
Supabase Edge Function  ──►  Gemini Vision API
    │                              │
    │◄─────── AI Response ─────────┘
    │
    ▼
PostgreSQL (RLS-secured)
    │
    ▼
React Dashboard  (charts · streaks · plans · leaderboard)

Resilience: Offline-First Fallback

  • 35-food searchable nutrition database
  • 18-workout local library
  • App works seamlessly even when AI quotas are exhausted — perfect for demos

Demo System

One-click Load Demo Data seeds:

  • 39 meals · 14 workouts · badges · active challenges · streaks
  • 18 days of realistic history

🚧 Challenges We Ran Into

AI Rate Limits

We hit 429 errors from the Gemini free tier during development. Solution: a complete offline fallback so the app never breaks and demos run smoothly without any API key.

Database Schema Evolution

As features grew (challenges, rewards, streaks, plans), keeping the schema in sync required careful migration management. Key lesson:

Schema-first design saves hours of refactoring.

Complex State Management

Cross-page data dependencies — challenges affecting rewards, streaks affecting dashboard scores — required thoughtful data flow. The dependency graph simplified to:

$$ \text{Streak} \rightarrow \text{Score} \rightarrow \text{Badge} \rightarrow \text{Challenge Progress} \rightarrow \text{Leaderboard Rank} $$

Image Handling

Balancing real photo uploads with fallback image URLs for demo data required a flexible image pipeline.


🎉 Accomplishments We're Proud Of

  • Zero-dependency Demo Mode — fully functional without any API key
  • Comprehensive AI Integration — a single photo triggers 10+ AI-generated data points
  • End-to-End Gamification — meal logging → points → badges → streaks → challenges → leaderboard
  • Production-Grade Architecture — RLS policies, upsert guards, idempotent seeders, Edge Functions
  • Beautiful UX — dark mode, responsive design, loading skeletons, toast notifications

📚 What We Learned

  1. AI isn't always available — building graceful fallbacks is essential for real-world reliability.
  2. Schema-first design saves hours of refactoring when adding gamification layers.
  3. Supabase Edge Functions are the right place to hide API keys and handle sensitive AI calls securely.
  4. Demo data matters — judges and users engage 10× more when they see a populated, realistic dashboard.

🔭 What's Next for NutriSnap AI

Feature Description
⌚ Wearable Integration Sync with Apple Health & Google Fit for automatic workout and step tracking
🛒 Meal Prep Mode AI-generated weekly shopping lists with Instacart / grocery API integration
📸 Social Feed Community photo feed — share meals and get peer health tips
🧍 Progress Photos Side-by-side body transformation tracking with AI body composition estimates
💳 Subscription Tiers Freemium model with advanced AI coaching, custom challenges, and family plans

-

Built With

Share this project:

Updates