FoodLens helps you scan any food to instantly get nutrition facts, track calories, and manage your diet with ease. Use your camera to scan food labels or ingredients and instantly log calories, macros, and more.
- Features
- Tech Stack
- Getting Started
- Environment Variables
- Development Roadmap
- Contributing
- Contact Information
- License
Production Environment:
- Live Demo: https://foodlens.up.railway.app
- Food Scanner: Use your camera to scan your food.
- Nutrition Tracker: Instant breakdown of calories, macros, and minerals.
- Calorie Counter: Log daily intake, set goals, and view progress charts.
- Diet Management: Save scan history and review past meals.
- Recipe Search: Browse and fetch recipes.
- Premium & Credit System: Enhanced AI scanning for premium users with credit-based access.
- Frontend: React, Vite, Tailwind CSS, React Query, Chart.js, Recharts
- Backend (Express): Node.js, Express 5, Prisma ORM, Passport (JWT & Google OAuth), Cloudinary, OpenAI SDK
- Backend (Python): Flask, PyTorch, Transformers, Pillow, Waitress/Gunicorn, PyJWT, Hugging Face API
- Database: PostgreSQL (via Prisma Client), Supabase
- Utilities: Multer, CORS, Express Rate Limiter, Nodemailer
- Deployment & Hosting: Railway
- Node.js ≥ 16.0.0
- Python ≥ 3.8
- PostgreSQL
- Cloudinary account
- OpenAI API key
- Hugging Face auth key
-
Clone the repository
git clone git@github.com:Etativel/FoodLens.git cd FoodLens
-
Setup Express Backend
cd backend/express npm install cp .env.example .env # Edit .env and add the following keys: # DATABASE_URL # DIRECT_URL # OPENAI_API_KEY # JWT_SECRET # CLOUDINARY_CLOUD_NAME # CLOUDINARY_API_KEY # CLOUDINARY_API_SECRET # GOOGLE_CLIENT_ID # GOOGLE_CLIENT_SECRET # GOOGLE_CALLBACK_URL # EMAIL_USER # EMAIL_PASS # FRONTEND_URL npx prisma migrate dev --name init npm start
-
Setup Python Backend
cd ../../backend/python python -m venv venv source venv/bin/activate pip install -r requirements.txt cp .env.example .env # Configure .env: HUGGINGFACE_AUTH_TOKEN, JWT_SECRET # Run with Gunicorn: gunicorn app:app --workers 4 --bind 0.0.0.0:5000
-
Setup Frontend
cd ../../frontend npm install npm run dev
Express Backend (backend/express/.env):
DATABASE_URL
= PostgreSQL connection stringDIRECT_URL
= Direct database URL if separateOPENAI_API_KEY
= OpenAI API keyJWT_SECRET
= JWT signing secretCLOUDINARY_CLOUD_NAME
= Cloudinary cloud nameCLOUDINARY_API_KEY
= Cloudinary API keyCLOUDINARY_API_SECRET
= Cloudinary API secretGOOGLE_CLIENT_ID
= OAuth client IDGOOGLE_CLIENT_SECRET
= OAuth client secretGOOGLE_CALLBACK_URL
= OAuth redirect URLEMAIL_USER
= Gmail address for nodemailerEMAIL_PASS
= Gmail app passwordFRONTEND_URL
= Frontend application URL
Python Backend (backend/python/.env):
HUGGINGFACE_AUTH_TOKEN
= Hugging Face auth tokenJWT_SECRET
= JWT signing secret
-
May 1–5: Project Kickoff & MVP
- Flask API setup for image prediction & pre-trained model
- Express backend & Vite/React frontend initialization
- Camera upload, OpenAI vision scan, skeleton component
-
May 6–12: Core Integration & Feature Build-out
- Configure Multer + Cloudinary for image storage; proxy JWT cookie to Flask
- Add recipe endpoints (fetch/upsert) and nutrition field support
- Build scan storage, intake logs, recipe pages, and calories line chart
- Introduce scan history view, filtering, and nutrient graphs
-
May 13–19: Authentication, Profiles & UI Components
- Add JWT auth, Google OAuth, email verification (nodemailer + verif code table)
- Implement LoginCode table and password validation
- Develop user profile provider and settings page
- Show daily intake chart on home; refine food-card layout and mobile toggles
-
May 20–22: Security, Error Handling & UX Enhancements
- Guard sign-in/UI with token checks; rate limiter for token requests
- Build reset-password flow: token table, request/reset pages, email template
- Add 404 page, loading spinners, tooltips for credits, and minor layout tweaks
- Implement cache invalidation for reducing credits
-
May 23: Final Polish & Cleanup
- Minor styling refinements across components
Feel free to submit a Pull Request.
- Fork the repository
- Create a branch: git checkout -b feature/my-feature
- Commit your changes: git commit -m 'Add some feature'
- Push to your branch: git push origin feature/my-feature
- Open a Pull Request
- Maintainer: Farhan
- Email: farhanmaulana.dev@gmail.com
- GitHub: https://github.com/Etativel