# nareshchandu17/qwikbite architecture

> Architecture diagram of the GitHub repository nareshchandu17/qwikbite, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nareshchandu17/qwikbite
- Repository: https://github.com/nareshchandu17/qwikbite

## Overview

QwikBite is a campus canteen ordering and operations system. Students browse the menu, build a cart, choose a preparation slot, pay, and track order progress; staff manage the live queue and canteen operations. The graph preserves documented payment, real-time, and AI capabilities, plus administration branches for menu, inventory, feedback, analytics, and staffing. The README documents the core flow; sampled route and service excerpts confirm selected storage, event, and assistant orchestration relationships. Unsampled subsystem wiring is left out where it cannot be established.

Main entry points: [`src/app/api/orders/route.ts`](https://github.com/nareshchandu17/qwikbite/blob/main/src/app/api/orders/route.ts) (Orders API), [`src/app/api/admin/orders/route.ts`](https://github.com/nareshchandu17/qwikbite/blob/main/src/app/api/admin/orders/route.ts) (Admin orders API), [`src/lib/ai/orchestration-controller.ts`](https://github.com/nareshchandu17/qwikbite/blob/main/src/lib/ai/orchestration-controller.ts) (Intent orchestration), [`src/components/orders/OrderStatus.tsx`](https://github.com/nareshchandu17/qwikbite/blob/main/src/components/orders/OrderStatus.tsx) (Order tracking)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ordering["Student ordering"]
  node_menu_ui["Menu browsing<br/>[page.tsx]"]
  node_cart["Cart state<br/>[cartStore.ts]"]
  node_slot_ui["Slot selection<br/>[page.tsx]"]
  node_checkout["Payment checkout<br/>[StripeCheckout.tsx]"]
  node_tracking["Order tracking<br/>[OrderStatus.tsx]"]
  node_assistant_ui["Ordering assistant"]
end

subgraph group_operations["Canteen operations"]
  node_admin_orders["Live order queue"]
  node_admin_menu["Menu management<br/>[MenuManagement.tsx]"]
  node_inventory["Inventory management"]
  node_feedback["Feedback management"]
  node_analytics["Analytics dashboard"]
  node_staff["Staff management"]
end

subgraph group_backend["Application backend"]
  node_menu_api["Menu API<br/>[route.ts]"]
  node_slots_api["Slots API<br/>[route.ts]"]
  node_payment_api["Payment API<br/>[route.ts]"]
  node_orders_api["Orders API<br/>[route.ts]"]
  node_order_status_api["Order status API<br/>[route.ts]"]
  node_admin_orders_api["Admin orders API<br/>[route.ts]"]
  node_assistant_api["Assistant API<br/>[route.ts]"]
end

subgraph group_integrations["External services"]
  node_mongo[("MongoDB")]
  node_stripe["Stripe"]
  node_pusher["Pusher event bus"]
  node_openrouter["OpenRouter"]
end

subgraph group_assistant["AI assistant"]
  node_orchestrator["Intent orchestration"]
  node_intent["Intent classification"]
  node_functions["Domain actions"]
end

node_student(("Student"))
node_admin(("Kitchen staff"))

node_student -->|"browses"| node_menu_ui
node_menu_ui -->|"fetches menu"| node_menu_api
node_menu_api -->|"reads menu"| node_mongo
node_student -->|"adds items"| node_cart
node_student -->|"selects slot"| node_slot_ui
node_slot_ui -->|"loads slots"| node_slots_api
node_student -->|"checks out"| node_checkout
node_checkout -->|"creates intent"| node_payment_api
node_payment_api -->|"creates payment"| node_stripe
node_student -->|"submits order"| node_orders_api
node_orders_api -->|"writes order"| node_mongo
node_orders_api -->|"broadcasts order"| node_pusher
node_student -->|"tracks order"| node_tracking
node_tracking -->|"fetches status"| node_order_status_api
node_admin -->|"monitors queue"| node_admin_orders
node_admin_orders -->|"updates orders"| node_admin_orders_api
node_admin_orders_api -->|"reads and writes"| node_mongo
node_admin_orders_api -->|"broadcasts updates"| node_pusher
node_pusher -->|"delivers events"| node_admin_orders
node_pusher -->|"delivers status"| node_tracking
node_admin -->|"manages menu"| node_admin_menu
node_admin_menu -->|"updates menu"| node_menu_api
node_admin -->|"manages stock"| node_inventory
node_admin -->|"reviews feedback"| node_feedback
node_admin -->|"views analytics"| node_analytics
node_admin -->|"manages staff"| node_staff
node_student -->|"asks for help"| node_assistant_ui
node_assistant_ui -->|"sends request"| node_assistant_api
node_assistant_api -->|"processes request"| node_orchestrator
node_orchestrator -->|"classifies intent"| node_intent
node_orchestrator -->|"dispatches action"| node_functions
node_intent -.->|"requests AI"| node_openrouter

click node_menu_ui "https://github.com/nareshchandu17/qwikbite/blob/main/src/app/customer/menu/page.tsx"
click node_cart "https://github.com/nareshchandu17/qwikbite/blob/main/src/stores/cartStore.ts"
click node_slot_ui "https://github.com/nareshchandu17/qwikbite/blob/main/src/app/customer/slot-selection/page.tsx"
click node_checkout "https://github.com/nareshchandu17/qwikbite/blob/main/src/components/StripeCheckout.tsx"
click node_tracking "https://github.com/nareshchandu17/qwikbite/blob/main/src/components/orders/OrderStatus.tsx"
click node_menu_api "https://github.com/nareshchandu17/qwikbite/blob/main/src/app/api/menu/route.ts"
click node_slots_api "https://github.com/nareshchandu17/qwikbite/blob/main/src/app/api/slots/route.ts"
click node_payment_api "https://github.com/nareshchandu17/qwikbite/blob/main/src/app/api/payments/create-payment-intent/route.ts"
click node_orders_api "https://github.com/nareshchandu17/qwikbite/blob/main/src/app/api/orders/route.ts"
click node_order_status_api "https://github.com/nareshchandu17/qwikbite/blob/main/src/app/api/orders/%5Bid%5D/route.ts"
click node_admin_orders "https://github.com/nareshchandu17/qwikbite/blob/main/src/components/admin/LiveOrdersQueue.tsx"
click node_admin_orders_api "https://github.com/nareshchandu17/qwikbite/blob/main/src/app/api/admin/orders/route.ts"
click node_admin_menu "https://github.com/nareshchandu17/qwikbite/blob/main/src/components/admin/MenuManagement.tsx"
click node_inventory "https://github.com/nareshchandu17/qwikbite/blob/main/src/components/admin/InventoryAlerts.tsx"
click node_feedback "https://github.com/nareshchandu17/qwikbite/blob/main/src/components/admin/FeedbackConsole.tsx"
click node_analytics "https://github.com/nareshchandu17/qwikbite/blob/main/src/components/admin/AnalyticsDashboard.tsx"
click node_staff "https://github.com/nareshchandu17/qwikbite/blob/main/src/components/admin/StaffManagement.tsx"
click node_assistant_ui "https://github.com/nareshchandu17/qwikbite/blob/main/src/components/customer/QwikBiteAssistant.tsx"
click node_assistant_api "https://github.com/nareshchandu17/qwikbite/blob/main/src/app/api/assistant/route.ts"
click node_orchestrator "https://github.com/nareshchandu17/qwikbite/blob/main/src/lib/ai/orchestration-controller.ts"
click node_intent "https://github.com/nareshchandu17/qwikbite/blob/main/src/lib/ai/intent-classifier.ts"
click node_functions "https://github.com/nareshchandu17/qwikbite/blob/main/src/lib/ai/functions/function-registry.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_menu_ui,node_cart,node_slot_ui,node_checkout,node_tracking,node_assistant_ui toneBlue
class node_admin_orders,node_admin_menu,node_inventory,node_feedback,node_analytics,node_staff toneAmber
class node_menu_api,node_slots_api,node_payment_api,node_orders_api,node_order_status_api,node_admin_orders_api,node_assistant_api toneMint
class node_mongo,node_stripe,node_pusher,node_openrouter toneRose
class node_orchestrator,node_intent,node_functions,node_student,node_admin toneIndigo
```

## Components

### Student ordering

- [Menu browsing](https://github.com/nareshchandu17/qwikbite/blob/main/src/app/customer/menu/page.tsx): `src/app/customer/menu/page.tsx`
- [Cart state](https://github.com/nareshchandu17/qwikbite/blob/main/src/stores/cartStore.ts): `src/stores/cartStore.ts`
- [Slot selection](https://github.com/nareshchandu17/qwikbite/blob/main/src/app/customer/slot-selection/page.tsx): `src/app/customer/slot-selection/page.tsx`
- [Payment checkout](https://github.com/nareshchandu17/qwikbite/blob/main/src/components/StripeCheckout.tsx): `src/components/StripeCheckout.tsx`
- [Order tracking](https://github.com/nareshchandu17/qwikbite/blob/main/src/components/orders/OrderStatus.tsx): `src/components/orders/OrderStatus.tsx`
- [Ordering assistant](https://github.com/nareshchandu17/qwikbite/blob/main/src/components/customer/QwikBiteAssistant.tsx): `src/components/customer/QwikBiteAssistant.tsx`

### Canteen operations

- [Live order queue](https://github.com/nareshchandu17/qwikbite/blob/main/src/components/admin/LiveOrdersQueue.tsx): `src/components/admin/LiveOrdersQueue.tsx`
- [Menu management](https://github.com/nareshchandu17/qwikbite/blob/main/src/components/admin/MenuManagement.tsx): `src/components/admin/MenuManagement.tsx`
- [Inventory management](https://github.com/nareshchandu17/qwikbite/blob/main/src/components/admin/InventoryAlerts.tsx): `src/components/admin/InventoryAlerts.tsx`
- [Feedback management](https://github.com/nareshchandu17/qwikbite/blob/main/src/components/admin/FeedbackConsole.tsx): `src/components/admin/FeedbackConsole.tsx`
- [Analytics dashboard](https://github.com/nareshchandu17/qwikbite/blob/main/src/components/admin/AnalyticsDashboard.tsx): `src/components/admin/AnalyticsDashboard.tsx`
- [Staff management](https://github.com/nareshchandu17/qwikbite/blob/main/src/components/admin/StaffManagement.tsx): `src/components/admin/StaffManagement.tsx`

### Application backend

- [Menu API](https://github.com/nareshchandu17/qwikbite/blob/main/src/app/api/menu/route.ts): `src/app/api/menu/route.ts`
- [Slots API](https://github.com/nareshchandu17/qwikbite/blob/main/src/app/api/slots/route.ts): `src/app/api/slots/route.ts`
- [Payment API](https://github.com/nareshchandu17/qwikbite/blob/main/src/app/api/payments/create-payment-intent/route.ts): `src/app/api/payments/create-payment-intent/route.ts`
- [Orders API](https://github.com/nareshchandu17/qwikbite/blob/main/src/app/api/orders/route.ts): `src/app/api/orders/route.ts`
- [Order status API](https://github.com/nareshchandu17/qwikbite/blob/main/src/app/api/orders/%5Bid%5D/route.ts): `src/app/api/orders/[id]/route.ts`
- [Admin orders API](https://github.com/nareshchandu17/qwikbite/blob/main/src/app/api/admin/orders/route.ts): `src/app/api/admin/orders/route.ts`
- [Assistant API](https://github.com/nareshchandu17/qwikbite/blob/main/src/app/api/assistant/route.ts): `src/app/api/assistant/route.ts`

### External services

- **MongoDB**
- **Stripe**
- **Pusher event bus**
- **OpenRouter**

### AI assistant

- [Intent orchestration](https://github.com/nareshchandu17/qwikbite/blob/main/src/lib/ai/orchestration-controller.ts): `src/lib/ai/orchestration-controller.ts`
- [Intent classification](https://github.com/nareshchandu17/qwikbite/blob/main/src/lib/ai/intent-classifier.ts): `src/lib/ai/intent-classifier.ts`
- [Domain actions](https://github.com/nareshchandu17/qwikbite/blob/main/src/lib/ai/functions/function-registry.ts): `src/lib/ai/functions/function-registry.ts`

### Other components

- **Student**
- **Kitchen staff**

## Connections

- Student → Menu browsing: browses
- Menu browsing → Menu API: fetches menu
- Menu API → MongoDB: reads menu
- Student → Cart state: adds items
- Student → Slot selection: selects slot
- Slot selection → Slots API: loads slots
- Student → Payment checkout: checks out
- Payment checkout → Payment API: creates intent
- Payment API → Stripe: creates payment
- Student → Orders API: submits order
- Orders API → MongoDB: writes order
- Orders API → Pusher event bus: broadcasts order
- Student → Order tracking: tracks order
- Order tracking → Order status API: fetches status
- Kitchen staff → Live order queue: monitors queue
- Live order queue → Admin orders API: updates orders
- Admin orders API → MongoDB: reads and writes
- Admin orders API → Pusher event bus: broadcasts updates
- Pusher event bus → Live order queue: delivers events
- Pusher event bus → Order tracking: delivers status
- Kitchen staff → Menu management: manages menu
- Menu management → Menu API: updates menu
- Kitchen staff → Inventory management: manages stock
- Kitchen staff → Feedback management: reviews feedback
- Kitchen staff → Analytics dashboard: views analytics
- Kitchen staff → Staff management: manages staff
- Student → Ordering assistant: asks for help
- Ordering assistant → Assistant API: sends request
- Assistant API → Intent orchestration: processes request
- Intent orchestration → Intent classification: classifies intent
- Intent orchestration → Domain actions: dispatches action
- Intent classification → OpenRouter: requests AI
