Skip to content

About

Resources

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

BiteSpy Frontend

BiteSpy is a Next.js 16 app that helps users scan a food product, answer a short question flow, and view a truth-style report with alternatives. The UI is built for a friendly, guided experience, while the backend is split across services:

  • Firebase Auth handles signup and login.
  • MongoDB Atlas stores auth mirror records.
  • Firestore stores the profile form data.

The current demo flow is hardcoded around a Nutella-style product journey so the frontend can be tested end-to-end without the MCP backend being connected yet.

Project Flow

  1. User signs up or logs in with Firebase Auth.
  2. Signup/login success syncs an auth record into MongoDB Atlas.
  3. User uploads a product image on the home page.
  4. The app routes to a 5-question yes/no flow.
  5. After the questions, a loader screen appears briefly.
  6. The result page shows the Truth-o-Meter, nutrients, alerts, and ingredient reality.
  7. The alternatives page shows healthier, cheaper, and same-taste options.

Tech Stack

  • Next.js 16 App Router
  • React 19
  • TypeScript
  • Firebase Auth
  • Firestore for profile data
  • MongoDB Atlas for auth sync
  • Tailwind CSS for styling
  • Framer Motion and icon libraries for interaction

Folder Structure

Root files

App routes

Components

Library files

Environment Variables

Set these in .env:

  • NEXT_PUBLIC_FIREBASE_API_KEY
  • NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN
  • NEXT_PUBLIC_FIREBASE_PROJECT_ID
  • NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET
  • NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID
  • NEXT_PUBLIC_FIREBASE_APP_ID
  • NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID
  • FIREBASE_PROJECT_ID
  • FIREBASE_CLIENT_EMAIL
  • FIREBASE_PRIVATE_KEY
  • MONGODB_URI
  • MONGODB_DB_NAME
  • GEMINI_API_KEY
  • ARMORIQ_API_KEY
  • ARMORIQ_USER_ID (or USER_ID)
  • ARMORIQ_AGENT_ID (or AGENT_ID)
  • ARMORIQ_MCP_SERVER_NAME (single deployed MCP server registered in ArmorIQ)
  • ARMORIQ_PROXY_ENDPOINT (optional)
  • ARMORIQ_STRICT_MODE (optional, set true to fail instead of falling back to direct Gemini)

Local Development

npm install
npm run dev

Then open http://localhost:3000.

Production Build

npm run build

Backend Notes

  • Firebase Auth remains the source of truth for sign-in and sign-up.
  • MongoDB Atlas stores a lightweight auth mirror in auth_users.
  • Firestore stores the profile form data used by the profile pages.
  • The profile question/result flow is frontend-only for now and hardcoded for the Nutella demo case.

ArmorIQ Single-MCP Integration

  • AI execution now supports ArmorIQ SDK with one MCP server and multiple tools.
  • scan-agent and analyze-agent are enforced with separate policy allow/deny sets in lib/armoriq-policy.ts.
  • Business logic in scan/analyze routes remains unchanged; only execution transport changed.
  • If ArmorIQ env vars are missing, backend falls back to direct Gemini unless ARMORIQ_STRICT_MODE=true.

Extending The App

If you reconnect a real backend later, the best places to start are:

Deployment

This app builds cleanly with npm run build and is ready for Netlify or another Next.js host once the environment variables are set.

About

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages