Focus your lens on nutrition.
Your AI-powered packaged food nutrition analyzer: Upload, Scan, Decode, Eat Smart.
- Project Overview
- Goals & Objectives
- Use Cases
- Functional Requirements
- Non-Functional Requirements
- Technical Architecture
- User Flow Diagram
- API Flow
- Database Schema
- Security & Privacy
- Future Scope
- Glossary
NutriLens is a mobile app (React Native) that helps users understand packaged food nutrition by simply uploading an image of the food or its nutrition label.
It uses Gemini Vision API to extract ingredients, macros, vitamins, and gives AI-powered insights like benefits, risks, body effects, and recommendations.
- β Make it easy for consumers to decode complex food labels.
- β Enable healthier food choices.
- β Store and track user scans for awareness.
- β Provide actionable insights: how the food affects body parts, weight, immunity, bones, etc.
- β Send reminders and smart nudges via push notifications.
- β Maintain secure user data with Supabase.
Use Case | Description |
---|---|
Sign Up/Login | User creates account with email/password or Google. |
Upload Food Image | User uploads packaged food image or nutrition label. |
AI Nutrition Report | Backend processes image, calls Gemini, returns nutrition breakdown + body impact. |
History | User sees past scans, reports, images, and AI suggestions. |
In-App Notification | User gets notified when a new scan report is ready. |
Push Notification | User gets reminders, weekly health tips, or insights. |
Profile Settings | Edit profile, manage push tokens, delete account. |
Security | All API calls require valid JWT token; no public access. |
- Supabase Auth for signup/login.
- JWT token used for secure API calls.
- FCM/Expo Push Token stored in Supabase
users
table.
- Upload image from gallery or camera.
- Image uploaded via API to Python backend.
- Image optionally stored in Supabase Storage.
- Backend forwards image to Gemini Vision.
- Gemini extracts nutrition facts & generates structured data:
- Macros (Protein, Fat, Carbs, Sugar)
- Vitamins & Minerals
- Benefits & Risks
- Body impact: weight, bones, immunity, skin, etc.
- Recommendations (good/bad, frequency, alternatives)
- Processed data saved in
food_scans
table:- user_id
- image_url
- nutrition_json
- AI summary
- created_at
- In-App:
notifications
table stores status messages.- Bell icon with unread badge.
- Push:
- Backend uses Expo Push API or FCM.
- Send βScan Completeβ, βWeekly Tipsβ, etc.
- Home screen shows recent scans.
- History screen lists all scans.
- Food detail screen shows full AI report for each scan.
- Security: JWT token verification on every API.
- Performance: Average response time < 2 seconds for scanning.
- Scalability: Gemini API usage should handle multiple users.
- Reliability: Store raw Gemini output for audit/debug.
- Privacy: User data encrypted at rest (Supabase).
User (React Native + Expo)
|
[ HTTPS + JWT ]
|
Python Backend (FastAPI)
|
Gemini Vision API
|
Supabase (Auth, DB, Storage)
|
Firebase Cloud Messaging (Push)
Signup/Login ββ> Home ββ> Upload Image ββ> Gemini Scan
β
Save to DB
β
ββββββββββββββββ¬ββββββββββββββ
β β β
Send Push Create In-App Show Report
Notification Notification + History
POST /analyze
Headers: Authorization: Bearer <supabase_jwt>
Body:
{
"image_url": "https://..."
}
{
"status": "success",
"food_scan_id": "uuid",
"nutrition": {
"macros": {...},
"vitamins": {...},
"benefits": "...",
"risks": "...",
"body_impact": "...",
"recommendations": "..."
}
}
- id (uuid)
- name
- mobile nullable
- fcm_token
- created_at
- id (uuid)
- user_id (FK)
- image_url (text)
- nutrition_json (jsonb)
- summary (text)
- created_at (timestamp)
- id (uuid)
- user_id (FK)
- type (enum: info, warning, reminder)
- title (text)
- message (text)
- is_read (boolean)
- created_at (timestamp)
- All backend routes are JWT protected.
- Use Supabase JWKS to verify tokens in Python.
- Images stored securely (Supabase Storage or S3).
- Sensitive user info encrypted at rest.
- No AI API key exposed on frontend.
- Barcode scanner integration.
- Meal planner based on daily goals.
- Apple Health / Google Fit sync.
- AI chatbot: ask about foods.
- Smart reminders: βScan before you eatβ.
- Premium plan: advanced reports & unlimited scans.
Term | Meaning |
---|---|
JWT | JSON Web Token for secure user auth |
Supabase | Backend-as-a-Service (Auth, DB, Storage) |
Gemini Vision | Googleβs AI API for image to text extraction |
FCM | Firebase Cloud Messaging for push notifications |
Expo | React Native dev framework for iOS & Android |
In-App Notification | Shown inside app UI, not device push |