🍴 HungryHive – Smart Group Dining Assistant
GitHub Repository
💡 Inspiration
The inspiration for HungryHive came from a real, recurring, and frustrating problem: the endless "where should we eat?" debate.
We've all been in that group chat, stuck in a 20-minute loop of conflicting cravings ("I want spicy Indian", "No, I want light Italian"), different hunger levels, and varying locations.
This group indecision often ends in frustration or a mediocre compromise.
We wanted to build a smart, objective tool that could take all those messy human preferences and turn them into a single, optimized, and data-driven decision.
🍽️ What it does
HungryHive is a full-stack web application designed to find the perfect restaurant for a group.
Key Features
Create or Join a Group
- Users can create a new group, generating a unique ID, or join an existing group using its ID.
- Users can create a new group, generating a unique ID, or join an existing group using its ID.
Submit Preferences
Each member fills a simple, interactive form including:- 🌍 Location: Auto-fetched via the browser’s Geolocation API.
- 🍛 Cuisine cravings: (1–5 sliders for Indian, Italian, Mexican, etc.).
- 🍽️ Hunger & spice level: Radio buttons for clarity.
- 🥦 Dietary needs: Veg / Non-Veg.
- 🍹 Drink preferences: Mocktails, juices, cocktails, or alcohol.
- 🌍 Location: Auto-fetched via the browser’s Geolocation API.
Real-Time Group Sync
- Using Firebase Realtime Database, all members can see who has joined and submitted their preferences — live.
- Using Firebase Realtime Database, all members can see who has joined and submitted their preferences — live.
Backend Analysis (Flask + AI)
- When “Find Restaurants” is clicked, all preferences and locations are sent to the backend.
- The Python Flask backend calculates the group’s geographic midpoint and uses K-Means Clustering (scikit-learn) to detect subgroups with similar tastes (e.g., “the spicy/hungry cluster”).
- This structured data is fed to Google Gemini API, which recommends the top 1–2 cuisines that best satisfy the entire group.
- When “Find Restaurants” is clicked, all preferences and locations are sent to the backend.
Restaurant Search
- The backend queries SerpAPI (Google Maps engine) using the recommended cuisines and group centroid to find real nearby restaurants.
- The backend queries SerpAPI (Google Maps engine) using the recommended cuisines and group centroid to find real nearby restaurants.
Vote on Results
- The backend returns the top 5 restaurant options, which are displayed for live voting via Firebase.
- The backend returns the top 5 restaurant options, which are displayed for live voting via Firebase.
Tie-Breaker
- A fun “Pick Randomly” button acts as a tiebreaker, selecting one of the top-voted options.
- A fun “Pick Randomly” button acts as a tiebreaker, selecting one of the top-voted options.
🏗️ How we built it
Frontend:
- HTML5, CSS3, and vanilla JavaScript
- Firebase Realtime Database SDK for live syncing of members and votes
Backend:
- Python Flask framework
Machine Learning:
scikit-learn(KMeans, StandardScaler, PCA) for clustering and pattern analysis
Generative AI:
- Google Gemini API (
google-generativeai) to interpret clusters and produce human-readable recommendations
Restaurant Data:
- SerpAPI (Google Maps) to find actual restaurants near the group’s centroid
Deployment:
- Frontend: Static Site hosted on Render
- Backend: Flask Web Service deployed on Render
- Version Control: Git & GitHub
⚙️ Challenges we ran into
Finding a Viable Restaurant API
- The Google Places API required billing, so we pivoted to SerpAPI, which offered accessible and reliable search results.
- The Google Places API required billing, so we pivoted to SerpAPI, which offered accessible and reliable search results.
CORS Errors
- Connecting a deployed frontend and backend caused cross-origin issues. We fixed this by configuring
flask-corsand defining environment variables on Render.
- Connecting a deployed frontend and backend caused cross-origin issues. We fixed this by configuring
Firebase Path Errors
- Firebase paths can’t contain
.(periods), which caused our vote keys (based on coordinates) to fail. - We sanitized them by replacing
.with_before saving.
- Firebase paths can’t contain
Browser Caching
- Changes to
app.jsweren’t updating due to aggressive caching. We learned to clear caches, bump Service Worker versions, and unregister old workers.
- Changes to
Backend Environment Errors
- We faced environment inconsistencies between local and Render deployments — especially Gemini library version issues and Matplotlib requiring a non-GUI backend (
Agg).
- We faced environment inconsistencies between local and Render deployments — especially Gemini library version issues and Matplotlib requiring a non-GUI backend (
🏆 Accomplishments that we're proud of
- Built a Complete Full-Stack Solution: A seamless frontend, backend, and real-time database integration.
- Meaningful AI + ML Integration: Combined clustering (ML) and generative reasoning (AI) for intelligent group recommendations.
- Real-World Impact: Solves a universal pain point — the indecisive “food chat.”
- Successful Deployment: Connected separate Render services and overcame CORS + environment issues.
📚 What we learned
- 🔑 Always use environment variables for sensitive keys — never hardcode them.
- 🌐 Plan for CORS early when connecting multiple deployed services.
- ⚙️ Manage Service Worker caching aggressively during development.
- ⚡ Firebase is a simple yet powerful tool for real-time sync without WebSockets.
- 🧩 Always validate and sanitize data structures exchanged between frontend and backend.
🚀 What's next for HungryHive
- 💰 Budget & Ambiance Filters: Add price range and occasion (“Casual,” “Celebration”) options.
- 👤 User Accounts: Move beyond temporary group IDs to persistent profiles and saved preferences.
- 🍲 Menu Item Recommendation (RAG): Use Gemini with Retrieval-Augmented Generation to recommend actual dishes and portions to reduce waste.
- 🔗 App Integrations: Deep-link with Swiggy, Zomato, or DineOut APIs for instant order or reservation.
- 🎙️ Multimodal Inputs: Add voice, image, and chat interactions with Gemini Nano for on-device personalization.
No more endless group chat chaos — HungryHive turns debate into delicious decisions. 🍕🍜🌮
Built With
- css3
- firebase
- flask
- flask-cors
- gunicorn
- html5
- javascript
- numpy
- pandas
- python
- scikit-learn
Log in or sign up for Devpost to join the conversation.