Web application that scrapes Penn State campus dining menus, analyzes food items using Google Gemini AI, and provides personalized meal recommendations based on dietary preferences.
- Scrapes daily menus from Penn State dining websites
- Analyzes food items with AI for health scores (0-100)
- Filters by dietary preferences (vegetarian, vegan, protein priority, exclusions)
- Ranks recommendations by meal (Breakfast, Lunch, Dinner)
- Provides nutrition information links
- Caches results for 24 hours to reduce API calls
Controls:
- Select campus dining location from dropdown
- Toggle dietary preferences (vegetarian, vegan, exclude beef/pork, prioritize protein)
- Click "Analyze Today's Menu" button
- Preferences are saved to localStorage
- Menu Scraping: Flask backend scrapes menu data from Penn State dining websites using BeautifulSoup
- Data Processing: Parses HTML to extract food items, meal times, and nutrition links
- AI Analysis: Sends food items to Google Gemini 3.1 Flash API for health scoring
- Preference Filtering: Applies user dietary restrictions and preferences server-side
- Ranking: Sorts items by health score and protein content (if prioritized)
- Caching: Stores results in pickle files with MD5 hash keys for 24-hour cache
- Display: Frontend displays ranked recommendations with scores and analysis
Flask- Backend web frameworkFlask-CORS- Cross-origin resource sharingbeautifulsoup4- HTML parsing and web scrapingrequests- HTTP requests for menu scrapingaiohttp- Async HTTP requestspython-dotenv- Environment variable managementgunicorn- WSGI server for productionGoogle Gemini 3.1 Flash API- AI-powered nutritional analysisTailwind CSS- Frontend styling framework
- Backend: Flask REST API with CORS enabled
- Frontend: HTML/JavaScript with Tailwind CSS
- Health Score Range: 0-100 (based on protein, cooking method, nutritional balance)
- Supported Locations: 16+ Penn State campus dining locations
- Cache: 24-hour pickle file cache with MD5 hash keys
- Scraping: BeautifulSoup parsing of Penn State dining HTML
- AI Model: Google Gemini 3.1 Flash
- Note: Results may be inaccurate on weekends due to missing menu data