Inspiration
The idea for Balanced Plate.AI was born from a simple observation: most people struggle to maintain a balanced diet, not because they don't want to eat healthily, but because they lack the tools and knowledge to understand what they're actually consuming.
I noticed that:
- Nutrition tracking is tedious — manually logging every meal is time-consuming and often inaccurate
- Food labels are confusing — understanding macro and micronutrients requires nutritional expertise
- Generic advice doesn't work — people need personalized recommendations based on their actual eating patterns
- Real-time feedback is missing — by the time people realize they've been eating poorly, weeks have passed
I wanted to create a solution that makes nutrition tracking as easy as taking a photo, while providing intelligent, personalized insights powered by AI. When I discovered Google's Gemini AI with its powerful vision capabilities, I knew I had the perfect tool to bring this vision to life.
What it does
Balanced Plate.AI transforms how people track and understand their nutrition through three core features:
Instant Food Analysis
Simply snap a photo of your meal, and Gemini Vision AI instantly:
- Identifies all foods on your plate with confidence scores
- Estimates portion sizes accurately
- Calculates complete nutritional breakdown (calories, protein, carbs, fats)
- Provides micronutrient data (vitamins, minerals)
- Assigns a Balance Score (0-100) rating your meal's nutritional completeness
- Gives immediate next-meal recommendations
Smart Analytics Dashboard
Track your nutrition journey with:
- Daily, weekly, and monthly nutrition overviews
- Food group distribution charts (proteins, carbs, vegetables, fruits, dairy)
- Meal timing analysis to understand eating patterns
- Balance score trends over time
- Interactive visualizations for easy comprehension
AI-Powered Weekly Recommendations
Every week, Gemini AI analyzes your eating patterns and generates:
- Personalized health reports with strengths and areas for improvement
- Specific nutrition recommendations based on your macro/micro intake
- Meal timing advice (what to eat and when)
- Priority actions and measurable weekly goals
- Suggestions for foods to add to improve dietary balance
Real-Time Notifications
- WebSocket-powered instant alerts when food analysis completes
- Weekly recommendation notifications
- Seamless, non-blocking user experience
How we built it
Architecture Overview
Balanced Plate.AI is built as a modern full-stack application with AI at its core:
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ React + TS │────▶│ Django REST │────▶│ Google Gemini │
│ Frontend │◀────│ API Backend │◀────│ Vision AI │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│
┌──────────┼──────────┐
▼ ▼ ▼
┌──────────┐ ┌──────────┐ ┌──────────┐
│ Redis │ │PostgreSQL│ │ Celery │
│ Cache │ │ DB │ │ Worker │
└──────────┘ └──────────┘ └──────────┘
Key Components
AI-Powered Food Analysis
- Users upload food images through the React frontend
- Images are processed by Celery workers in the background
- Google Gemini Vision analyzes the image and returns structured nutritional data
- Results include detected foods, portion estimates, calories, macros, micronutrients, and balance scores
Intelligent Recommendations Engine
- Aggregates user's weekly nutrition data (macros, food groups, meal timing, balance scores)
- Sends structured data to Gemini AI with a carefully crafted prompt
- Generates personalized health reports, priority actions, and weekly goals
- Delivers recommendations via WebSocket notifications
Real-Time Dashboard
- Interactive charts showing nutrition trends (daily balance scores, food group distribution)
- Meal timing analysis to understand eating patterns
- TanStack Query for efficient data fetching and caching
- WebSocket integration for instant updates
Tech Stack Decisions
- Django REST Framework — Robust API development with excellent authentication
- Django Channels — WebSocket support for real-time notifications
- Celery + Redis — Async task processing for AI analysis (prevents UI blocking)
- React + TypeScript + Vite — Fast, type-safe frontend development
- Tailwind CSS + Shadcn/ui — Beautiful, consistent UI components
- Recharts — Data visualization for nutrition analytics
Challenges we ran into
1. Consistent AI Response Formatting
Challenge: Getting Gemini to consistently return valid JSON with the exact structure needed for database storage was tricky. Sometimes the AI would add explanatory text or vary the response format.
Solution: Crafted highly specific prompts with explicit JSON schemas, added "Return ONLY valid JSON, no additional text" instructions, and implemented robust JSON parsing with fallback to mock data.
2. Real-Time User Experience
Challenge: Food image analysis takes 5-10 seconds with Gemini AI. Making users wait with a blocking UI was unacceptable.
Solution: Implemented Celery for background processing with WebSocket notifications. Users can continue using the app while analysis runs, and receive instant notifications when results are ready.
3. Accurate Nutritional Data
Challenge: AI can hallucinate nutritional values. Ensuring reasonable accuracy for calorie and nutrient estimates was crucial for user trust.
Solution: Fine-tuned prompts to request realistic values, added validation layers, and structured the prompt to encourage the AI to be "accurate with portion estimates and nutritional values."
Accomplishments that we're proud of
Technical Achievements
- Seamless Gemini AI Integration — Built a robust pipeline that sends food images to Gemini Vision, receives structured JSON responses, and stores nutritional data reliably
- Real-Time Architecture — Implemented WebSocket notifications using Django Channels, so users get instant updates without refreshing
- Non-Blocking Analysis — Designed an async system with Celery where AI analysis runs in the background while users continue using the app
- Consistent AI Responses — Crafted prompts that reliably return valid, structured JSON with accurate nutritional data
Product Achievements
- One-Photo Nutrition Tracking — Reduced the friction of nutrition tracking from manual data entry to a single photo
- Actionable Insights — Transformed raw nutritional data into meaningful recommendations users can actually follow
- Beautiful Data Visualization — Made complex nutrition information accessible through intuitive charts and scores
- End-to-End Solution — Built a complete system from image upload → AI analysis → storage → visualization → recommendations
Quality & User Experience
- Type-Safe Codebase — Full TypeScript frontend with proper API typing for maintainability
- Responsive Design — Works beautifully on desktop and mobile devices
- Dark Mode Support — Comfortable viewing in any lighting condition
- Sub-10-Second Analysis — Fast enough to use in real life, at the dinner table
What we learned
Building Balanced Plate.AI was an incredible learning journey:
Technical Skills
- Google Gemini AI Integration — Deep-dived into Gemini 2.5/3 vision API, learning how to craft effective prompts for structured JSON responses from food image analysis
- Real-time Communication — Implemented WebSockets with Django Channels for instant notifications when food analysis completes
- Async Task Processing — Mastered Celery for handling background tasks like image analysis and weekly recommendation generation
- Full-Stack Architecture — Designed a scalable system connecting React frontend, Django backend, Redis, and PostgreSQL
- Type-Safe Development — Leveraged TypeScript and proper API typing for a robust, maintainable codebase
Domain Knowledge
- Nutritional Science — Researched macronutrients, micronutrients, food groups, and dietary balance scoring
- AI Prompt Engineering — Learned how to structure prompts for consistent, accurate nutritional analysis
- User Experience Design — Understood how to present complex nutritional data in an accessible, actionable way
Soft Skills
- Problem Decomposition — Breaking down the complex challenge of "AI nutrition tracking" into manageable components
- Iterative Development — Building, testing, and refining AI prompts for better accuracy
What's next for Balanced Plate AI
- Food Segmentation Model — Train custom models to identify individual foods on a plate for more accurate analysis
- Telegram Bot Integration — Allow users to track meals directly through Telegram
- Meal Planning AI — Generate full weekly meal plans based on user preferences and nutritional goals
- Social Features — Share meals and compete with friends on nutrition scores
- Wearable Integration — Connect with fitness trackers for holistic health insights
Built With
- digitalocean
- django
- gemini
- gemini3
- geminivision
- javascript
- postgresql
- python
- react
- typescript
- vercel
Log in or sign up for Devpost to join the conversation.