How sathvikpd7/smart-hostel-food-management works
This is a student meal-booking and cafeteria administration application. Students authenticate, browse menus, book meals, view booking history and QR information, and submit ratings or feedback; administrators manage menus and users, verify bookings, and review analytics and sentiment. The backend owns API workflows and persists application records in PostgreSQL, with recommendation and sentiment services supporting meal discovery and feedback analysis. The README is empty, and many frontend modules were not excerpted, so some feature connections are left unverified rather than inferred.
Main entry points: App.tsx Student portal · AdminApp.tsx Admin portal · server.ts API workflows · MealContext.tsx Meal and booking state
Components 25
Student application
- Student portal
frontend/src/App.tsx - Student dashboard
frontend/src/pages/student/StudentDashboard.tsx - Meal and booking state
frontend/src/contexts/MealContext.tsx - Meal browsing
frontend/src/pages/student/WeeklyMenuPage.tsx - Booking history
frontend/src/pages/student/BookingHistoryPage.tsx - Meal feedback
frontend/src/pages/student/FeedbackPage.tsx - Meal recommendations
frontend/src/services/mealRecommendation.ts - QR display
frontend/src/components/student/QRCodeDisplay.tsx - Authentication state
frontend/src/contexts/AuthContext.tsx - Live event client
frontend/src/services/sseClient.ts
Administration
- Admin portal
frontend/src/AdminApp.tsx - Menu management
frontend/src/pages/admin/MenuManagementPage.tsx - AI menu planner
frontend/src/components/admin/AIMenuPlanner.tsx - QR verification
frontend/src/pages/admin/QrVerificationPage.tsx - Analytics and reports
frontend/src/pages/admin/AnalyticsDashboardPage.tsx - User management
frontend/src/pages/admin/UserManagementPage.tsx - Sentiment dashboard
frontend/src/components/admin/SentimentDashboard.tsx
Backend API
- API workflows
backend/server.ts - Request validation
backend/src/middleware/validate.ts
Persistence and services
- PostgreSQL database
backend/src/config/database.ts - TTL cache
backend/src/services/cache.service.ts - Recommendation engine
backend/src/services/mealRecommendation.ts - Sentiment analysis
backend/src/services/sentimentAnalysis.ts
Other components
- Student
- Administrator
Connections 25
- Student → Student portal: uses
- Student portal → Student dashboard: presents
- Student dashboard → Meal and booking state: reads state
frontend/src/pages/student/StudentDashboard.tsx - Student dashboard → Authentication state: reads identity
frontend/src/pages/student/StudentDashboard.tsx - Meal and booking state → Authentication state: reads identity
frontend/src/contexts/MealContext.tsx - Meal and booking state → Live event client: subscribes
frontend/src/contexts/MealContext.tsx - Student portal → Meal browsing: routes to
- Student portal → Booking history: routes to
- Student portal → Meal feedback: routes to
- Student portal → Meal recommendations: offers
- Student portal → QR display: offers
- Administrator → Admin portal: uses
- Admin portal → Menu management: routes to
- Admin portal → AI menu planner: offers
- Admin portal → QR verification: routes to
- Admin portal → Analytics and reports: routes to
- Admin portal → User management: routes to
- Admin portal → Sentiment dashboard: offers
- API workflows → PostgreSQL database: initializes and queries
backend/server.ts - API workflows → Request validation: validates requests
backend/server.ts - API workflows → TTL cache: uses cache
backend/server.ts - API workflows → Recommendation engine: generates recommendations
backend/server.ts - API workflows → Sentiment analysis: analyzes feedback
backend/server.ts - Meal and booking state → API workflows: requests API data
- Live event client → API workflows: opens event stream