How I Built NutriSnap AI in a Hackathon: From a Single Food Photo to a Full Health Companion
What I learned building a Gemini-powered nutrition platform in days, not months.
How I Built NutriSnap AI in a Hackathon: From a Single Food Photo to a Full Health Companion
What I learned building a Gemini-powered nutrition platform in days, not months.

The problem that wouldn't leave my head
India has 212 million diabetics — one in every four diabetics on the planet. Hypertension is projected to hit 44% prevalence by 2030. And almost none of the people making daily food choices that shape these numbers have a real tool to help them.

Sure, MyFitnessPal exists. Lifesum exists. But open either one and try logging a plate of dal tadka with jeera rice, or a bowl of poha, or your grandmother's sambar. You'll spend more time fighting the database than learning anything about your meal.
That's the gap I wanted to close. Not "another calorie counter." Something that tells you what your food is actually doing to your body — and what to do next.
That became NutriSnap AI.

what is nutrisnap?
The 30-second pitch
Snap a photo of any meal. Get instant macros, a health score, harmful ingredient flags, a personalized 7-day diet and workout plan, and gamified habits that actually keep you coming back.
One photo in. A complete health companion out. That was the bar.
What I built
NutriSnap AI rests on four pillars, each designed to remove a different point of friction from healthy living.

what’s inside Nutrisnap
1. AI Food Scanner. Powered by Google Gemini 2.0 Flash Vision. Snap a meal → get food name, calories, full macro breakdown, micronutrients, ingredient quality, cooking method, a 0–100 health score, allergen warnings, and three personalized recommendations. No typing. No database hunting. No "is this 'medium-sized' or 'large'?"
2. Personalized Plans. AI-generated 7-day diet plans and workout routines built around your age, weight, goals, dietary restrictions, fitness level, and available equipment. Meal schedules, shopping lists, macro targets, progressive exercises — the whole thing.
3. Tracking & Analytics. Workouts logged, nutrition tracked, trends visualized in rich charts. Calorie burn vs. intake. Health score evolving over time. The boring-but-essential layer that makes the rest worth caring about.
4. Gamification & Community. Points and badges for healthy meals and workouts. Streaks. Challenges like Clean Eating, Sugar Detox, Step Master. Leaderboards. Community groups. The motivational loop that turns one healthy day into thirty.
The tech stack
Nothing exotic. Just well-chosen pieces.
- Frontend — React 18, TypeScript, Vite. Styled with Tailwind CSS and shadcn/ui for a clean, dark-mode-ready interface.
- Backend — Supabase. PostgreSQL with Row Level Security, Auth (email, OTP, social), Storage for meal photos, and Edge Functions to keep API keys server-side.
- AI Engine — Google Gemini 2.0 Flash. Handles vision recognition, nutrition extraction, plan generation, and insight creation.
- Data Layer — 12+ tables for meals, workouts, challenges, rewards, streaks, plans, preferences, groups, health reports.
That's it. No microservices. No Kubernetes. A hackathon is not the place to over-engineer.
The three lessons I won't forget
Lesson 1: AI will fail. Plan for it.
The most painful moment of the build: hitting HTTP 429 — rate limit exceeded from the Gemini free tier, mid-demo prep, with no time to upgrade.
The instinct is to panic. The actual solution is boring: build a fallback.
I shipped an offline-first nutrition database with 35 real foods and an 18-exercise workout library. If the AI is down, unavailable, or rate-limited, the app degrades gracefully into a searchable picker. Every core feature still works. Demos never break.
Takeaway: When you're building on top of an AI provider, the AI is a dependency — not a guarantee. Treat it the way you'd treat any external API: assume it will fail, and design for that failure.
Lesson 2: Schema-first beats code-first.
Halfway through the build I added a challenges system. Then rewards. Then streaks. Each new feature meant a new table, new foreign keys, new migrations.
By feature five, my schema was a junk drawer.
I had to stop, redesign the data model end-to-end, write a clean migration, and re-port the existing features. It cost a full day.
Takeaway: Before you write a line of code for a feature-rich app, draw the entire schema. Tables, relationships, RLS policies. The hour you spend on this saves you a day later.
Lesson 3: Demo data is a feature.
I built a one-click "Load Demo Data" button that seeds 39 meals, 14 workouts, badges, active challenges, personalized plans, and 18 days of streak history.
Was it scope creep? Maybe. Was it the single best decision I made? Absolutely.
Judges, beta testers, even my own teammates engaged with the app roughly ten times more when they opened a populated dashboard versus an empty one. An empty app looks broken. A full one looks alive.
Takeaway: Your demo is not a side concern. It is the product, for the people who matter most in a hackathon. Build the seed script.
What surprised me
A few things I didn't expect going in:
Supabase Edge Functions are underrated. They turned out to be the perfect place to hide my Gemini API key and route AI calls. Zero infrastructure. Pure JavaScript. Deployed in seconds.
shadcn/ui is a hackathon superpower. Beautiful components, no design debt, full Tailwind control. The difference between "looks like a hackathon project" and "looks shippable" is sometimes just one good component library.
The motivational loop matters more than the AI. People come for the food scanner. They stay for the streak. Build the loop early.

What's next
NutriSnap isn't done. The roadmap from here:
- Wearable integration — Apple Health and Google Fit sync for automatic workout and step tracking.
- Meal prep mode — AI-generated weekly shopping lists with Instacart integration.
- Health report uploads — Blood test PDF in. Food-history-aware health correlations out. "Your sodium-heavy last week may be linked to your elevated BP reading."
- Social feed — A community where people share meals and trade peer health tips.
메타데이터
- post_id
- 92a6488cd5d1
- slug
- how-i-built-nutrisnap-ai-in-a-hackathon-from-a-single-food-photo-to-a-full-health-companion-92a6488cd5d1
- url
- https://medium.com/@aishwaryaghatole21/how-i-built-nutrisnap-ai-in-a-hackathon-from-a-single-food-photo-to-a-full-health-companion-92a6488cd5d1
- canonical_url
- https://medium.com/@aishwaryaghatole21/how-i-built-nutrisnap-ai-in-a-hackathon-from-a-single-food-photo-to-a-full-health-companion-92a6488cd5d1
- author_url
- https://medium.com/@aishwaryaghatole21
- status
- ok
- fetched_at
- 2026-06-09 15:37:30