How anandk2662/food-waste-management works
This is a campus food-service and waste-management product with separate student and kitchen portals backed by a FastAPI service. The principal workflow is students browsing menus, booking meals, collecting pickup orders, and submitting feedback; kitchen staff manage menus, production, counter orders, pickup tokens, users, waste, and analytics. The backend exposes authentication, menu, booking, and user APIs over PostgreSQL. Backend routing and authentication links are supported by the supplied source/index; frontend-to-API wiring and several operational service details were not shown, so those links are omitted or marked unverified.
Main entry points: main.py API application · routes/auth.py Authentication routes · services/auth.py Authentication service · connection.py Database connection
Components 29
Student portal
- Student pages
frontend/app/(student) - Student sign-in
frontend/app/login/page.tsx - Student state
frontend/lib/student-store.tsx
Kitchen portal
- Kitchen operations
ktn_frontend/app/(kitchen) - Kitchen sign-in
ktn_frontend/app/login/page.tsx - Kitchen state
ktn_frontend/lib/kitchen-store.tsx
Backend API
- API application
backend/app/main.py - Authentication routes
backend/app/api/routes/auth.py - Booking routes
backend/app/api/routes/bookings.py - Menu routes
backend/app/api/routes/menu.py - User routes
backend/app/api/routes/users.py - Authentication service
backend/app/services/auth.py - Booking service
backend/app/services/booking.py - Menu service
backend/app/services/menus.py - Feedback service
backend/app/services/feedback.py - Auth schemas
backend/app/schemas/auth.py - Booking schemas
backend/app/schemas/booking.py - Menu schemas
backend/app/schemas/menu.py
Persistence and security
- Token security
backend/app/core/security.py - Auth dependencies
backend/app/core/dependencies.py - User repository
backend/app/repository/user.py - Booking repository
backend/app/repository/booking.py - Menu repository
backend/app/repository/menu.py - Database connection
backend/app/db/connection.py - PostgreSQL
- Seed data
database/seed/seed.py - Seed accounts
database/seed/seed_users.py
Other components
- Student
- Kitchen staff
Connections 30
- Student → Student pages: uses
- Kitchen staff → Kitchen operations: uses
- API application → Authentication routes: registers
backend/app/main.py - API application → Menu routes: registers
backend/app/main.py - API application → Booking routes: registers
backend/app/main.py - API application → User routes: registers
backend/app/main.py - Authentication routes → Authentication service: calls
backend/app/api/routes/auth.py - Booking routes → Booking service: calls
backend/app/api/routes/bookings.py - Menu routes → Menu service: calls
backend/app/api/routes/menu.py - User routes → Authentication service: calls
backend/app/api/routes/users.py - Authentication routes → Auth schemas: validates
backend/app/api/routes/auth.py - Booking routes → Booking schemas: uses
backend/app/api/routes/bookings.py - Menu routes → Menu schemas: uses
backend/app/api/routes/menu.py - Authentication service → Token security: hashes passwords
backend/app/services/auth.py - Authentication service → User repository: reads and writes
backend/app/services/auth.py - Authentication routes → Token security: creates tokens
backend/app/api/routes/auth.py - Auth dependencies → Token security: decodes tokens
backend/app/core/dependencies.py - Auth dependencies → User repository: loads user
backend/app/core/dependencies.py - Database connection → PostgreSQL: connects
backend/app/db/connection.py - User repository → Database connection: queries
backend/app/repository/user.py - Booking service → Booking repository: delegates
- Menu service → Menu repository: delegates
- Booking repository → Database connection: uses
- Menu repository → Database connection: uses
- Seed data → Seed accounts: seeds accounts
database/seed/seed.py - Seed accounts → PostgreSQL: upserts users
database/seed/seed_users.py - Student pages → Student state: state wiring unverified
- Kitchen operations → Kitchen state: state wiring unverified
- Student state → API application: API use unverified
- Kitchen state → API application: API use unverified