How krutthiikaaa/serve-final works
SERVE is a university night-canteen ordering platform: students select a canteen, browse its menu, receive a server-priced quote, place and pay for pickup orders, then track readiness; staff manage the order lifecycle and menu, while admins manage canteens and staff access. The three clients share an authenticated REST/realtime backend and PostgreSQL source of truth. Backend route-to-service edges follow shown route calls; additional client capabilities are README-documented, with some internal wiring unsampled.
Main entry points: app.ts Express app · services.ts Service wiring · orders.service.ts Quotes and orders · payments.service.ts Payment processing
Components 25
User apps
- Student app
apps/student - Staff dashboard
apps/staff/src/App.tsx - Admin portal
apps/admin/src/App.tsx
Shared web layer
- Web shared
packages/web-shared/src - API contracts
packages/contracts/src/index.ts
Backend API
- Express app
backend/src/app.ts - Identity and registration
backend/src/modules/auth/auth.service.ts - Canteens and browsing
backend/src/modules/canteens/canteens.service.ts - Service wiring
backend/src/services.ts - Authentication middleware
backend/src/middleware/auth.ts
Orders and operations
- Quotes and orders
backend/src/modules/orders/orders.service.ts - Payment processing
backend/src/modules/payments/payments.service.ts - Menu management
backend/src/modules/menu/menu.service.ts - Staff operations
backend/src/modules/staff/staff.service.ts - Admin management
backend/src/modules/admin/admin.service.ts - Access requests
backend/src/modules/change-requests/change-requests.service.ts - Notifications
backend/src/modules/notifications/notifications.service.ts - Realtime events
backend/src/realtime/socket-server.ts
Persistence and integrations
- Prisma client
backend/src/lib/prisma.ts - PostgreSQL
- Firebase Auth
- Payment provider
backend/src/modules/payments/provider.ts
Other components
- Student
- Canteen staff
- Administrator
Connections 36
- Student → Student app: orders and tracks
README.md - Canteen staff → Staff dashboard: manages orders
README.md - Administrator → Admin portal: manages platform
README.md - Student app → Web shared: uses shared services
- Staff dashboard → Web shared: uses auth and realtime
apps/staff/src/App.tsx - Admin portal → Web shared: uses auth and realtime
apps/admin/src/App.tsx - Web shared → API contracts: uses types
- Student app → Express app: REST and sockets
README.md - Staff dashboard → Express app: REST and sockets
apps/staff/src/App.tsx - Admin portal → Express app: REST and sockets
apps/admin/src/App.tsx - Firebase Auth → Authentication middleware: proves identity
README.md - Express app → Identity and registration: routes registration
backend/src/app.ts - Express app → Canteens and browsing: routes browsing
backend/src/app.ts - Express app → Quotes and orders: routes cart and orders
backend/src/app.ts - Express app → Payment processing: routes payments
backend/src/app.ts - Express app → Staff operations: routes staff actions
backend/src/app.ts - Express app → Admin management: routes admin actions
backend/src/app.ts - Express app → Notifications: routes notifications
backend/src/app.ts - Express app → Service wiring: creates services
backend/src/app.ts - Service wiring → Quotes and orders: provides order service
- Service wiring → Payment processing: provides payment service
- Service wiring → Menu management: provides menu service
- Service wiring → Admin management: provides admin service
- Service wiring → Access requests: provides request service
- Service wiring → Notifications: provides notification service
- Identity and registration → Access requests: creates access request
backend/src/modules/auth/auth.service.ts - Quotes and orders → PostgreSQL: reads and writes
- Canteens and browsing → PostgreSQL: reads canteen data
- Menu management → PostgreSQL: reads and writes
- Payment processing → Payment provider: dispatches payment
- Payment processing → PostgreSQL: records payment
- Quotes and orders → Realtime events: publishes status
- Notifications → PostgreSQL: persists notices
- Express app → Authentication middleware: authenticates routes
- Authentication middleware → Firebase Auth: verifies token
- Prisma client → PostgreSQL: connects to