A production-oriented, full-stack hostel mess management system built with Flutter and Firebase. The platform digitises the complete lifecycle of institutional mess operations — from menu publishing and complaint tracking to face-recognition-based attendance and automated billing — replacing paper-based workflows with a role-gated, real-time application.
- Problem Statement / Objective
- Features
- Tech Stack
- System Architecture
- Data Flow Diagram
- Installation & Setup
- Usage
- Screenshots / Demo
- API Integration
- Firestore Data Model
- Folder Structure
- Future Enhancements / Roadmap
- Contributing
- License
- Author / Contact
Residential hostels and university campuses rely on manual, error-prone processes for mess management: printed menus, paper complaint registers, manual attendance sheets, and spreadsheet-driven billing. This creates:
- Operational inefficiencies — staff spend significant time on repetitive administrative tasks.
- Lack of transparency — students have no real-time visibility into menus, complaints, or billing.
- Data silos — no consolidated view of food quality trends or attendance patterns for administrators.
- Fraud risk — manual attendance is susceptible to proxy entries.
Objective: Build a multi-role, real-time platform that automates mess operations, enforces role-based access control, provides data-driven analytics, and integrates face-recognition biometrics to eliminate proxy attendance.
- Email/password and Google Sign-In via Firebase Authentication.
- Three distinct roles: Admin, Staff, and Student — each with isolated navigation and Firestore security rule enforcement.
- Staff accounts require admin approval before activation; pending users are held at a waiting screen.
- Staff management — approve/reject staff registration requests.
- Student account creation — individual or bulk CSV import with validation.
- Weekly menu management — publish and edit the 7-day meal plan per meal slot.
- Complaint analytics — view aggregated complaint trends with severity classification (low/medium/high) and repeated-issue alerting.
- Mess cancellation oversight — review and manage student cancellation requests.
- Billing generation — calculate and publish monthly bills per student based on actual attendance.
- Real-time view of today's menu and upcoming meal schedule.
- Student management — view enrolled students and their attendance records.
- Operational snapshot — today's food reports, low-rating meals, and repeated issue alerts.
- Billing interface — view and mark student bills as paid.
- Daily & weekly menu viewer — browse the full weekly meal plan with meal-type filtering.
- Complaint / food report submission — categorised by meal type and issue type (taste, hygiene, temperature, portion size, quality, freshness, service).
- Mess cancellation — request meal cancellations to adjust billing.
- Replacement food selection — choose substitute items when a menu item is unavailable.
- Monthly bill tracking — view current and historical billing statements.
- Personal analytics — view own attendance and meal history.
- Dedicated Flutter app (
face_attendance_app) integrates Google ML Kit Face Detection. - On-device face detection + embedding extraction from face geometry and landmarks.
- Cosine/Euclidean similarity matching against stored embeddings for identity verification.
- Node.js Express backend (
face_attendance_backend) handles embedding storage (Firestore) and time-window-validated attendance marking (Breakfast / Lunch / Dinner slots).
- Interactive charts powered by fl_chart for complaint trends, attendance statistics, and meal ratings.
- Configurable date-range and meal/issue-type filters.
- Adjustable severity thresholds for repeated-issue detection.
- Export capabilities for reporting.
| Layer | Technology | Purpose |
|---|---|---|
| Frontend | Flutter 3.x (Dart) | Cross-platform UI for Android, iOS, Web |
| State Management | Provider | Application-wide state (auth, menu, analytics) |
| Authentication | Firebase Authentication | Email/password + Google Sign-In |
| Database | Cloud Firestore | Real-time NoSQL data store |
| File Storage | Firebase Storage | Profile images and document uploads |
| Backend API | Node.js + Express | Face attendance REST API |
| Face Recognition | Google ML Kit (Face Detection) | On-device face detection & embedding |
| Charts | fl_chart | Analytics visualisations |
| PDF Generation | Syncfusion Flutter PDF | Report and bill exports |
| Excel Handling | excel (Dart) | Bulk student CSV import |
| Fonts | Google Fonts | UI typography |
| Build Tooling | FlutterFire CLI, Firebase CLI | Firebase project configuration |
| Security Rules | Firestore Security Rules | Role-enforced data access |
Architecture Overview:
The Smart Mess Management Platform follows a three-tier microservices architecture with clear separation of concerns:
┌─────────────────────────────────────────────────────────────┐
│ Flutter Application │
│ ┌──────────┐ ┌──────────┐ ┌────────────┐ │
│ │ Admin │ │ Staff │ │ Student │ (Role Router) │
│ │ Dashboard│ │ Portal │ │ Portal │ │
│ └────┬─────┘ └────┬─────┘ └─────┬──────┘ │
│ └─────────────┴──────────────┘ │
│ Provider (AppState) │
│ Services Layer (Auth, Menu, Billing …) │
└─────────────────────────┬───────────────────────────────────┘
│ Firebase SDK
┌─────────────────┼──────────────────┐
│ │ │
┌──────▼──────┐ ┌───────▼──────┐ ┌───────▼──────┐
│ Firebase │ │ Cloud │ │ Firebase │
│ Auth │ │ Firestore │ │ Storage │
└─────────────┘ └──────────────┘ └──────────────┘
Face Attendance Sub-system
┌──────────────────────┐ ┌──────────────────────────┐
│ face_attendance_app │ HTTP │ face_attendance_backend │
│ (Flutter + ML Kit) │─────▶│ (Node.js + Express) │
│ On-device detection │ │ Firestore Admin SDK │
└──────────────────────┘ └──────────────────────────┘
Key Components:
- Frontend Layer: Flutter cross-platform application with Provider-based state management
- Services Layer: Business logic abstraction for authentication, menu, billing, and analytics
- Backend Layer: Firebase ecosystem (Auth, Firestore, Storage) for scalable, serverless infrastructure
- Face Attendance Layer: Hybrid on-device + backend architecture for secure biometric processing
Authentication & Role Routing Flow:
Login ──► Firebase Auth ──► Firestore user doc
│
┌──────────────────┼──────────────────┐
▼ ▼ ▼
role=admin role=staff role=student
approved=true approved=true
│ │ │
AdminDashboard StaffHomeScreen HomeScreen
Data Flow Stages:
- User Authentication: Credentials validated against Firebase Authentication
- Role Verification: User document retrieved from Firestore to determine role and approval status
- Access Control: Security rules enforce role-based access to collections and documents
- Real-time Synchronization: Provider notifies UI of changes; Firestore listeners maintain data consistency
- Offline Support: Local cache layer enables operation without network connectivity
| Collection | Document | Key Fields |
|---|---|---|
users |
{uid} |
role, approved, studentId, rollNo |
mess_menu |
{weekday_meal} |
items[], date, mealType |
complaints |
{id} |
studentId, mealType, issueType, rating, timestamp |
cancellations |
{id} |
studentId, date, mealType, status |
attendance |
{YYYY-MM-DD} → students/{studentId} |
breakfast, lunch, dinner, lastMarked |
billing |
{YYYY-MM}/{studentId} |
chargedDays, amount, isPaid, paidAt |
face_data |
{studentId} |
embedding[], createdAt, updatedAt |
| Tool | Version |
|---|---|
| Flutter SDK | ≥ 3.x |
| Dart SDK | ≥ 3.x |
| Node.js | ≥ 18.x (for face backend) |
| Firebase CLI | Latest |
| FlutterFire CLI | Latest |
git clone https://github.com/SBK-07/Mess-Management-Platform.git
cd Mess-Management-Platformflutter pub getInstall CLI tools (if not already installed):
npm install -g firebase-tools
dart pub global activate flutterfire_cliAuthenticate and link your Firebase project:
firebase login
flutterfire configure- Select (or create) your Firebase project.
- Select target platforms: Android, iOS, Web, macOS.
- This generates
lib/firebase_options.dartwith your project credentials.
Deploy Firestore security rules:
firebase deploy --only firestore:rulescd face_attendance_backend
npm install
cp .env.example .env
# Edit .env: set GOOGLE_APPLICATION_CREDENTIALS to your Firebase service account JSON path
npm startThe API will be available at http://localhost:3000.
# From the project root
flutter runFor web:
flutter run -d chromecd face_attendance_app
flutter pub get
flutter run
# Default backend URL for Android emulator: http://10.0.2.2:3000- Log in with an admin account. A local development bootstrap account can be configured in
lib/services/auth_service.dart— do not use or commit real credentials; replace this with a proper admin seeding process before deploying to production. - Navigate to the Staff Requests tab to approve pending staff registrations.
- Use the Students tab to create accounts individually or upload a CSV for bulk import.
- Publish the weekly menu from the Menu tab.
- Monitor complaints and analytics from the Analytics tab.
- Generate and manage monthly billing from the Billing tab.
- Log in — account requires prior admin approval.
- View today's menu and upcoming meals on the home screen.
- Review student complaints and food reports.
- Mark student bills as paid from the billing screen.
- Register with an institutional email and complete your profile.
- Browse the daily/weekly menu from the home screen.
- Submit a food report or complaint after a meal.
- Request a mess cancellation for planned absences.
- Track your monthly bill and payment status.
- Launch
face_attendance_appon a device with a camera. - Registration mode — enrol a student's face: the app captures a frame, detects the face, extracts an embedding, and sends it to
/register-face. - Attendance mode — at meal time, the app matches the live face against stored embeddings and calls
/mark-attendance. The backend validates the current time against meal windows before recording.
Screenshots are located in
assets/images/. Add UI screenshots below by placing image files in that directory and updating the paths.
| Screen | Description |
|---|---|
| Login | Role-based login with Google Sign-In support |
| Admin Dashboard | Tabbed view: Overview, Staff, Students, Menu, Analytics |
| Student Home | Daily menu, quick actions (complaint, cancellation) |
| Analytics Dashboard | Charts for complaint trends, attendance stats, meal ratings |
| Face Attendance App | Camera-based face detection and attendance marking |
The Face Attendance REST API (face_attendance_backend) exposes the following endpoints:
| Environment | URL |
|---|---|
| Local (Node.js) | http://localhost:3000 |
| Android Emulator | http://10.0.2.2:3000 |
| Production | Configure via the FACE_BACKEND_URL environment variable or equivalent app constant |
Health check.
{ "success": true, "code": "OK", "message": "Face attendance API is running." }Register a student's face embedding.
Request:
{
"studentId": "STU001",
"embedding": [0.12, 0.43, 0.88, "..."]
}Success Response: FACE_REGISTERED
Error Codes: STUDENT_NOT_FOUND, INVALID_EMBEDDING, VALIDATION_ERROR
Retrieve all registered face embeddings for client-side matching.
Success Response: EMBEDDINGS_FETCHED with { records: [{ studentId, embedding }] }
Mark attendance for a student within a valid meal time window.
Request:
{ "studentId": "STU001" }Meal Time Windows (server time):
These windows are defined in
face_attendance_backend/src/utils/time_slots.jsand can be adjusted to match institutional requirements.
| Meal | Window |
|---|---|
| Breakfast | 07:00 – 08:00 |
| Lunch | 12:00 – 13:00 |
| Dinner | 18:30 – 21:30 |
Success Response: ATTENDANCE_MARKED
Error Codes: INVALID_TIME, DUPLICATE_ATTENDANCE, STUDENT_NOT_FOUND
| Service | Usage |
|---|---|
| Firebase Authentication | User sign-up, login, Google OAuth |
| Cloud Firestore | All application data (users, menu, complaints, billing, attendance) |
| Firebase Storage | Profile images, uploaded documents |
| Firebase Admin SDK | Server-side Firestore access in the Node.js backend |
Mess-Management-Platform/
├── lib/ # Main Flutter application source
│ ├── main.dart # App entry point, route definitions
│ ├── firebase_options.dart # Firebase project configuration
│ ├── providers/
│ │ └── app_state.dart # Global state (ChangeNotifier)
│ ├── models/ # Data models
│ │ ├── user.dart # AppUser with role/approval fields
│ │ ├── menu_item.dart
│ │ ├── complaint.dart
│ │ ├── cancellation.dart
│ │ ├── replacement.dart
│ │ └── ...
│ ├── services/ # Business logic & Firestore operations
│ │ ├── auth_service.dart # Firebase Auth + Google Sign-In
│ │ ├── menu_service.dart
│ │ ├── complaint_service.dart
│ │ ├── cancellation_service.dart
│ │ ├── mess_billing_service.dart
│ │ ├── analytics_service.dart
│ │ ├── bulk_import_service.dart
│ │ └── notification_service.dart
│ ├── repositories/ # Firestore data access layer
│ ├── screens/ # UI screens per role
│ │ ├── login_screen.dart
│ │ ├── admin_dashboard.dart
│ │ ├── staff_home_screen.dart
│ │ ├── home_screen.dart # Student home
│ │ ├── analytics_dashboard_screen.dart
│ │ └── ...
│ ├── widgets/ # Reusable UI components
│ └── utils/ # Constants, helpers, upload utilities
│
├── face_attendance_app/ # Standalone face attendance Flutter app
│ └── lib/ # ML Kit camera + embedding logic
│
├── face_attendance_backend/ # Node.js REST API
│ └── src/
│ ├── server.js # Express app, route definitions
│ ├── services/
│ │ ├── attendance_service.js
│ │ ├── face_data_service.js
│ │ └── user_service.js
│ ├── config/ # Firebase Admin SDK initialisation
│ └── utils/
│
├── assets/images/ # App image assets
├── docs/ # Setup guides and documentation
├── firestore.rules # Firestore role-based security rules
├── firestore.indexes.json # Composite index definitions
├── firebase.json # Firebase CLI project configuration
└── pubspec.yaml # Flutter dependencies
| Enhancement | Description |
|---|---|
| Push Notifications | Firebase Cloud Messaging for menu updates, complaint responses, bill reminders |
| Tighten Firestore Rules | Replace the broad authenticated catch-all rule with per-collection, per-role rules |
| Face Embedding Security | Encrypt embeddings at rest; rate-limit the /face-embeddings endpoint |
| QR-Code Meal Tokens | Alternative to face recognition for faster meal-time check-in |
| Offline Support | Firestore offline persistence for low-connectivity environments |
| Payment Gateway Integration | Razorpay / Stripe for in-app mess bill payments |
| Multi-Mess Support | Multi-tenancy to support multiple hostels/messes per institution |
| Dietary Preferences | Student-configurable dietary flags (vegetarian, vegan, allergens) |
| NLP Complaint Analysis | Sentiment analysis on free-text complaint descriptions |
| CI/CD Pipeline | GitHub Actions for automated Flutter build, lint, and test |
Contributions, issues, and feature requests are welcome.
- Fork the repository.
- Create a feature branch:
git checkout -b feature/your-feature-name
- Commit your changes with a descriptive message:
git commit -m "feat: add QR code meal token support" - Push to your fork:
git push origin feature/your-feature-name
- Open a Pull Request against
main, describing your changes and the motivation.
- Follow the Dart style guide and existing
analysis_options.yamllint rules. - Run
flutter analyzebefore submitting. - For the Node.js backend, follow the ESLint rules in
package.json.
This project is licensed under the MIT License — see the LICENSE file for details.
Project Maintainer & Developer
Danush
Built with ❤️ using Flutter & Firebase

