Nutrition Tracker is a full-stack web application that helps users analyze daily nutrition intake by scanning food labels.
It uses Tesseract OCR to extract data from nutrition labels and a Flask backend to process and analyze the information.
The frontend is built with React, providing a clean and interactive interface for users to upload, view, and explore nutritional insights.
- OCR Scanning – Upload a photo of a nutrition label and extract text automatically using Tesseract.
- Smart Analysis – Parse calories, and calculate macronutrients and micronutrients from text for structured display.
- Backend API – Flask backend processes OCR data and handles business logic.
- Interactive Frontend – React UI for uploading images, displaying results, and managing analysis history.
- Real-time Feedback – See nutritional summaries instantly after label upload.
- React (TypeScript)
- React Router
- Tanstack Query
- Recharts
- Flask (Python)
- Tesseract OCR (pytesseract) for text recognition
- Flask-SQLAlchemy
- PostgreSQL
- Google Gemini to provide users with feedback about their intake
cd flask-backend
python -m venv venv
source venv/bin/activate # (or venv\Scripts\activate on Windows)
pip install -r requirements.txt
flask runThe backend will start at http://localhost:5000
Open a new terminal:
cd frontend
npm install
npm run devThe frontend sends API requests to:
http://localhost:5000/api/
- User uploads an image of a food label.
- The image is sent to the Flask API.
- Flask uses pytesseract to extract text from the image.
- Extracted data is parsed into structured nutritional info (calories, fat, protein, etc.).
- The frontend displays an easy-to-read summary.