Inspiration

Packaged food labels are difficult to understand for most people. Important health information is hidden behind technical ingredient names, inconsistent nutrition data, and confusing marketing claims. This problem becomes even more critical for people with dietary restrictions such as diabetes, allergies, or lifestyle goals like weight management.

FoodSnap was inspired by the idea of making food transparency instant, simple, and accessible for everyone using AI.


What it does

FoodSnap allows users to:

  • Search packaged foods by name
  • Scan barcodes using a camera
  • Scan food labels or manually enter ingredients

Once the product is identified, FoodSnap analyzes it using AI and presents:

  • An easy-to-understand health score
  • Ingredient-level risk and benefit analysis
  • Dietary compatibility (vegan, gluten-free, etc.)
  • Clear daily consumption guidance
  • A conversational AI assistant for personalized questions
  • Multi-language summaries for wider accessibility

How we built it

FoodSnap is built with a modern full-stack architecture:

  • The frontend is built using Next.js and React, optimized for performance and responsiveness.
  • Product data is fetched using OpenFoodFacts APIs, with a collision-safe resolver between regional and global databases.
  • If product data is missing or incomplete, Gemini 3 is used to intelligently analyze ingredient lists.
  • Gemini 3 Flash powers both:
    • Structured food analysis (health score, risks, benefits)
    • A personalized conversational nutrition assistant
  • The backend uses Node.js API routes with strict JSON contracts to ensure stability.
  • The app is deployed on Vercel for scalability and reliability.

Challenges we ran into

  • OpenFoodFacts data is not always complete or consistent across regions.
  • Barcode scans sometimes fail or return partial results.
  • AI models can return unstructured or verbose responses if not carefully constrained.

These challenges were solved by:

  • Implementing deterministic fallback strategies
  • Designing strict JSON schemas for Gemini responses
  • Using AI only when deterministic data is unavailable
  • Adding robust error handling and retries for real-world usage

What we learned

  • AI works best when combined with deterministic systems, not replacing them.
  • Strict prompting and response validation are critical in production AI systems.
  • User trust increases dramatically when explanations are clear and non-judgmental.
  • Gemini’s structured output capabilities are powerful for real-world applications.

What's next for FoodSnap

  • Personalized health profiles
  • Long-term food consumption tracking
  • Offline scan support
  • Expansion into regional food databases
  • Deeper AI-powered dietary recommendations

Built With

Share this project:

Updates