Scaneat is a cross-platform application (web and mobile) that allows users to scan food product barcodes and receive comprehensive health analysis, ingredient breakdown, and personalized recommendations.
- Barcode Scanning: Scan food product barcodes using your device camera or enter manually
- Health Analysis: Get instant health scores based on nutrition, ingredients, additives, and processing level
- Nutri-Score Integration: Uses the official Nutri-Score algorithm for food rating
- Ingredient Analysis: Detailed breakdown of ingredients with allergen and additive warnings
- Personalized Recommendations: Get tailored advice based on the product's health profile
- User Authentication: Sign up, sign in, or continue as guest
- Product History: Track your scanned products (coming soon)
- Web Frontend: Next.js 14 (App Router), React, TypeScript, Tailwind CSS
- Mobile App: React Native, Expo, TypeScript
- Backend: Firebase (Cloud Functions, Firestore, Authentication)
- External APIs: OpenFoodFacts API
- Barcode Scanning:
- Web:
@zxing/library - Mobile:
expo-camerawith built-in barcode scanning
- Web:
scaneat/
├── web/ # Next.js web application
│ ├── app/ # Next.js App Router pages
│ ├── components/ # React components
│ └── lib/ # Utilities and Firebase config
├── mobile/ # React Native/Expo mobile app
│ ├── screens/ # App screens
│ ├── components/ # React Native components
│ └── lib/ # Utilities and Firebase config
├── functions/ # Firebase Cloud Functions
│ └── src/ # Function source code
├── shared/ # Shared types and utilities
│ ├── types/ # TypeScript type definitions
│ └── utils/ # Shared utility functions
└── firebase.json # Firebase configuration
- Node.js 18+ and npm
- Firebase account with Blaze plan (✅ Already set up:
scaneat-bc079) - Expo CLI (for mobile development)
Firebase is already connected! Just enable Firestore API:
- Visit: https://console.cloud.google.com/apis/api/firestore.googleapis.com/overview?project=scaneat-bc079
- Click "Enable"
- Follow the Quick Start Guide for remaining steps
- Clone the repository:
cd /home/brilworks/scaneat- Install dependencies for each project:
# Web app
cd web
npm install
# Mobile app
cd ../mobile
npm install
# Cloud Functions
cd ../functions
npm install-
Create a Firebase project at Firebase Console
-
Enable the following services:
- Authentication (Email/Password and Anonymous)
- Firestore Database
- Cloud Functions
-
Create a
.env.localfile in thewebdirectory:
NEXT_PUBLIC_FIREBASE_API_KEY=your-api-key
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your-project.firebaseapp.com
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your-project-id
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your-project.appspot.com
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your-sender-id
NEXT_PUBLIC_FIREBASE_APP_ID=your-app-id- Create a
.envfile in themobiledirectory:
EXPO_PUBLIC_FIREBASE_API_KEY=your-api-key
EXPO_PUBLIC_FIREBASE_AUTH_DOMAIN=your-project.firebaseapp.com
EXPO_PUBLIC_FIREBASE_PROJECT_ID=your-project-id
EXPO_PUBLIC_FIREBASE_STORAGE_BUCKET=your-project.appspot.com
EXPO_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your-sender-id
EXPO_PUBLIC_FIREBASE_APP_ID=your-app-id- Initialize Firebase Functions:
cd functions
firebase login
firebase use --add # Select your projectcd web
npm run devOpen http://localhost:3000 in your browser.
cd mobile
npm startFollow the Expo CLI instructions to run on iOS, Android, or web.
Deploy functions:
cd functions
npm run build
firebase deploy --only functionsOr run locally with emulator:
firebase emulators:startThe health analysis uses a hybrid approach combining:
- Nutri-Score: Standard algorithm based on nutrients (sugar, salt, fat, fiber, protein)
- Ingredient Analysis: Checks for additives (E-numbers), preservatives, artificial colors
- Processing Level: NOVA classification (1-4, unprocessed to ultra-processed)
- Health Scoring: 0-100 score with grade classification (excellent, good, moderate, poor, avoid)
The app uses the OpenFoodFacts API to fetch product information by barcode. Products are cached in Firestore for 7 days to reduce API calls.
- New Health Rules: Edit
shared/utils/healthRules.ts - New Components: Add to
web/components/ormobile/components/ - New Cloud Functions: Add to
functions/src/and export infunctions/src/index.ts
All types are defined in shared/types/product.ts and shared between web and mobile apps.
Deploy to Vercel, Netlify, or any Next.js-compatible platform:
cd web
npm run buildBuild for production:
cd mobile
# iOS
eas build --platform ios
# Android
eas build --platform androidcd functions
firebase deploy --only functions- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
MIT License
- OpenFoodFacts for providing the food database
- Firebase for backend infrastructure
- Next.js and Expo teams for excellent frameworks