# snehitdesu/aharoas architecture

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

- Interactive diagram: https://gitdiagram.com/snehitdesu/aharoas
- Repository: https://github.com/snehitdesu/aharoas

## Overview

RESTORA is restaurant operations software spanning web and Windows desktop, with POS, QR ordering, kitchen workflows, back-office administration, and operational reporting. The principal flow is an operator or guest using a web interface, which sends requests through API routes and shared request handling to domain services and persistent data. The README documents the major product capabilities and deployment stores; the graph preserves those branches. Some links are based on README-level documentation because their implementation was not sampled.

Main entry points: [`src/app/api/orders/[[...path]]/route.ts`](https://github.com/snehitdesu/aharoas/blob/main/src/app/api/orders/%5B%5B...path%5D%5D/route.ts) (Domain API routes), [`src/server/services/orders.ts`](https://github.com/snehitdesu/aharoas/blob/main/src/server/services/orders.ts) (POS and orders), [`src/integrations/payment/index.ts`](https://github.com/snehitdesu/aharoas/blob/main/src/integrations/payment/index.ts) (External integrations), [`src/server/db/client.ts`](https://github.com/snehitdesu/aharoas/blob/main/src/server/db/client.ts) (Application database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_operator_ui["Operator UI<br/>[page.tsx]"]
  node_guest_ui["QR ordering<br/>[page.tsx]"]
  node_mobile_ui["Captain and manager apps<br/>[CaptainApp.tsx]"]
end

subgraph group_core["Operations workflows"]
  node_order_service["POS and orders<br/>[orders.ts]"]
  node_guest_ordering["Guest order service<br/>[guestOrdering.ts]"]
  node_kitchen["Kitchen tickets and display<br/>[kot.ts]"]
  node_billing["Payments and invoices<br/>[payment.ts]"]
  node_inventory["Inventory and production<br/>[inventory.ts]"]
  node_procurement["Procurement<br/>[procurement.ts]"]
  node_finance["Finance and reconciliation<br/>[finance.ts]"]
  node_analytics["Analytics and reports<br/>[analytics.ts]"]
end

subgraph group_platform["Platform services"]
  node_web_api["Domain API routes<br/>[route.ts]"]
  node_request_router["Request router<br/>[router.ts]"]
  node_auth["Authentication and access<br/>[rbac.ts]"]
  node_integrations{{"External integrations<br/>[index.ts]"}}
  node_database[("Application database<br/>[client.ts]")]
end

subgraph group_desktop["Desktop runtime"]
  node_desktop_app["Windows desktop app<br/>[main.ts]"]
  node_desktop_storage[("Embedded SQLite runtime<br/>[dbtool.ts]")]
end

node_operator(("Restaurant operator"))
node_guest(("Restaurant guest"))

node_operator -->|"uses"| node_operator_ui
node_guest -->|"places orders"| node_guest_ui
node_operator -->|"uses"| node_mobile_ui
node_operator_ui -.->|"requests operations"| node_web_api
node_guest_ui -.->|"submits orders"| node_web_api
node_mobile_ui -->|"requests operations"| node_web_api
node_web_api -->|"routes requests"| node_request_router
node_request_router -->|"checks access"| node_auth
node_web_api -->|"calls order actions"| node_order_service
node_web_api -.->|"handles guest orders"| node_guest_ordering
node_order_service -->|"creates kitchen tickets"| node_kitchen
node_order_service -.->|"supports payment"| node_billing
node_order_service -.->|"persists orders"| node_database
node_guest_ordering -.->|"persists guest orders"| node_database
node_web_api -->|"routes inventory actions"| node_inventory
node_web_api -->|"routes procurement actions"| node_procurement
node_web_api -->|"routes finance actions"| node_finance
node_web_api -->|"routes analytics"| node_analytics
node_finance -.->|"reconciles payments"| node_integrations
node_billing -.->|"uses payment gateway"| node_integrations
node_integrations -.->|"records integration state"| node_database
node_operator -->|"uses"| node_desktop_app
node_desktop_app -->|"uses embedded database"| node_desktop_storage

click node_operator_ui "https://github.com/snehitdesu/aharoas/blob/main/src/app/(app)/dashboard/page.tsx"
click node_guest_ui "https://github.com/snehitdesu/aharoas/blob/main/src/app/t/%5Btoken%5D/page.tsx"
click node_mobile_ui "https://github.com/snehitdesu/aharoas/blob/main/src/features/mobile/CaptainApp.tsx"
click node_web_api "https://github.com/snehitdesu/aharoas/blob/main/src/app/api/orders/%5B%5B...path%5D%5D/route.ts"
click node_request_router "https://github.com/snehitdesu/aharoas/blob/main/src/server/api/router.ts"
click node_auth "https://github.com/snehitdesu/aharoas/blob/main/src/server/auth/rbac.ts"
click node_order_service "https://github.com/snehitdesu/aharoas/blob/main/src/server/services/orders.ts"
click node_guest_ordering "https://github.com/snehitdesu/aharoas/blob/main/src/server/services/guestOrdering.ts"
click node_kitchen "https://github.com/snehitdesu/aharoas/blob/main/src/server/services/kot.ts"
click node_billing "https://github.com/snehitdesu/aharoas/blob/main/src/server/services/payment.ts"
click node_inventory "https://github.com/snehitdesu/aharoas/blob/main/src/server/services/inventory.ts"
click node_procurement "https://github.com/snehitdesu/aharoas/blob/main/src/server/services/procurement.ts"
click node_finance "https://github.com/snehitdesu/aharoas/blob/main/src/server/services/finance.ts"
click node_analytics "https://github.com/snehitdesu/aharoas/blob/main/src/server/services/analytics.ts"
click node_integrations "https://github.com/snehitdesu/aharoas/blob/main/src/integrations/payment/index.ts"
click node_database "https://github.com/snehitdesu/aharoas/blob/main/src/server/db/client.ts"
click node_desktop_app "https://github.com/snehitdesu/aharoas/blob/main/desktop/main/main.ts"
click node_desktop_storage "https://github.com/snehitdesu/aharoas/blob/main/desktop/runtime/dbtool.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_operator_ui,node_guest_ui,node_mobile_ui toneBlue
class node_order_service,node_guest_ordering,node_kitchen,node_billing,node_inventory,node_procurement,node_finance,node_analytics toneAmber
class node_web_api,node_request_router,node_auth,node_integrations,node_database toneMint
class node_desktop_app,node_desktop_storage toneRose
class node_operator,node_guest toneIndigo
```

## Components

### Web experience

- [Operator UI](https://github.com/snehitdesu/aharoas/blob/main/src/app/(app)/dashboard/page.tsx): `src/app/(app)/dashboard/page.tsx`
- [QR ordering](https://github.com/snehitdesu/aharoas/blob/main/src/app/t/%5Btoken%5D/page.tsx): `src/app/t/[token]/page.tsx`
- [Captain and manager apps](https://github.com/snehitdesu/aharoas/blob/main/src/features/mobile/CaptainApp.tsx): `src/features/mobile/CaptainApp.tsx`

### Operations workflows

- [POS and orders](https://github.com/snehitdesu/aharoas/blob/main/src/server/services/orders.ts): `src/server/services/orders.ts`
- [Guest order service](https://github.com/snehitdesu/aharoas/blob/main/src/server/services/guestOrdering.ts): `src/server/services/guestOrdering.ts`
- [Kitchen tickets and display](https://github.com/snehitdesu/aharoas/blob/main/src/server/services/kot.ts): `src/server/services/kot.ts`
- [Payments and invoices](https://github.com/snehitdesu/aharoas/blob/main/src/server/services/payment.ts): `src/server/services/payment.ts`
- [Inventory and production](https://github.com/snehitdesu/aharoas/blob/main/src/server/services/inventory.ts): `src/server/services/inventory.ts`
- [Procurement](https://github.com/snehitdesu/aharoas/blob/main/src/server/services/procurement.ts): `src/server/services/procurement.ts`
- [Finance and reconciliation](https://github.com/snehitdesu/aharoas/blob/main/src/server/services/finance.ts): `src/server/services/finance.ts`
- [Analytics and reports](https://github.com/snehitdesu/aharoas/blob/main/src/server/services/analytics.ts): `src/server/services/analytics.ts`

### Platform services

- [Domain API routes](https://github.com/snehitdesu/aharoas/blob/main/src/app/api/orders/%5B%5B...path%5D%5D/route.ts): `src/app/api/orders/[[...path]]/route.ts`
- [Request router](https://github.com/snehitdesu/aharoas/blob/main/src/server/api/router.ts): `src/server/api/router.ts`
- [Authentication and access](https://github.com/snehitdesu/aharoas/blob/main/src/server/auth/rbac.ts): `src/server/auth/rbac.ts`
- [External integrations](https://github.com/snehitdesu/aharoas/blob/main/src/integrations/payment/index.ts): `src/integrations/payment/index.ts`
- [Application database](https://github.com/snehitdesu/aharoas/blob/main/src/server/db/client.ts): `src/server/db/client.ts`

### Desktop runtime

- [Windows desktop app](https://github.com/snehitdesu/aharoas/blob/main/desktop/main/main.ts): `desktop/main/main.ts`
- [Embedded SQLite runtime](https://github.com/snehitdesu/aharoas/blob/main/desktop/runtime/dbtool.ts): `desktop/runtime/dbtool.ts`

### Other components

- **Restaurant operator**
- **Restaurant guest**

## Connections

- Restaurant operator → Operator UI: uses
- Restaurant guest → QR ordering: places orders
- Restaurant operator → Captain and manager apps: uses
- Operator UI → Domain API routes: requests operations
- QR ordering → Domain API routes: submits orders
- Captain and manager apps → Domain API routes: requests operations
- Domain API routes → Request router: routes requests (evidence: `src/app/api/orders/[[...path]]/route.ts`)
- Request router → Authentication and access: checks access (evidence: `src/server/api/router.ts`)
- Domain API routes → POS and orders: calls order actions (evidence: `src/app/api/orders/[[...path]]/route.ts`)
- Domain API routes → Guest order service: handles guest orders
- POS and orders → Kitchen tickets and display: creates kitchen tickets
- POS and orders → Payments and invoices: supports payment
- POS and orders → Application database: persists orders
- Guest order service → Application database: persists guest orders
- Domain API routes → Inventory and production: routes inventory actions
- Domain API routes → Procurement: routes procurement actions
- Domain API routes → Finance and reconciliation: routes finance actions
- Domain API routes → Analytics and reports: routes analytics
- Finance and reconciliation → External integrations: reconciles payments
- Payments and invoices → External integrations: uses payment gateway
- External integrations → Application database: records integration state
- Restaurant operator → Windows desktop app: uses
- Windows desktop app → Embedded SQLite runtime: uses embedded database
