HealthByte is a Flask‑based web application for tracking daily nutrition, setting calorie goals, and receiving food recommendations based on dietary preferences to complete daily calorie intake (Vegan, Vegetarian, Non‑Vegetarian).
This project was completed as part of the coursework for Applied Database Technologies.
- User signup, login and secure password storage
- Set and track daily calorie goals
- Search and compare nutritional profiles of foods
- Log daily intake with quantity and view history
- Automatic recommendations for remaining calories
- Visual charts for food comparison
- Login Page
- Signup Page
- Food Searching
- Food Adding
- Daily Log
- Recommendations based on left calories for day
- Comparing two food items
/healthbyte
├── app.py # Main Flask application with routes
├── models.py # SQLAlchemy models: User, Food, DailyEntry
├── modified_nutrition.csv # Nutrition dataset used by the app
├── templates/ # Jinja2 HTML templates
│ ├── index.html
│ ├── login.html
│ ├── signup.html
│ ├── search.html
│ ├── compare.html
│ ├── daily.html
│ └── layout.html
├── static/ # Static assets (CSS, JS, images)
├── .env # Environment variables (SECRET_KEY, DATABASE_URL)
├── .gitignore
└── README.md # This documentation
- Clone the repo:
git clone https://github.com/yourusername/healthbyte.git - Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate - Install dependencies:
pip install -r requirements.txt - Configure
.envwith:SECRET_KEY=your_secret_key DATABASE_URL=mysql://user:pass@host/db_name - Initialize the database:
flask db init flask db migrate flask db upgrade
export FLASK_APP=app.py
export FLASK_ENV=development
flask runOpen http://localhost:5000 in your browser.
- Signup/Login: Create an account or login.
- Set Preferences: Define your daily calorie goal and dietary preference.
- Search Foods: Lookup items from
modified_nutrition.csv. - Compare: Select two foods to see a side‑by‑side nutrient bar chart.
- Log Intake: Record quantity consumed each day.
- Daily View: Check your calories, history, status (✓/✗), and get recommendations.
- Flask & SQLAlchemy: Routes in
app.pyhandle HTTP requests. Models inmodels.pymap to MySQL tables. - Authentication: Managed with Flask-Login; passwords hashed via Werkzeug.
- Data: Food records loaded from CSV into the
Foodtable. - Visualization: Matplotlib generates comparison charts, embedded as Base64 images.
- Recommendations: Calculates remaining calories and filters foods by user preference.
Meryl Sarah Jacob - Indiana University Bloomington
Dhruvil Joshi - Indiana University Bloomington







