# mighty840/kitchenasty architecture

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

- Interactive diagram: https://gitdiagram.com/mighty840/kitchenasty
- Repository: https://github.com/mighty840/kitchenasty

## Overview

KitchenAsty is a self-hosted restaurant platform spanning customer ordering and reservations, staff operations, and restaurant administration. Customers browse menus, place orders, track order status, and book tables through the storefront or mobile app; staff manage orders and reservations, while managers configure menus, settings, and promotions. The server exposes the REST API and persists operational data, with documented real-time updates and payment integrations. The graph combines sampled wiring with README capabilities; several domain implementations and client API calls were not sampled, so their internal links are not expanded.

Main entry points: [`packages/server/src/app.ts`](https://github.com/mighty840/kitchenasty/blob/main/packages/server/src/app.ts) (API Application), [`packages/server/src/controllers/order.controller.ts`](https://github.com/mighty840/kitchenasty/blob/main/packages/server/src/controllers/order.controller.ts) (Order Processing), [`packages/server/src/controllers/review.controller.ts`](https://github.com/mighty840/kitchenasty/blob/main/packages/server/src/controllers/review.controller.ts) (Review Moderation), [`packages/server/src/controllers/settings.controller.ts`](https://github.com/mighty840/kitchenasty/blob/main/packages/server/src/controllers/settings.controller.ts) (Restaurant Settings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer["Customer Apps"]
  node_storefront["Web Storefront<br/>[main.tsx]"]
  node_mobile["Mobile App<br/>[index.tsx]"]
  node_mobileauth["Mobile Auth State<br/>[auth.store.ts]"]
  node_mobilepush["Push Notifications"]
end

subgraph group_admin["Admin Console"]
  node_adminui["Admin Console<br/>[main.tsx]"]
  node_menupages["Menu Management<br/>[MenuItemList.tsx]"]
  node_orderpages["Order &amp; Kitchen Views<br/>[OrderList.tsx]"]
  node_reservationpages["Reservations"]
  node_settingspages["Configuration Views<br/>[Settings.tsx]"]
  node_reviewpages["Review Management<br/>[ReviewList.tsx]"]
  node_design["Storefront Design<br/>[DesignLanding.tsx]"]
end

subgraph group_api["REST API"]
  node_server["API Application<br/>[app.ts]"]
  node_menuroutes["Menu Routes<br/>[menu.routes.ts]"]
  node_reviewroutes["Review Routes<br/>[review.routes.ts]"]
  node_settingroutes["Settings Routes<br/>[settings.routes.ts]"]
  node_reservations["Reservation Services"]
  node_coupons["Coupon Services<br/>[coupon.routes.ts]"]
  node_automation["Automation Rules"]
  node_staff["Staff &amp; Roles<br/>[staff.routes.ts]"]
  node_analytics["Dashboard Metrics"]
end

subgraph group_ops["Order Operations"]
  node_orderdomain["Order Processing"]
  node_reviewdomain["Review Moderation"]
  node_settingdomain["Restaurant Settings"]
end

subgraph group_infra["Platform Services"]
  node_database[("PostgreSQL Data<br/>[db.ts]")]
  node_realtime["Live Order Updates<br/>[socket.ts]"]
  node_mail["Email Delivery<br/>[email.ts]"]
  node_eventbus["Automation Events<br/>[events.ts]"]
  node_payments["Payment Providers<br/>[stripe.ts]"]
end

node_customer(("Restaurant Customer"))
node_adminuser(("Restaurant Staff"))

node_customer -->|"browses and orders"| node_storefront
node_customer -->|"orders and tracks"| node_mobile
node_storefront -->|"REST requests"| node_server
node_mobile -->|"API requests"| node_server
node_adminuser -->|"manages restaurant"| node_adminui
node_adminui -->|"REST requests"| node_server
node_server -->|"mounts"| node_menuroutes
node_server -->|"mounts"| node_reviewroutes
node_server -->|"mounts"| node_settingroutes
node_server -->|"mounts"| node_reservations
node_server -->|"mounts"| node_coupons
node_server -->|"mounts"| node_automation
node_server -->|"mounts"| node_staff
node_server -->|"mounts"| node_analytics
node_menuroutes -.->|"serves menu data"| node_menupages
node_reviewroutes -->|"dispatches"| node_reviewdomain
node_settingroutes -->|"dispatches"| node_settingdomain
node_orderdomain -->|"reads and writes"| node_database
node_orderdomain -->|"emits order updates"| node_realtime
node_orderdomain -->|"sends order email"| node_mail
node_orderdomain -->|"emits status events"| node_eventbus
node_orderdomain -.->|"payment integration"| node_payments
node_reviewdomain -->|"reads and writes"| node_database
node_reviewdomain -->|"emits submission event"| node_eventbus
node_settingdomain -->|"reads and writes"| node_database
node_settingdomain -->|"tests email delivery"| node_mail
node_mobileauth -->|"provides auth token"| node_mobilepush
node_mobilepush -->|"registers push token"| node_server
node_orderpages -.->|"requests order operations"| node_server
node_reservationpages -.->|"requests reservations"| node_server
node_settingspages -.->|"configures settings"| node_server
node_reviewpages -.->|"moderates reviews"| node_server
node_design -.->|"configures templates"| node_storefront

click node_storefront "https://github.com/mighty840/kitchenasty/blob/main/packages/storefront/src/main.tsx"
click node_mobile "https://github.com/mighty840/kitchenasty/blob/main/packages/mobile/app/(tabs)/index.tsx"
click node_adminui "https://github.com/mighty840/kitchenasty/blob/main/packages/admin/src/main.tsx"
click node_server "https://github.com/mighty840/kitchenasty/blob/main/packages/server/src/app.ts"
click node_menuroutes "https://github.com/mighty840/kitchenasty/blob/main/packages/server/src/routes/menu.routes.ts"
click node_reviewroutes "https://github.com/mighty840/kitchenasty/blob/main/packages/server/src/routes/review.routes.ts"
click node_settingroutes "https://github.com/mighty840/kitchenasty/blob/main/packages/server/src/routes/settings.routes.ts"
click node_orderdomain "https://github.com/mighty840/kitchenasty/blob/main/packages/server/src/controllers/order.controller.ts"
click node_reviewdomain "https://github.com/mighty840/kitchenasty/blob/main/packages/server/src/controllers/review.controller.ts"
click node_settingdomain "https://github.com/mighty840/kitchenasty/blob/main/packages/server/src/controllers/settings.controller.ts"
click node_database "https://github.com/mighty840/kitchenasty/blob/main/packages/server/src/lib/db.ts"
click node_realtime "https://github.com/mighty840/kitchenasty/blob/main/packages/server/src/lib/socket.ts"
click node_mail "https://github.com/mighty840/kitchenasty/blob/main/packages/server/src/lib/email.ts"
click node_eventbus "https://github.com/mighty840/kitchenasty/blob/main/packages/server/src/lib/events.ts"
click node_payments "https://github.com/mighty840/kitchenasty/blob/main/packages/server/src/lib/stripe.ts"
click node_mobileauth "https://github.com/mighty840/kitchenasty/blob/main/packages/mobile/src/store/auth.store.ts"
click node_mobilepush "https://github.com/mighty840/kitchenasty/blob/main/packages/mobile/src/hooks/usePushNotifications.ts"
click node_menupages "https://github.com/mighty840/kitchenasty/blob/main/packages/admin/src/pages/MenuItemList.tsx"
click node_orderpages "https://github.com/mighty840/kitchenasty/blob/main/packages/admin/src/pages/OrderList.tsx"
click node_reservationpages "https://github.com/mighty840/kitchenasty/blob/main/packages/admin/src/pages/ReservationList.tsx"
click node_settingspages "https://github.com/mighty840/kitchenasty/blob/main/packages/admin/src/pages/Settings.tsx"
click node_reviewpages "https://github.com/mighty840/kitchenasty/blob/main/packages/admin/src/pages/ReviewList.tsx"
click node_reservations "https://github.com/mighty840/kitchenasty/blob/main/packages/server/src/routes/reservation.routes.ts"
click node_coupons "https://github.com/mighty840/kitchenasty/blob/main/packages/server/src/routes/coupon.routes.ts"
click node_automation "https://github.com/mighty840/kitchenasty/blob/main/packages/server/src/routes/automation.routes.ts"
click node_staff "https://github.com/mighty840/kitchenasty/blob/main/packages/server/src/routes/staff.routes.ts"
click node_analytics "https://github.com/mighty840/kitchenasty/blob/main/packages/server/src/routes/dashboard.routes.ts"
click node_design "https://github.com/mighty840/kitchenasty/blob/main/packages/admin/src/pages/DesignLanding.tsx"

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_storefront,node_mobile,node_mobileauth,node_mobilepush toneBlue
class node_adminui,node_menupages,node_orderpages,node_reservationpages,node_settingspages,node_reviewpages,node_design toneAmber
class node_server,node_menuroutes,node_reviewroutes,node_settingroutes,node_reservations,node_coupons,node_automation,node_staff,node_analytics toneMint
class node_orderdomain,node_reviewdomain,node_settingdomain toneRose
class node_database,node_realtime,node_mail,node_eventbus,node_payments,node_customer,node_adminuser toneIndigo
```

## Components

### Customer Apps

- [Web Storefront](https://github.com/mighty840/kitchenasty/blob/main/packages/storefront/src/main.tsx): `packages/storefront/src/main.tsx`
- [Mobile App](https://github.com/mighty840/kitchenasty/blob/main/packages/mobile/app/(tabs)/index.tsx): `packages/mobile/app/(tabs)/index.tsx`
- [Mobile Auth State](https://github.com/mighty840/kitchenasty/blob/main/packages/mobile/src/store/auth.store.ts): `packages/mobile/src/store/auth.store.ts`
- [Push Notifications](https://github.com/mighty840/kitchenasty/blob/main/packages/mobile/src/hooks/usePushNotifications.ts): `packages/mobile/src/hooks/usePushNotifications.ts`

### Admin Console

- [Admin Console](https://github.com/mighty840/kitchenasty/blob/main/packages/admin/src/main.tsx): `packages/admin/src/main.tsx`
- [Menu Management](https://github.com/mighty840/kitchenasty/blob/main/packages/admin/src/pages/MenuItemList.tsx): `packages/admin/src/pages/MenuItemList.tsx`
- [Order & Kitchen Views](https://github.com/mighty840/kitchenasty/blob/main/packages/admin/src/pages/OrderList.tsx): `packages/admin/src/pages/OrderList.tsx`
- [Reservations](https://github.com/mighty840/kitchenasty/blob/main/packages/admin/src/pages/ReservationList.tsx): `packages/admin/src/pages/ReservationList.tsx`
- [Configuration Views](https://github.com/mighty840/kitchenasty/blob/main/packages/admin/src/pages/Settings.tsx): `packages/admin/src/pages/Settings.tsx`
- [Review Management](https://github.com/mighty840/kitchenasty/blob/main/packages/admin/src/pages/ReviewList.tsx): `packages/admin/src/pages/ReviewList.tsx`
- [Storefront Design](https://github.com/mighty840/kitchenasty/blob/main/packages/admin/src/pages/DesignLanding.tsx): `packages/admin/src/pages/DesignLanding.tsx`

### REST API

- [API Application](https://github.com/mighty840/kitchenasty/blob/main/packages/server/src/app.ts): `packages/server/src/app.ts`
- [Menu Routes](https://github.com/mighty840/kitchenasty/blob/main/packages/server/src/routes/menu.routes.ts): `packages/server/src/routes/menu.routes.ts`
- [Review Routes](https://github.com/mighty840/kitchenasty/blob/main/packages/server/src/routes/review.routes.ts): `packages/server/src/routes/review.routes.ts`
- [Settings Routes](https://github.com/mighty840/kitchenasty/blob/main/packages/server/src/routes/settings.routes.ts): `packages/server/src/routes/settings.routes.ts`
- [Reservation Services](https://github.com/mighty840/kitchenasty/blob/main/packages/server/src/routes/reservation.routes.ts): `packages/server/src/routes/reservation.routes.ts`
- [Coupon Services](https://github.com/mighty840/kitchenasty/blob/main/packages/server/src/routes/coupon.routes.ts): `packages/server/src/routes/coupon.routes.ts`
- [Automation Rules](https://github.com/mighty840/kitchenasty/blob/main/packages/server/src/routes/automation.routes.ts): `packages/server/src/routes/automation.routes.ts`
- [Staff & Roles](https://github.com/mighty840/kitchenasty/blob/main/packages/server/src/routes/staff.routes.ts): `packages/server/src/routes/staff.routes.ts`
- [Dashboard Metrics](https://github.com/mighty840/kitchenasty/blob/main/packages/server/src/routes/dashboard.routes.ts): `packages/server/src/routes/dashboard.routes.ts`

### Order Operations

- [Order Processing](https://github.com/mighty840/kitchenasty/blob/main/packages/server/src/controllers/order.controller.ts): `packages/server/src/controllers/order.controller.ts`
- [Review Moderation](https://github.com/mighty840/kitchenasty/blob/main/packages/server/src/controllers/review.controller.ts): `packages/server/src/controllers/review.controller.ts`
- [Restaurant Settings](https://github.com/mighty840/kitchenasty/blob/main/packages/server/src/controllers/settings.controller.ts): `packages/server/src/controllers/settings.controller.ts`

### Platform Services

- [PostgreSQL Data](https://github.com/mighty840/kitchenasty/blob/main/packages/server/src/lib/db.ts): `packages/server/src/lib/db.ts`
- [Live Order Updates](https://github.com/mighty840/kitchenasty/blob/main/packages/server/src/lib/socket.ts): `packages/server/src/lib/socket.ts`
- [Email Delivery](https://github.com/mighty840/kitchenasty/blob/main/packages/server/src/lib/email.ts): `packages/server/src/lib/email.ts`
- [Automation Events](https://github.com/mighty840/kitchenasty/blob/main/packages/server/src/lib/events.ts): `packages/server/src/lib/events.ts`
- [Payment Providers](https://github.com/mighty840/kitchenasty/blob/main/packages/server/src/lib/stripe.ts): `packages/server/src/lib/stripe.ts`

### Other components

- **Restaurant Customer**
- **Restaurant Staff**

## Connections

- Restaurant Customer → Web Storefront: browses and orders
- Restaurant Customer → Mobile App: orders and tracks
- Web Storefront → API Application: REST requests
- Mobile App → API Application: API requests
- Restaurant Staff → Admin Console: manages restaurant
- Admin Console → API Application: REST requests
- API Application → Menu Routes: mounts
- API Application → Review Routes: mounts
- API Application → Settings Routes: mounts
- API Application → Reservation Services: mounts
- API Application → Coupon Services: mounts
- API Application → Automation Rules: mounts
- API Application → Staff & Roles: mounts
- API Application → Dashboard Metrics: mounts
- Menu Routes → Menu Management: serves menu data
- Review Routes → Review Moderation: dispatches
- Settings Routes → Restaurant Settings: dispatches
- Order Processing → PostgreSQL Data: reads and writes
- Order Processing → Live Order Updates: emits order updates
- Order Processing → Email Delivery: sends order email
- Order Processing → Automation Events: emits status events
- Order Processing → Payment Providers: payment integration
- Review Moderation → PostgreSQL Data: reads and writes
- Review Moderation → Automation Events: emits submission event
- Restaurant Settings → PostgreSQL Data: reads and writes
- Restaurant Settings → Email Delivery: tests email delivery
- Mobile Auth State → Push Notifications: provides auth token
- Push Notifications → API Application: registers push token
- Order & Kitchen Views → API Application: requests order operations
- Reservations → API Application: requests reservations
- Configuration Views → API Application: configures settings
- Review Management → API Application: moderates reviews
- Storefront Design → Web Storefront: configures templates
