Scan Smart. Eat Safe. Live Well.
SafeBite is a mobile-first HealthTech app built with React Native. Scan a barcode, snap an ingredients label with no barcode at all, or photograph a restaurant menu β and get an AI-powered safety analysis personalised to your medical profile: allergies, chronic conditions, medications, and your whole family.
What makes SafeBite different: it checks food against your medications and conditions, not just calories β and it works even when a product isn't in any barcode database.
Ensuring food safety is hard for both consumers and shopkeepers:
- People with allergies, diabetes, heart disease or other conditions can't easily verify whether a food is safe for them.
- People on medication are unaware of dangerous foodβdrug interactions hiding in everyday products.
- Most barcode scanners hit a dead end when a product isn't in the database β common for local, loose, or small-brand foods.
- Eating out is the scariest scenario for allergy/medication users, with no easy way to vet a menu.
- Families have no way to check safety across multiple health profiles in one scan.
- Shopkeepers overlook stock and expiry management, causing waste and risk.
Per WHO, anaphylaxis-related deaths are rising. SafeBite puts clinical-grade food safety in everyone's hands.
| Feature | Description |
|---|---|
| Barcode / QR Scan | EAN13, EAN8, QR, Code128, UPC-A/E and more β full product info + AI safety verdict |
| πΈ Snap the Label | No barcode (or not in the database)? Photograph the ingredients list β a vision model reads it and runs the same safety pipeline. Works for any packaged food |
| π½οΈ Eat-Out Menu Scanner | Photograph a restaurant menu β every dish is rated Safe / Caution / Avoid for your profile, sorted worst-first |
- π§ AI Ingredient Analysis β a personalised summary based on your allergies, conditions, diet and medications.
- π Medication Γ Food Interaction Alerts β detects dangerous combos (Warfarin + leafy greens, Statins + grapefruit, β¦) with prominent warnings. Re-checked deterministically on-device, not just by the model.
β οΈ Deterministic Allergen Matching β a synonym map so a "Nuts" allergy is flagged by "almond"/"peanut", not only the literal word.- π¨βπ©βπ§ Family Profiles β one account, multiple health profiles; switch the active profile with one tap and every AI flow adapts.
SafeBite doesn't stop protecting you when you close the app. It remembers every product you've scanned and cross-checks them against the live openFDA food recall feed. If a product you've scanned gets recalled, you get a push notification β even with the app closed β and a red alert banner on Home.
- π‘ Live recall monitoring β matches your scanned products against official recall data on every app open.
- π― Profile-aware severity β if the recall reason (e.g. "undeclared peanuts") matches the active profile's allergies, the alert is escalated with a "do not eat" warning tied to that person.
- π Works in the background β be warned about food already in your kitchen before you eat it.
Sage is a conversational assistant (powered by Google Gemini) you can ask anything β "Can I eat this with my warfarin?", "What should I avoid today?", "Suggest a safe snack." It's grounded in your active health profile (allergies, conditions, medications, diet) and your recently scanned products, so every answer is personal β not generic. Reachable from the Ask Sage button on Home β or tap Ask Sage about this on any product to start a chat focused on that exact item.
- π Read-aloud verdict β enable it from Profile β Accessibility, and a Listen button appears on every product to read the whole safety verdict aloud (name β allergens β medication interactions β AI summary), so low-vision, elderly, or hands-busy users can hear whether a food is safe. The co-pilot's answers can be read aloud too.
- Recipe Suggestions β enter the ingredients you have β health-safe recipes that respect your allergies, diet, conditions and medications.
- 7-Day Meal Planner β a profile-safe weekly plan plus an auto shopping list.
- Healthier Swaps β scan a poorly-rated product and get safer, better-rated alternatives from a 5,000-product database.
- Smart Recommendations β AI-filtered products matched to your full health profile.
- Daily Health Score β a 0β100 score from today's logged food vs. your condition-adjusted limits.
- Safe-Eating Streak β consecutive qualifying days, to build the habit.
- Nutrition Tracker & Food Diary β calories, sugar, fat, salt, protein vs. personalised limits that auto-tighten for your conditions.
- 7-Day Trends β a per-day sugar & salt chart with a plain-language read ("your sodium is trending up"), so the tracker shows movement over time, not just today's snapshot.
- π Food Γ Medication cross-link at log time β when you add a food to your diary that interacts with one of your medications (e.g. grapefruit while on a statin), SafeBite flags it the moment you log it, tags the diary entry, and shows a daily "items that interact with your medication" banner.
- β° Medication reminders with food-timing warnings β schedule a daily dose reminder for each medication; the notification also names the foods to avoid around that dose (e.g. "Time for your statin β avoid grapefruit within a few hours"), turning the foodβdrug interaction map into a proactive nudge. Reminders are profile-aware and stay in sync as you edit your medications.
- π Export Health Report (PDF) β generate a shareable 7-day report β health profile, personalised daily limits, food diary grouped by day, and every flagged foodβmedication interaction β and send it straight to your doctor or dietitian from the native share sheet. Positions SafeBite as a clinical companion, not just a scanner.
- Recently Scanned carousel β reopen recent products instantly (offline-friendly).
- Personalised Daily Tip β rotates based on your medications/conditions/allergies.
- Offline Scan Cache β last 50 products + AI summaries cached locally; works with no signal.
- Edit Health Profile β update allergies, conditions, diet, medications, age & severity anytime.
- Change Password (Supabase auth), Privacy Policy, Share SafeBite, and β Support us.
- Inventory Management β add / edit / delete products (name, price, stock, rating, expiry, image), stored per-shopkeeper in Supabase with row-level security.
- Insights Dashboard β live stats (total / out-of-stock / expiring-soon), search, and colour-coded stock & expiry badges.
| Layer | Technology |
|---|---|
| Mobile Frontend | React Native (Expo 54), TypeScript, expo-router |
| Styling | NativeWind (Tailwind CSS), React Native Reanimated |
| Camera & Imaging | expo-camera, expo-image-picker, expo-image-manipulator |
| Notifications | expo-notifications (local push for recall alerts) |
| Accessibility | expo-speech (read-aloud safety verdict) |
| Reporting | expo-print + expo-sharing (PDF health report export) |
| Backend | Node.js + Express.js (deployed on Render, with keep-alive ping) |
| AI β Text | Groq: llama-3.1-8b-instant (summaries), llama-3.3-70b-versatile (recommendations, recipes, meal plans) |
| AI β Vision | Groq: meta-llama/llama-4-scout-17b-16e-instruct (label & menu reading) |
| AI β Co-pilot | Google Gemini (gemini-2.5-flash) β conversational health assistant |
| Database & Auth | Supabase (PostgreSQL + Auth, row-level security) |
| Local Storage | AsyncStorage β offline cache, active profile, streak, reco cache |
| Product Data | Open Food Facts API |
| Recall Data | openFDA Food Enforcement API |
| Build | EAS (Expo Application Services) |
Supabase tables that power the app:
| Table | Purpose |
|---|---|
Users |
Account info, shopkeeper flag |
Customerdetails |
Health profile β allergies, conditions, medications, dietary |
Shopkeepers |
Business details for shopkeeper accounts |
family_members |
Additional health profiles per account |
nutrition_logs |
Daily food diary entries per user (incl. med_flags β see supabase/nutrition_logs_med_flags.sql) |
recommended_products |
Profile-hash keyed cache for AI recommendations |
shop_products |
Per-shopkeeper inventory (RLS-scoped) β see supabase/shop_products.sql |
- Three capture modes β barcode (Open Food Facts), label photo (vision OCR), menu photo (vision).
- Vision pipeline β photos are downscaled on-device, then a Groq vision model extracts ingredients (label) or rates dishes (menu); the heavy lifting runs on Groq, so the free-tier backend only proxies.
- Rule + LLM safety β deterministic allergen/medication matching layered with LLM summaries (defence in depth).
- Profile-hash caching β avoids re-running AI for the same health profile.
- Condition-aware limits β daily nutrition thresholds tighten automatically per condition, feeding the tracker and health score.
- Family architecture β the active profile is persisted in AsyncStorage and drives every AI flow.
- Offline-first β scans, recommendations and tips fall back to local cache.
- Recall monitoring β on each app open, scanned products are matched against the openFDA recall feed; a match fires a local push and a Home banner, escalated when the recall reason hits the active profile's allergies.
SafeBite/
βββ app/
β βββ _layout.tsx # Root stack navigator
β βββ index.tsx # Splash / auth check
β βββ family.tsx # Family profiles management
β βββ edit-health.tsx # Edit health profile
β βββ privacy.tsx # Privacy policy
β βββ label-scan.tsx # πΈ Snap-the-label (vision)
β βββ menu-scan.tsx # π½οΈ Eat-out menu scanner (vision)
β βββ copilot.tsx # π€ Sage β AI Health Co-pilot chat (Gemini)
β βββ med-reminders.tsx # β° Medication dose reminders + food-timing warnings
β βββ shop_interface.tsx # Shopkeeper inventory (CRUD)
β βββ (auth)/ # login, signup, onboarding
β βββ (tabs)/
β β βββ home.tsx # Scan toggle, recommendations, recently scanned, tip
β β βββ tracker.tsx # Health score, streak, nutrition tracker, food diary
β β βββ recipes.tsx # Recipe suggestions + meal planner
β β βββ profile.tsx # Settings: account, support, about, health profile
β βββ product/[id].tsx # Product detail β AI summary, med warnings, swaps, log
β βββ scan/index.tsx # Barcode / QR scanner
βββ services/ # All client services (profile-aware)
β βββ summary.ts recommendation.ts familyProfile.ts nutritionLog.ts
β βββ scanCache.ts recipes.ts alternatives.ts healthScore.ts
β βββ healthTip.ts labelScan.ts menuScan.ts shopProducts.ts
β βββ healthReport.ts settings.ts
β βββ recall.ts # recall matching against openFDA + scanned products
β βββ notifications.ts # local push + daily-scheduled notifications (expo-notifications)
β βββ medReminder.ts # medication dose reminders + food-timing warnings
β βββ copilot.ts # AI co-pilot client (sends profile + scans to Gemini)
β βββ speech.ts # read-aloud verdict (expo-speech)
βββ backend/
β βββ server.js
β βββ routes/ # summary, recommendation, recipes,
β β # alternatives, scanLabel, scanMenu, copilot
β βββ controller/copilotController.js # Gemini chat co-pilot (consultCopilot)
β βββ controller/aiController.js # Groq text + vision (askAI, consultAi,
β β # generateRecipes, generateMealPlan,
β β # analyzeLabelImage, analyzeMenuImage)
β βββ utils/ # hashProfile, scraper
βββ constants/ # const, medicationInteractions,
β β # nutritionLimits, allergenKeywords
βββ components/ # recomentation, RecipeCard, NutritionTrends
βββ supabase/shop_products.sql # Shopkeeper inventory table + RLS
βββ lib/ # supabase, auth, actions
| Endpoint | Purpose |
|---|---|
GET /health |
Health check / keep-alive |
POST /api/summary |
AI product safety summary |
POST /api/recommendation |
Profile-matched product recommendations |
POST /api/recipes |
Health-safe recipes from ingredients |
POST /api/recipes/mealplan |
7-day profile-safe meal plan + shopping list |
POST /api/alternatives |
Healthier, profile-safe product swaps |
POST /api/scan-label |
Vision: read an ingredients label into product data |
POST /api/scan-menu |
Vision: rate menu dishes for the profile |
POST /api/copilot |
Conversational health co-pilot (Gemini), grounded in profile + recent scans |
git clone https://github.com/Ajay-Krishna00/SafeBite
cd SafeBiteFrontend .env:
EXPO_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
EXPO_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
backend/.env:
PORT=3000
EXPO_PUBLIC_PROJECT_URL=https://your-project.supabase.co
EXPO_PUBLIC_PUBLIC_ANON_KEY=your-anon-key
GROQ_API_KEY3=your-groq-key
GEMINI_API_KEY=your-gemini-key
The co-pilot uses
GEMINI_API_KEY(Google AI Studio). Optionally override the model withGEMINI_MODEL(defaults togemini-2.5-flash).
Start the app & backend:
npm install
npx expo start
cd backend && npm install && node server.jsRun supabase/shop_products.sql once in the Supabase SQL editor to enable shopkeeper inventory, and supabase/nutrition_logs_med_flags.sql to enable medication-interaction flags on diary entries. The deployed backend base URL is configured in the client services/.
- Supabase JWT auth with secure token refresh.
- Health data stored per-user with auth-scoped access; shopkeeper inventory protected by row-level security.
- Active family profile and streak stored only in device-local AsyncStorage.
- Vision requests send only the photo + non-identifying health constraints; nothing is sold. See the in-app Privacy Policy.
- β Medication Γ Food Interaction Alerts
- β Nutrition Tracker, Health Score & Streak
- β Family Profile Switching
- β Offline Scan Cache
- β Recipe Suggestions & 7-Day Meal Planner
- β Healthier Product Swaps
- β Snap-the-Label (vision scanning, no barcode needed)
- β Eat-Out Menu Scanner
- β Shopkeeper Inventory Management
- β Allergen Recall & Push Notifications
- β Sage β AI Health Co-pilot (conversational, Gemini-powered)
- β Read-aloud / accessibility verdict
- β Food Γ Medication cross-link at log time
- β Export Health Report (PDF) for doctors / dietitians
- β Medication reminders with food-timing warnings
- β 7-day nutrition trends (sugar & salt)
- π Customer-facing "safe for me" shop view
If SafeBite helps you, consider supporting development: buymeacoffee.com/ajaykrishnad
- Ajay Krishna D
- Abhay Murali M
- Thaariq Hassan R
MIT License β free for personal and educational use.
"Health isn't just about what you eat β it's about knowing what you're about to eat. SafeBite gives you that power: for every product, every menu, every member of your family β even without a barcode."
If you like this project, βοΈ star it and share it with health-conscious friends!