A mess crowd management system that combines a Flutter web UI, a Flask prediction API, and ML models to help students choose the best time to eat.
- What it does
- Highlights
- Tech Stack
- System overview
- Meal windows
- API
- Quick start
- Reproduce the predictions flow
- Optional ML training
- Configuration
- Project structure
- Team
- Learning Resource
SmartMess provides real-time mess crowd visibility, attendance tracking, and meal-aware predictions. The UI surfaces the best time slots to visit the mess, while managers can review attendance, menus, and feedback.
- 15-minute slot predictions with best-slot recommendations
- Student and manager dashboards
- QR-based attendance capture
- Menu and review tracking
- ML-backed predictions when models are available, fallback logic otherwise
| Component | Technology |
|---|---|
| ML Framework | TensorFlow 2.20.0 + Keras |
| Backend | Flask + Python 3.13 |
| Frontend | Flutter + Dart |
| Database | Firebase Firestore |
| Deployment | Docker-ready |
Data flow (high level):
Flutter Web UI -> Flask API (/predict) -> ML model -> Firebase (auth, attendance, reviews, menus)
- Breakfast: 07:30-09:30
- Lunch: 12:00-14:00
- Dinner: 19:30-21:30
Predictions are generated for the current meal window. Outside these windows, the backend returns an empty list.
Base URL: http://localhost:8080 by default.
Returns backend service status.
Request body:
{
"messId": "alder",
"mealType": "lunch",
"capacity": 120
}Response (shape):
{
"capacity": 120,
"current_crowd": 60,
"current_percentage": 50.0,
"fallback": false,
"mealType": "lunch",
"messId": "alder",
"predictions": [
{
"capacity": 120,
"confidence": "low",
"crowd_percentage": 40.0,
"predicted_crowd": 48,
"recommendation": "Moderate crowd",
"time_24h": "13:30",
"time_slot": "01:30 PM"
},
{
"capacity": 120,
"confidence": "low",
"crowd_percentage": 46.0,
"predicted_crowd": 55,
"recommendation": "Moderate crowd",
"time_24h": "13:45",
"time_slot": "01:45 PM"
}
],
"source": "fallback",
"timestamp": "2025-12-28T07:58:07.009597"
}- Flutter 3.x (Dart >= 3.0)
- Python 3.10+
- Firebase project (configured in
frontend/lib/firebase_options.dart)
cd backend
python -m venv .venv
.\.venv\Scripts\activate # Windows
pip install -r requirements.txt
python main.pyThe API runs on http://localhost:8080.
cd frontend
flutter pub get
flutter run -d chrome --dart-define=SMARTMESS_BACKEND_URL=http://localhost:8080curl -X POST http://localhost:8080/predict \
-H "Content-Type: application/json" \
-d "{\"messId\":\"alder\",\"mealType\":\"lunch\",\"capacity\":120}"- Start the backend and frontend.
- Open the web app.
- Navigate to the predictions section.
- Confirm upcoming slots render for the active meal window.
If you want ML-backed predictions instead of the fallback logic:
cd ml_model
python train_tensorflow.py alder
python train_tensorflow.py oakThe backend automatically uses ML predictions when models are available. If not, it falls back to meal-aware heuristics.
SMARTMESS_BACKEND_URLsets the prediction API base URL.
Example (hosted frontend):
flutter run -d chrome --dart-define=SMARTMESS_BACKEND_URL=https://your-api.example.comPORTsets the HTTP port (default: 8080).- Update CORS origins in
backend/main.pywhen hosting the frontend.
SMARTMESS/
backend/ Flask API
frontend/ Flutter web app
ml_model/ ML training and model files
README.md Project overview
Built with ❤️ for better mess management