# dharavathpavan/theankapurdhaba architecture

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

- Interactive diagram: https://gitdiagram.com/dharavathpavan/theankapurdhaba
- Repository: https://github.com/dharavathpavan/theankapurdhaba

## Overview

This is a restaurant commerce and operations app for The Ankapur Dhaba, with customer ordering, kitchen and waiter workflows, delivery operations, and administrative management. The customer journey centers on browsing the menu, building a cart, checking out, then tracking and reviewing an order; staff-facing routes cover fulfillment and business operations. The graph preserves these distinct product areas and shared API, identity, and state layers. Source excerpts are selective and there is no README, so several route-to-API relationships are documented only as unverified.

Main entry points: [`src/services/api.ts`](https://github.com/dharavathpavan/theankapurdhaba/blob/main/src/services/api.ts) (Application API), [`src/routeTree.gen.ts`](https://github.com/dharavathpavan/theankapurdhaba/blob/main/src/routeTree.gen.ts) (Route Registry), [`src/routes/index.tsx`](https://github.com/dharavathpavan/theankapurdhaba/blob/main/src/routes/index.tsx) (Menu Discovery), [`src/routes/checkout.tsx`](https://github.com/dharavathpavan/theankapurdhaba/blob/main/src/routes/checkout.tsx) (Checkout)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer["Customer Ordering"]
  node_home["Menu Discovery<br/>[index.tsx]"]
  node_menu["Menu Catalog<br/>[menu.ts]"]
  node_availability["Menu Scheduling"]
  node_cart[("Shopping Cart<br/>[cart.ts]")]
  node_checkout["Checkout<br/>[checkout.tsx]"]
  node_orders["Order Tracking<br/>[track.$orderId.tsx]"]
  node_reviews["Order Review"]
  node_addresses["Address Selection"]
  node_location["Delivery Location"]
  node_maps["Maps Services<br/>[google-maps.ts]"]
end

subgraph group_staff["Restaurant Operations"]
  node_kitchen["Kitchen Fulfillment<br/>[kitchen.tsx]"]
  node_waiter["Waiter Service<br/>[waiter.tsx]"]
  node_restaurantdelivery["Restaurant Delivery"]
  node_printing["Receipt Printing<br/>[manager.ts]"]
end

subgraph group_delivery["Delivery Operations"]
  node_deliveryapp["Rider Workflows<br/>[delivery.tsx]"]
  node_deliveryui["Delivery Views"]
end

subgraph group_admin["Administration"]
  node_admin["Business Admin<br/>[admin.users.tsx]"]
  node_adminroutes["Admin Modules"]
end

subgraph group_core["Shared App Services"]
  node_auth[("Identity State<br/>[auth.ts]")]
  node_api["Application API<br/>[api.ts]"]
  node_realtime["Realtime Updates"]
  node_activeorder[("Active Order State<br/>[active-order.ts]")]
  node_router["Route Registry<br/>[routeTree.gen.ts]"]
end

node_customer(("Customer"))
node_backend["API Backend"]
node_google["Google Maps"]
node_printerdevice["Printer Device"]

node_customer -->|"browses"| node_home
node_home -->|"shows catalog"| node_menu
node_home -->|"checks availability"| node_availability
node_customer -.->|"adds items"| node_cart
node_cart -->|"uses item data"| node_menu
node_customer -.->|"submits order"| node_checkout
node_checkout -.->|"creates order"| node_api
node_customer -.->|"sets address"| node_addresses
node_addresses -->|"resolves delivery"| node_location
node_location -->|"uses maps"| node_maps
node_customer -.->|"tracks order"| node_orders
node_orders -.->|"loads order"| node_api
node_customer -.->|"rates order"| node_reviews
node_reviews -->|"loads order"| node_api
node_kitchen -.->|"manages tickets"| node_api
node_waiter -.->|"manages service"| node_api
node_restaurantdelivery -.->|"manages dispatch"| node_api
node_printing -->|"sends print job"| node_printerdevice
node_deliveryapp -.->|"uses views"| node_deliveryui
node_deliveryapp -.->|"updates deliveries"| node_api
node_admin -.->|"provides operations"| node_adminroutes
node_adminroutes -.->|"manages business data"| node_api
node_api -->|"sends API requests"| node_backend
node_api -->|"reads session"| node_auth
node_auth -->|"restores session"| node_backend
node_realtime -->|"subscribes updates"| node_api
node_activeorder -->|"loads order"| node_api
node_router -->|"registers route"| node_home
node_router -->|"registers route"| node_checkout
node_router -->|"registers route"| node_kitchen
node_router -->|"registers route"| node_waiter
node_router -->|"registers route"| node_orders
node_maps -->|"requests map data"| node_google

click node_home "https://github.com/dharavathpavan/theankapurdhaba/blob/main/src/routes/index.tsx"
click node_menu "https://github.com/dharavathpavan/theankapurdhaba/blob/main/src/data/menu.ts"
click node_availability "https://github.com/dharavathpavan/theankapurdhaba/blob/main/src/lib/menu-availability.ts"
click node_cart "https://github.com/dharavathpavan/theankapurdhaba/blob/main/src/stores/cart.ts"
click node_checkout "https://github.com/dharavathpavan/theankapurdhaba/blob/main/src/routes/checkout.tsx"
click node_orders "https://github.com/dharavathpavan/theankapurdhaba/blob/main/src/routes/track.%24orderId.tsx"
click node_reviews "https://github.com/dharavathpavan/theankapurdhaba/blob/main/src/routes/review.%24orderId.tsx"
click node_addresses "https://github.com/dharavathpavan/theankapurdhaba/blob/main/src/components/site/AddressBottomSheet.tsx"
click node_location "https://github.com/dharavathpavan/theankapurdhaba/blob/main/src/lib/delivery-location.ts"
click node_maps "https://github.com/dharavathpavan/theankapurdhaba/blob/main/src/lib/google-maps.ts"
click node_kitchen "https://github.com/dharavathpavan/theankapurdhaba/blob/main/src/routes/kitchen.tsx"
click node_waiter "https://github.com/dharavathpavan/theankapurdhaba/blob/main/src/routes/waiter.tsx"
click node_restaurantdelivery "https://github.com/dharavathpavan/theankapurdhaba/blob/main/src/routes/restaurant.delivery.tsx"
click node_printing "https://github.com/dharavathpavan/theankapurdhaba/blob/main/src/lib/printer/manager.ts"
click node_deliveryapp "https://github.com/dharavathpavan/theankapurdhaba/blob/main/src/routes/delivery.tsx"
click node_deliveryui "https://github.com/dharavathpavan/theankapurdhaba/tree/main/src/components/delivery"
click node_admin "https://github.com/dharavathpavan/theankapurdhaba/blob/main/src/routes/admin.users.tsx"
click node_adminroutes "https://github.com/dharavathpavan/theankapurdhaba/tree/main/src/routes"
click node_auth "https://github.com/dharavathpavan/theankapurdhaba/blob/main/src/stores/auth.ts"
click node_api "https://github.com/dharavathpavan/theankapurdhaba/blob/main/src/services/api.ts"
click node_realtime "https://github.com/dharavathpavan/theankapurdhaba/blob/main/src/hooks/use-order-realtime.ts"
click node_activeorder "https://github.com/dharavathpavan/theankapurdhaba/blob/main/src/stores/active-order.ts"
click node_router "https://github.com/dharavathpavan/theankapurdhaba/blob/main/src/routeTree.gen.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_home,node_menu,node_availability,node_cart,node_checkout,node_orders,node_reviews,node_addresses,node_location,node_maps toneBlue
class node_kitchen,node_waiter,node_restaurantdelivery,node_printing toneAmber
class node_deliveryapp,node_deliveryui,node_backend toneMint
class node_admin,node_adminroutes toneRose
class node_auth,node_api,node_realtime,node_activeorder,node_router,node_customer,node_google,node_printerdevice toneIndigo
```

## Components

### Customer Ordering

- [Menu Discovery](https://github.com/dharavathpavan/theankapurdhaba/blob/main/src/routes/index.tsx): `src/routes/index.tsx`
- [Menu Catalog](https://github.com/dharavathpavan/theankapurdhaba/blob/main/src/data/menu.ts): `src/data/menu.ts`
- [Menu Scheduling](https://github.com/dharavathpavan/theankapurdhaba/blob/main/src/lib/menu-availability.ts): `src/lib/menu-availability.ts`
- [Shopping Cart](https://github.com/dharavathpavan/theankapurdhaba/blob/main/src/stores/cart.ts): `src/stores/cart.ts`
- [Checkout](https://github.com/dharavathpavan/theankapurdhaba/blob/main/src/routes/checkout.tsx): `src/routes/checkout.tsx`
- [Order Tracking](https://github.com/dharavathpavan/theankapurdhaba/blob/main/src/routes/track.%24orderId.tsx): `src/routes/track.$orderId.tsx`
- [Order Review](https://github.com/dharavathpavan/theankapurdhaba/blob/main/src/routes/review.%24orderId.tsx): `src/routes/review.$orderId.tsx`
- [Address Selection](https://github.com/dharavathpavan/theankapurdhaba/blob/main/src/components/site/AddressBottomSheet.tsx): `src/components/site/AddressBottomSheet.tsx`
- [Delivery Location](https://github.com/dharavathpavan/theankapurdhaba/blob/main/src/lib/delivery-location.ts): `src/lib/delivery-location.ts`
- [Maps Services](https://github.com/dharavathpavan/theankapurdhaba/blob/main/src/lib/google-maps.ts): `src/lib/google-maps.ts`

### Restaurant Operations

- [Kitchen Fulfillment](https://github.com/dharavathpavan/theankapurdhaba/blob/main/src/routes/kitchen.tsx): `src/routes/kitchen.tsx`
- [Waiter Service](https://github.com/dharavathpavan/theankapurdhaba/blob/main/src/routes/waiter.tsx): `src/routes/waiter.tsx`
- [Restaurant Delivery](https://github.com/dharavathpavan/theankapurdhaba/blob/main/src/routes/restaurant.delivery.tsx): `src/routes/restaurant.delivery.tsx`
- [Receipt Printing](https://github.com/dharavathpavan/theankapurdhaba/blob/main/src/lib/printer/manager.ts): `src/lib/printer/manager.ts`

### Delivery Operations

- [Rider Workflows](https://github.com/dharavathpavan/theankapurdhaba/blob/main/src/routes/delivery.tsx): `src/routes/delivery.tsx`
- [Delivery Views](https://github.com/dharavathpavan/theankapurdhaba/tree/main/src/components/delivery): `src/components/delivery`

### Administration

- [Business Admin](https://github.com/dharavathpavan/theankapurdhaba/blob/main/src/routes/admin.users.tsx): `src/routes/admin.users.tsx`
- [Admin Modules](https://github.com/dharavathpavan/theankapurdhaba/tree/main/src/routes): `src/routes`

### Shared App Services

- [Identity State](https://github.com/dharavathpavan/theankapurdhaba/blob/main/src/stores/auth.ts): `src/stores/auth.ts`
- [Application API](https://github.com/dharavathpavan/theankapurdhaba/blob/main/src/services/api.ts): `src/services/api.ts`
- [Realtime Updates](https://github.com/dharavathpavan/theankapurdhaba/blob/main/src/hooks/use-order-realtime.ts): `src/hooks/use-order-realtime.ts`
- [Active Order State](https://github.com/dharavathpavan/theankapurdhaba/blob/main/src/stores/active-order.ts): `src/stores/active-order.ts`
- [Route Registry](https://github.com/dharavathpavan/theankapurdhaba/blob/main/src/routeTree.gen.ts): `src/routeTree.gen.ts`

### Other components

- **Customer**
- **API Backend**
- **Google Maps**
- **Printer Device**

## Connections

- Customer → Menu Discovery: browses (evidence: `src/routes/index.tsx`)
- Menu Discovery → Menu Catalog: shows catalog (evidence: `src/routes/index.tsx`)
- Menu Discovery → Menu Scheduling: checks availability (evidence: `src/routes/index.tsx`)
- Customer → Shopping Cart: adds items
- Shopping Cart → Menu Catalog: uses item data (evidence: `src/stores/cart.ts`)
- Customer → Checkout: submits order
- Checkout → Application API: creates order
- Customer → Address Selection: sets address
- Address Selection → Delivery Location: resolves delivery (evidence: `src/components/site/AddressBottomSheet.tsx`)
- Delivery Location → Maps Services: uses maps (evidence: `src/lib/delivery-location.ts`)
- Customer → Order Tracking: tracks order
- Order Tracking → Application API: loads order
- Customer → Order Review: rates order
- Order Review → Application API: loads order (evidence: `src/routes/review.$orderId.tsx`)
- Kitchen Fulfillment → Application API: manages tickets
- Waiter Service → Application API: manages service
- Restaurant Delivery → Application API: manages dispatch
- Receipt Printing → Printer Device: sends print job (evidence: `src/lib/printer/manager.ts`)
- Rider Workflows → Delivery Views: uses views
- Rider Workflows → Application API: updates deliveries
- Business Admin → Admin Modules: provides operations
- Admin Modules → Application API: manages business data (evidence: `src/routes/index.tsx`)
- Application API → API Backend: sends API requests (evidence: `src/services/api.ts`)
- Application API → Identity State: reads session (evidence: `src/services/api.ts`)
- Identity State → API Backend: restores session (evidence: `src/stores/auth.ts`)
- Realtime Updates → Application API: subscribes updates (evidence: `src/hooks/use-order-realtime.ts`)
- Active Order State → Application API: loads order (evidence: `src/stores/active-order.ts`)
- Route Registry → Menu Discovery: registers route (evidence: `src/routeTree.gen.ts`)
- Route Registry → Checkout: registers route (evidence: `src/routeTree.gen.ts`)
- Route Registry → Kitchen Fulfillment: registers route (evidence: `src/routeTree.gen.ts`)
- Route Registry → Waiter Service: registers route (evidence: `src/routeTree.gen.ts`)
- Route Registry → Order Tracking: registers route (evidence: `src/routeTree.gen.ts`)
- Maps Services → Google Maps: requests map data (evidence: `src/lib/google-maps.ts`)
