# avishekkarn/venue-platform architecture

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

- Interactive diagram: https://gitdiagram.com/avishekkarn/venue-platform
- Repository: https://github.com/avishekkarn/venue-platform

## Overview

This is a QR-enabled hospitality platform for venue guests and staff. A guest scans a place QR code to resolve the venue and table, room, or counter, then can browse the menu, place and track orders, and request services; staff and kitchen users manage fulfillment, while administrators configure venue operations. The graph emphasizes these domain stages and the shared domain-to-storage layer. Several screens and API families are present in the tree but were not sampled, so their links are omitted rather than inferred.

Main entry points: [`app/api/guest/orders/route.ts`](https://github.com/avishekkarn/venue-platform/blob/main/app/api/guest/orders/route.ts) (Guest orders API), [`app/api/admin/dashboard/route.ts`](https://github.com/avishekkarn/venue-platform/blob/main/app/api/admin/dashboard/route.ts) (Dashboard metrics), [`src/infrastructure/db/client.ts`](https://github.com/avishekkarn/venue-platform/blob/main/src/infrastructure/db/client.ts) (PostgreSQL client), [`app/api/staff/requests/route.ts`](https://github.com/avishekkarn/venue-platform/blob/main/app/api/staff/requests/route.ts) (Staff requests API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_guest["Guest experience"]
  node_qr["QR resolution<br/>[route.ts]"]
  node_menu_ui["Menu browsing<br/>[page.tsx]"]
  node_cart["Cart and checkout<br/>[page.tsx]"]
  node_guest_order_api["Guest orders API<br/>[route.ts]"]
  node_tracking["Order tracking<br/>[page.tsx]"]
  node_service_ui["Guest services<br/>[page.tsx]"]
end

subgraph group_operations["Staff operations"]
  node_request_api["Staff requests API<br/>[route.ts]"]
  node_staff_ops["Staff console<br/>[page.tsx]"]
  node_kitchen_ops["Kitchen console<br/>[page.tsx]"]
end

subgraph group_admin["Venue administration"]
  node_admin["Admin console<br/>[page.tsx]"]
  node_admin_orders["Order management<br/>[route.ts]"]
  node_dashboard_api["Dashboard metrics<br/>[route.ts]"]
end

subgraph group_domain["Domain services"]
  node_guest_session["Guest session"]
  node_order_logic["Order creation<br/>[create-order.ts]"]
  node_order_domain["Order model"]
  node_request_domain["Service requests"]
  node_access["Role access<br/>[can-access.ts]"]
end

subgraph group_infra["Infrastructure"]
  node_order_storage[("Order storage<br/>[order.repo.ts]")]
  node_request_storage[("Request storage<br/>[request.repo.ts]")]
  node_room_storage[("Room data<br/>[room.repo.ts]")]
  node_table_storage[("Table data<br/>[table.repo.ts]")]
  node_venue_storage[("Venue data")]
  node_database[("PostgreSQL client<br/>[client.ts]")]
end

node_guest(("Guest"))

node_guest -->|"scans code"| node_qr
node_qr -->|"resolves session"| node_guest_session
node_guest -->|"browses menu"| node_menu_ui
node_guest -->|"builds order"| node_cart
node_cart -->|"submits order"| node_guest_order_api
node_guest_order_api -->|"creates order"| node_order_logic
node_guest_order_api -->|"uses order port"| node_order_domain
node_guest_order_api -->|"creates repository"| node_order_storage
node_guest_order_api -->|"validates session"| node_guest_session
node_guest -->|"tracks order"| node_tracking
node_guest -->|"requests service"| node_service_ui
node_staff_ops -.->|"manages requests"| node_request_api
node_request_api -->|"uses request port"| node_request_domain
node_request_api -.->|"creates repository"| node_request_storage
node_staff_ops -->|"fulfills orders"| node_kitchen_ops
node_admin -->|"manages orders"| node_admin_orders
node_admin_orders -->|"checks access"| node_access
node_admin_orders -->|"uses order port"| node_order_domain
node_admin -->|"views metrics"| node_dashboard_api
node_dashboard_api -->|"checks access"| node_access
node_dashboard_api -->|"reads rooms"| node_room_storage
node_dashboard_api -->|"reads tables"| node_table_storage
node_dashboard_api -->|"reads venue"| node_venue_storage
node_order_storage -.->|"queries database"| node_database
node_request_storage -.->|"queries database"| node_database
node_room_storage -.->|"queries database"| node_database
node_table_storage -.->|"queries database"| node_database
node_venue_storage -->|"queries database"| node_database

click node_qr "https://github.com/avishekkarn/venue-platform/blob/main/app/(guest)/qr/%5Btoken%5D/route.ts"
click node_guest_session "https://github.com/avishekkarn/venue-platform/blob/main/src/domain/guest/guest-session.service.ts"
click node_menu_ui "https://github.com/avishekkarn/venue-platform/blob/main/app/(guest)/menu/page.tsx"
click node_cart "https://github.com/avishekkarn/venue-platform/blob/main/app/(guest)/cart/page.tsx"
click node_guest_order_api "https://github.com/avishekkarn/venue-platform/blob/main/app/api/guest/orders/route.ts"
click node_order_logic "https://github.com/avishekkarn/venue-platform/blob/main/src/domain/orders/create-order.ts"
click node_order_domain "https://github.com/avishekkarn/venue-platform/blob/main/src/domain/orders/order.repository.ts"
click node_order_storage "https://github.com/avishekkarn/venue-platform/blob/main/src/infrastructure/db/repositories/order.repo.ts"
click node_tracking "https://github.com/avishekkarn/venue-platform/blob/main/app/(guest)/order/%5Bid%5D/track/page.tsx"
click node_service_ui "https://github.com/avishekkarn/venue-platform/blob/main/app/(guest)/services/page.tsx"
click node_request_api "https://github.com/avishekkarn/venue-platform/blob/main/app/api/staff/requests/route.ts"
click node_request_domain "https://github.com/avishekkarn/venue-platform/blob/main/src/domain/requests/request.repository.ts"
click node_request_storage "https://github.com/avishekkarn/venue-platform/blob/main/src/infrastructure/db/repositories/request.repo.ts"
click node_staff_ops "https://github.com/avishekkarn/venue-platform/blob/main/app/staff/page.tsx"
click node_kitchen_ops "https://github.com/avishekkarn/venue-platform/blob/main/app/kitchen/page.tsx"
click node_admin "https://github.com/avishekkarn/venue-platform/blob/main/app/admin/(shell)/page.tsx"
click node_admin_orders "https://github.com/avishekkarn/venue-platform/blob/main/app/api/admin/orders/route.ts"
click node_dashboard_api "https://github.com/avishekkarn/venue-platform/blob/main/app/api/admin/dashboard/route.ts"
click node_access "https://github.com/avishekkarn/venue-platform/blob/main/src/domain/auth/can-access.ts"
click node_room_storage "https://github.com/avishekkarn/venue-platform/blob/main/src/infrastructure/db/repositories/room.repo.ts"
click node_table_storage "https://github.com/avishekkarn/venue-platform/blob/main/src/infrastructure/db/repositories/table.repo.ts"
click node_venue_storage "https://github.com/avishekkarn/venue-platform/blob/main/src/infrastructure/db/repositories/organization.repo.ts"
click node_database "https://github.com/avishekkarn/venue-platform/blob/main/src/infrastructure/db/client.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_qr,node_menu_ui,node_cart,node_guest_order_api,node_tracking,node_service_ui toneBlue
class node_request_api,node_staff_ops,node_kitchen_ops toneAmber
class node_admin,node_admin_orders,node_dashboard_api toneMint
class node_guest_session,node_order_logic,node_order_domain,node_request_domain,node_access toneRose
class node_order_storage,node_request_storage,node_room_storage,node_table_storage,node_venue_storage,node_database,node_guest toneIndigo
```

## Components

### Guest experience

- [QR resolution](https://github.com/avishekkarn/venue-platform/blob/main/app/(guest)/qr/%5Btoken%5D/route.ts): `app/(guest)/qr/[token]/route.ts`
- [Menu browsing](https://github.com/avishekkarn/venue-platform/blob/main/app/(guest)/menu/page.tsx): `app/(guest)/menu/page.tsx`
- [Cart and checkout](https://github.com/avishekkarn/venue-platform/blob/main/app/(guest)/cart/page.tsx): `app/(guest)/cart/page.tsx`
- [Guest orders API](https://github.com/avishekkarn/venue-platform/blob/main/app/api/guest/orders/route.ts): `app/api/guest/orders/route.ts`
- [Order tracking](https://github.com/avishekkarn/venue-platform/blob/main/app/(guest)/order/%5Bid%5D/track/page.tsx): `app/(guest)/order/[id]/track/page.tsx`
- [Guest services](https://github.com/avishekkarn/venue-platform/blob/main/app/(guest)/services/page.tsx): `app/(guest)/services/page.tsx`

### Staff operations

- [Staff requests API](https://github.com/avishekkarn/venue-platform/blob/main/app/api/staff/requests/route.ts): `app/api/staff/requests/route.ts`
- [Staff console](https://github.com/avishekkarn/venue-platform/blob/main/app/staff/page.tsx): `app/staff/page.tsx`
- [Kitchen console](https://github.com/avishekkarn/venue-platform/blob/main/app/kitchen/page.tsx): `app/kitchen/page.tsx`

### Venue administration

- [Admin console](https://github.com/avishekkarn/venue-platform/blob/main/app/admin/(shell)/page.tsx): `app/admin/(shell)/page.tsx`
- [Order management](https://github.com/avishekkarn/venue-platform/blob/main/app/api/admin/orders/route.ts): `app/api/admin/orders/route.ts`
- [Dashboard metrics](https://github.com/avishekkarn/venue-platform/blob/main/app/api/admin/dashboard/route.ts): `app/api/admin/dashboard/route.ts`

### Domain services

- [Guest session](https://github.com/avishekkarn/venue-platform/blob/main/src/domain/guest/guest-session.service.ts): `src/domain/guest/guest-session.service.ts`
- [Order creation](https://github.com/avishekkarn/venue-platform/blob/main/src/domain/orders/create-order.ts): `src/domain/orders/create-order.ts`
- [Order model](https://github.com/avishekkarn/venue-platform/blob/main/src/domain/orders/order.repository.ts): `src/domain/orders/order.repository.ts`
- [Service requests](https://github.com/avishekkarn/venue-platform/blob/main/src/domain/requests/request.repository.ts): `src/domain/requests/request.repository.ts`
- [Role access](https://github.com/avishekkarn/venue-platform/blob/main/src/domain/auth/can-access.ts): `src/domain/auth/can-access.ts`

### Infrastructure

- [Order storage](https://github.com/avishekkarn/venue-platform/blob/main/src/infrastructure/db/repositories/order.repo.ts): `src/infrastructure/db/repositories/order.repo.ts`
- [Request storage](https://github.com/avishekkarn/venue-platform/blob/main/src/infrastructure/db/repositories/request.repo.ts): `src/infrastructure/db/repositories/request.repo.ts`
- [Room data](https://github.com/avishekkarn/venue-platform/blob/main/src/infrastructure/db/repositories/room.repo.ts): `src/infrastructure/db/repositories/room.repo.ts`
- [Table data](https://github.com/avishekkarn/venue-platform/blob/main/src/infrastructure/db/repositories/table.repo.ts): `src/infrastructure/db/repositories/table.repo.ts`
- [Venue data](https://github.com/avishekkarn/venue-platform/blob/main/src/infrastructure/db/repositories/organization.repo.ts): `src/infrastructure/db/repositories/organization.repo.ts`
- [PostgreSQL client](https://github.com/avishekkarn/venue-platform/blob/main/src/infrastructure/db/client.ts): `src/infrastructure/db/client.ts`

### Other components

- **Guest**

## Connections

- Guest → QR resolution: scans code (evidence: `app/(guest)/qr/[token]/route.ts`)
- QR resolution → Guest session: resolves session (evidence: `app/(guest)/qr/[token]/route.ts`)
- Guest → Menu browsing: browses menu
- Guest → Cart and checkout: builds order
- Cart and checkout → Guest orders API: submits order
- Guest orders API → Order creation: creates order (evidence: `app/api/guest/orders/route.ts`)
- Guest orders API → Order model: uses order port (evidence: `app/api/guest/orders/route.ts`)
- Guest orders API → Order storage: creates repository (evidence: `app/api/guest/orders/route.ts`)
- Guest orders API → Guest session: validates session (evidence: `app/api/guest/orders/route.ts`)
- Guest → Order tracking: tracks order
- Guest → Guest services: requests service
- Staff console → Staff requests API: manages requests
- Staff requests API → Service requests: uses request port (evidence: `app/api/staff/requests/route.ts`)
- Staff requests API → Request storage: creates repository (evidence: `app/api/staff/requests/route.ts`)
- Staff console → Kitchen console: fulfills orders
- Admin console → Order management: manages orders (evidence: `app/admin/(shell)/page.tsx`)
- Order management → Role access: checks access (evidence: `app/api/admin/orders/route.ts`)
- Order management → Order model: uses order port (evidence: `app/api/admin/orders/route.ts`)
- Admin console → Dashboard metrics: views metrics (evidence: `app/admin/(shell)/page.tsx`)
- Dashboard metrics → Role access: checks access (evidence: `app/api/admin/dashboard/route.ts`)
- Dashboard metrics → Room data: reads rooms (evidence: `app/api/admin/dashboard/route.ts`)
- Dashboard metrics → Table data: reads tables (evidence: `app/api/admin/dashboard/route.ts`)
- Dashboard metrics → Venue data: reads venue (evidence: `app/api/admin/dashboard/route.ts`)
- Order storage → PostgreSQL client: queries database
- Request storage → PostgreSQL client: queries database
- Room data → PostgreSQL client: queries database (evidence: `src/infrastructure/db/repositories/room.repo.ts`)
- Table data → PostgreSQL client: queries database (evidence: `src/infrastructure/db/repositories/table.repo.ts`)
- Venue data → PostgreSQL client: queries database (evidence: `src/infrastructure/db/repositories/organization.repo.ts`)
