A web application that helps UC Berkeley students track their macronutrient intake from campus dining halls and cafes. Calculate calories, protein, carbohydrates, fat, and sugar content from your meals with real-time menu data.
🌐 Live Demo: https://macros.kuljitu.com/
- Crossroads - The largest dining hall on campus
- Foothill - Convenient dining for students in the hills
- Cafe 3 - Quick meals and snacks
- Clark Kerr - Dining for Clark Kerr Campus residents
- GBC (Golden Bear Cafe) - Campus center dining
- Browns - Convenient campus dining option
- ✅ Calorie calculation - Track your daily energy intake
- ✅ Macronutrient breakdown - Monitor protein, carbs, and fat
- ✅ Sugar content - Keep track of sugar consumption
- ✅ Real-time menu data - Always up-to-date with current offerings
- ✅ Portion control - Customize serving sizes for accurate tracking
- Backend: Python Flask
- Database: Google Cloud Firestore
- Deployment: Google App Engine
- Data Source: UC Berkeley Dining Menu APIs
- Frontend: HTML, CSS, JavaScript
- Python 3.9+
- Google Cloud SDK (for deployment)
- Google Cloud Project with Firestore enabled
-
Clone the repository
git clone <repository-url> cd Macros
-
Set up virtual environment (recommended)
python3 -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Set up Google Cloud credentials
export GOOGLE_APPLICATION_CREDENTIALS="path/to/your/service-account-key.json"
-
Run the application
python main.py
The app will be available at
http://127.0.0.1:8080
This application is designed to run on Google App Engine:
-
Configure Google Cloud
gcloud config set project YOUR_PROJECT_ID
-
Deploy to App Engine
gcloud app deploy
-
Deploy cron jobs (for automatic menu updates)
gcloud app deploy cron.yaml
Macros/
├── main.py # Flask application and routes
├── locations.py # Dining hall data fetching
├── query_firestore.py # Database query operations
├── update_firestore.py # Database update operations
├── menu.py # Menu processing utilities
├── app.yaml # App Engine configuration
├── cron.yaml # Scheduled task configuration
├── requirements.txt # Python dependencies
├── static/ # CSS, JS, images, and icons
├── templates/ # HTML templates
└── venv/ # Virtual environment (local)
GOOGLE_APPLICATION_CREDENTIALS
- Path to Google Cloud service account keyGOOGLE_CLOUD_PROJECT
- Your Google Cloud project ID
locations
- Available dining hall information[location_name]
- Menu data for each dining hall
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is open source and available under the MIT License.
If you encounter any issues or have questions:
- Open an issue on this repository
- Visit the live application at https://macros.kuljitu.com/