How 4007ayesha/grub-canteen works
Grub Canteen is a smart canteen system with a React client and FastAPI API. Students browse and search food, manage a cart, check out, and track orders; administrators manage menus, orders, inventory, and analytics. The backend also exposes authentication, payments, feedback, notifications, and demand-prediction capabilities. The graph reflects documented routes and sampled imports; the README gives little workflow detail, and the frontend API excerpt does not establish its backend endpoint connections.
Main entry points: main.py API application · database.py Database session · models.py Domain records · App.jsx Route application
Components 29
React client
- Route application
frontend/src/App.jsx - Auth state
frontend/src/context/AuthContext.jsx - Cart state
frontend/src/context/CartContext.jsx - Search overlay
frontend/src/components/layout/SearchOverlay.jsx - API client
frontend/src/api.js - Student pages
frontend/src/pages - Menu administration
frontend/src/pages/AdminMenu.jsx - Order administration
frontend/src/pages/AdminOrders.jsx - Inventory administration
frontend/src/pages/AdminInventory.jsx - Analytics dashboard
frontend/src/pages/AdminAnalytics.jsx
FastAPI services
- API application
backend/main.py - Authentication routes
backend/routes/auth.py - Menu routes
backend/routes/menu.py - Payment routes
backend/routes/payment.py - Order and tracking routes
backend/routes/orders.py - Feedback routes
backend/routes/feedback.py - Notification routes
backend/routes/notifications.py - Inventory and waste routes
backend/routes/inventory.py - Analytics routes
backend/routes/analytics.py - Demand prediction routes
backend/routes/predictions.py - Token and password logic
backend/auth.py - Admin authorization
backend/dependencies.py
Canteen operations
- Order update manager
backend/websocket_manager.py - Prediction model
backend/ml_model.py
Data and prediction
- Database session
backend/database.py - Domain records
backend/models.py - Request and response schemas
backend/schemas.py
Other components
- Student
- Administrator
Connections 48
- Student → Route application: uses
frontend/src/App.jsx - Administrator → Route application: uses
frontend/src/App.jsx - Route application → Student pages: routes to
frontend/src/App.jsx - Route application → Menu administration: routes to
frontend/src/App.jsx - Route application → Order administration: routes to
frontend/src/App.jsx - Route application → Inventory administration: routes to
frontend/src/App.jsx - Route application → Analytics dashboard: routes to
frontend/src/App.jsx - Auth state → API client: calls
frontend/src/context/AuthContext.jsx - Search overlay → API client: queries
frontend/src/components/layout/SearchOverlay.jsx - API application → Authentication routes: registers
backend/main.py - API application → Menu routes: registers
backend/main.py - API application → Payment routes: registers
backend/main.py - API application → Order and tracking routes: registers
backend/main.py - API application → Feedback routes: registers
backend/main.py - API application → Notification routes: registers
backend/main.py - API application → Inventory and waste routes: registers
backend/main.py - API application → Analytics routes: registers
backend/main.py - API application → Demand prediction routes: registers
backend/main.py - Authentication routes → Token and password logic: uses
backend/routes/auth.py - Admin authorization → Token and password logic: validates
backend/dependencies.py - Authentication routes → Database session: queries
backend/routes/auth.py - Authentication routes → Domain records: uses
backend/routes/auth.py - Authentication routes → Request and response schemas: validates
backend/routes/auth.py - Menu routes → Database session: queries
backend/routes/menu.py - Menu routes → Domain records: uses
backend/routes/menu.py - Menu routes → Request and response schemas: validates
backend/routes/menu.py - Payment routes → Database session: queries
backend/routes/payment.py - Payment routes → Domain records: uses
backend/routes/payment.py - Payment routes → Request and response schemas: validates
backend/routes/payment.py - Order and tracking routes → Database session: queries
backend/routes/orders.py - Order and tracking routes → Domain records: uses
backend/routes/orders.py - Order and tracking routes → Request and response schemas: validates
backend/routes/orders.py - Order and tracking routes → Order update manager: broadcasts
backend/routes/orders.py - Order and tracking routes → Notification routes: uses
backend/routes/orders.py - Feedback routes → Database session: queries
backend/routes/feedback.py - Feedback routes → Domain records: uses
backend/routes/feedback.py - Feedback routes → Request and response schemas: validates
backend/routes/feedback.py - Notification routes → Database session: queries
backend/routes/notifications.py - Notification routes → Domain records: uses
backend/routes/notifications.py - Notification routes → Request and response schemas: validates
backend/routes/notifications.py - Inventory and waste routes → Database session: queries
backend/routes/inventory.py - Inventory and waste routes → Domain records: uses
backend/routes/inventory.py - Inventory and waste routes → Request and response schemas: validates
backend/routes/inventory.py - Analytics routes → Database session: queries
backend/routes/analytics.py - Analytics routes → Domain records: uses
backend/routes/analytics.py - Demand prediction routes → Database session: queries
backend/routes/predictions.py - Demand prediction routes → Domain records: uses
backend/routes/predictions.py - Demand prediction routes → Request and response schemas: validates
backend/routes/predictions.py