# haswanth13901/zenoeats architecture

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

- Interactive diagram: https://gitdiagram.com/haswanth13901/zenoeats
- Repository: https://github.com/haswanth13901/zenoeats

## Overview

Zenoeats is a multi-tenant restaurant ordering platform with customer, restaurant-staff, and super-admin portals. The main customer journey is menu browsing, cart and checkout, server-side pricing and order creation, Stripe payment confirmation, then kitchen fulfillment and pickup or delivery handover. The map also includes identity, restaurant operations, storefront configuration, and administration. Backend relationships are grounded in the README and indexed excerpts; several frontend and service internals are unsampled, so their links are limited to documented capabilities.

Main entry points: [`backend/app/api/v1/orders.py`](https://github.com/haswanth13901/zenoeats/blob/main/backend/app/api/v1/orders.py) (Order API), [`backend/app/workers/tasks.py`](https://github.com/haswanth13901/zenoeats/blob/main/backend/app/workers/tasks.py) (Payment worker), [`backend/app/services/stripe_service.py`](https://github.com/haswanth13901/zenoeats/blob/main/backend/app/services/stripe_service.py) (Stripe payments), [`backend/app/api/v1/webhooks.py`](https://github.com/haswanth13901/zenoeats/blob/main/backend/app/api/v1/webhooks.py) (Webhook inbox)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer["Customer ordering"]
  node_storefront["Storefront<br/>[StorefrontPage.tsx]"]
  node_cart["Cart<br/>[CartPage.tsx]"]
  node_checkout["Checkout<br/>[CheckoutPage.tsx]"]
  node_order_tracking["Order tracking<br/>[OrderPage.tsx]"]
  node_customer_identity["Customer identity<br/>[customer.py]"]
end

subgraph group_restaurant["Restaurant operations"]
  node_restaurant_portal["Restaurant API<br/>[restaurant.py]"]
  node_kitchen["Kitchen board"]
  node_delivery["Delivery operations<br/>[delivery.py]"]
  node_restaurant_menu["Menu management<br/>[restaurantApi.ts]"]
end

subgraph group_backend["API and commerce"]
  node_order_api["Order API<br/>[orders.py]"]
  node_pricing["Pricing and tax<br/>[pricing.py]"]
  node_orders_service["Order service<br/>[orders.py]"]
  node_payments["Stripe payments<br/>[stripe_service.py]"]
  node_webhooks["Webhook inbox<br/>[webhooks.py]"]
  node_worker["Payment worker<br/>[tasks.py]"]
  node_commerce_store[("Commerce records<br/>[commerce.py]")]
  node_payment_store[("Payment and event records<br/>[payments.py]")]
  node_portal_api["Storefront API<br/>[portal.py]"]
end

subgraph group_platform["Platform services"]
  node_admin["Admin portal<br/>[admin.py]"]
  node_tenant_access["Tenant access<br/>[deps.py]"]
  node_database_sessions["Tenant DB sessions<br/>[session.py]"]
  node_clerk["Clerk identity"]
  node_stripe["Stripe Connect"]
  node_email["Email delivery<br/>[email.py]"]
  node_api_entry["API application<br/>[main.py]"]
end

node_customer(("Customer"))

node_customer -->|"browses"| node_storefront
node_storefront -->|"loads menu"| node_portal_api
node_customer -->|"adds items"| node_cart
node_cart -->|"continues to"| node_checkout
node_checkout -->|"creates order"| node_order_api
node_order_api -->|"reprices cart"| node_pricing
node_order_api -.->|"creates order"| node_orders_service
node_order_api -->|"requests intent"| node_payments
node_payments -->|"creates charge"| node_stripe
node_stripe -->|"sends event"| node_webhooks
node_webhooks -->|"persists event"| node_payment_store
node_webhooks -->|"enqueues event"| node_worker
node_worker -->|"loads and updates"| node_payment_store
node_worker -->|"opens tenant session"| node_database_sessions
node_worker -->|"reads intent"| node_payments
node_worker -->|"advances order"| node_commerce_store
node_order_tracking -->|"polls status"| node_order_api
node_commerce_store -->|"paid order appears"| node_kitchen
node_restaurant_portal -->|"serves operations"| node_kitchen
node_restaurant_portal -->|"supports menu editing"| node_restaurant_menu
node_restaurant_portal -->|"supports delivery"| node_delivery
node_kitchen -.->|"hands off order"| node_delivery
node_customer -->|"signs in or checks out"| node_customer_identity
node_customer_identity -->|"authenticates customer"| node_clerk
node_customer_identity -.->|"supports account email"| node_email
node_api_entry -->|"mounts API routes"| node_portal_api
node_api_entry -->|"mounts API routes"| node_order_api
node_api_entry -->|"mounts API routes"| node_webhooks
node_order_api -->|"resolves request scope"| node_tenant_access
node_tenant_access -->|"opens scoped sessions"| node_database_sessions
node_admin -->|"uses admin access"| node_tenant_access
node_admin -->|"manages Stripe setup"| node_payments
node_payments -.->|"records payment state"| node_payment_store

click node_storefront "https://github.com/haswanth13901/zenoeats/blob/main/web/src/pages/storefront/StorefrontPage.tsx"
click node_cart "https://github.com/haswanth13901/zenoeats/blob/main/web/src/pages/storefront/CartPage.tsx"
click node_checkout "https://github.com/haswanth13901/zenoeats/blob/main/web/src/pages/storefront/CheckoutPage.tsx"
click node_order_tracking "https://github.com/haswanth13901/zenoeats/blob/main/web/src/pages/storefront/OrderPage.tsx"
click node_customer_identity "https://github.com/haswanth13901/zenoeats/blob/main/backend/app/api/v1/customer.py"
click node_order_api "https://github.com/haswanth13901/zenoeats/blob/main/backend/app/api/v1/orders.py"
click node_pricing "https://github.com/haswanth13901/zenoeats/blob/main/backend/app/services/pricing.py"
click node_orders_service "https://github.com/haswanth13901/zenoeats/blob/main/backend/app/services/orders.py"
click node_payments "https://github.com/haswanth13901/zenoeats/blob/main/backend/app/services/stripe_service.py"
click node_webhooks "https://github.com/haswanth13901/zenoeats/blob/main/backend/app/api/v1/webhooks.py"
click node_worker "https://github.com/haswanth13901/zenoeats/blob/main/backend/app/workers/tasks.py"
click node_commerce_store "https://github.com/haswanth13901/zenoeats/blob/main/backend/app/models/commerce.py"
click node_payment_store "https://github.com/haswanth13901/zenoeats/blob/main/backend/app/models/payments.py"
click node_restaurant_portal "https://github.com/haswanth13901/zenoeats/blob/main/backend/app/api/v1/restaurant.py"
click node_kitchen "https://github.com/haswanth13901/zenoeats/blob/main/web/src/pages/manage/KitchenBoardPage.tsx"
click node_delivery "https://github.com/haswanth13901/zenoeats/blob/main/backend/app/services/delivery.py"
click node_restaurant_menu "https://github.com/haswanth13901/zenoeats/blob/main/web/src/features/restaurant/restaurantApi.ts"
click node_portal_api "https://github.com/haswanth13901/zenoeats/blob/main/backend/app/api/v1/portal.py"
click node_admin "https://github.com/haswanth13901/zenoeats/blob/main/backend/app/api/v1/admin.py"
click node_tenant_access "https://github.com/haswanth13901/zenoeats/blob/main/backend/app/api/deps.py"
click node_database_sessions "https://github.com/haswanth13901/zenoeats/blob/main/backend/app/db/session.py"
click node_email "https://github.com/haswanth13901/zenoeats/blob/main/backend/app/services/email.py"
click node_api_entry "https://github.com/haswanth13901/zenoeats/blob/main/backend/app/main.py"

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_cart,node_checkout,node_order_tracking,node_customer_identity toneBlue
class node_restaurant_portal,node_kitchen,node_delivery,node_restaurant_menu toneAmber
class node_order_api,node_pricing,node_orders_service,node_payments,node_webhooks,node_worker,node_commerce_store,node_payment_store,node_portal_api toneMint
class node_admin,node_tenant_access,node_database_sessions,node_clerk,node_stripe,node_email,node_api_entry toneRose
class node_customer toneIndigo
```

## Components

### Customer ordering

- [Storefront](https://github.com/haswanth13901/zenoeats/blob/main/web/src/pages/storefront/StorefrontPage.tsx): `web/src/pages/storefront/StorefrontPage.tsx`
- [Cart](https://github.com/haswanth13901/zenoeats/blob/main/web/src/pages/storefront/CartPage.tsx): `web/src/pages/storefront/CartPage.tsx`
- [Checkout](https://github.com/haswanth13901/zenoeats/blob/main/web/src/pages/storefront/CheckoutPage.tsx): `web/src/pages/storefront/CheckoutPage.tsx`
- [Order tracking](https://github.com/haswanth13901/zenoeats/blob/main/web/src/pages/storefront/OrderPage.tsx): `web/src/pages/storefront/OrderPage.tsx`
- [Customer identity](https://github.com/haswanth13901/zenoeats/blob/main/backend/app/api/v1/customer.py): `backend/app/api/v1/customer.py`

### Restaurant operations

- [Restaurant API](https://github.com/haswanth13901/zenoeats/blob/main/backend/app/api/v1/restaurant.py): `backend/app/api/v1/restaurant.py`
- [Kitchen board](https://github.com/haswanth13901/zenoeats/blob/main/web/src/pages/manage/KitchenBoardPage.tsx): `web/src/pages/manage/KitchenBoardPage.tsx`
- [Delivery operations](https://github.com/haswanth13901/zenoeats/blob/main/backend/app/services/delivery.py): `backend/app/services/delivery.py`
- [Menu management](https://github.com/haswanth13901/zenoeats/blob/main/web/src/features/restaurant/restaurantApi.ts): `web/src/features/restaurant/restaurantApi.ts`

### API and commerce

- [Order API](https://github.com/haswanth13901/zenoeats/blob/main/backend/app/api/v1/orders.py): `backend/app/api/v1/orders.py`
- [Pricing and tax](https://github.com/haswanth13901/zenoeats/blob/main/backend/app/services/pricing.py): `backend/app/services/pricing.py`
- [Order service](https://github.com/haswanth13901/zenoeats/blob/main/backend/app/services/orders.py): `backend/app/services/orders.py`
- [Stripe payments](https://github.com/haswanth13901/zenoeats/blob/main/backend/app/services/stripe_service.py): `backend/app/services/stripe_service.py`
- [Webhook inbox](https://github.com/haswanth13901/zenoeats/blob/main/backend/app/api/v1/webhooks.py): `backend/app/api/v1/webhooks.py`
- [Payment worker](https://github.com/haswanth13901/zenoeats/blob/main/backend/app/workers/tasks.py): `backend/app/workers/tasks.py`
- [Commerce records](https://github.com/haswanth13901/zenoeats/blob/main/backend/app/models/commerce.py): `backend/app/models/commerce.py`
- [Payment and event records](https://github.com/haswanth13901/zenoeats/blob/main/backend/app/models/payments.py): `backend/app/models/payments.py`
- [Storefront API](https://github.com/haswanth13901/zenoeats/blob/main/backend/app/api/v1/portal.py): `backend/app/api/v1/portal.py`

### Platform services

- [Admin portal](https://github.com/haswanth13901/zenoeats/blob/main/backend/app/api/v1/admin.py): `backend/app/api/v1/admin.py`
- [Tenant access](https://github.com/haswanth13901/zenoeats/blob/main/backend/app/api/deps.py): `backend/app/api/deps.py`
- [Tenant DB sessions](https://github.com/haswanth13901/zenoeats/blob/main/backend/app/db/session.py): `backend/app/db/session.py`
- **Clerk identity**
- **Stripe Connect**
- [Email delivery](https://github.com/haswanth13901/zenoeats/blob/main/backend/app/services/email.py): `backend/app/services/email.py`
- [API application](https://github.com/haswanth13901/zenoeats/blob/main/backend/app/main.py): `backend/app/main.py`

### Other components

- **Customer**

## Connections

- Customer → Storefront: browses
- Storefront → Storefront API: loads menu
- Customer → Cart: adds items
- Cart → Checkout: continues to
- Checkout → Order API: creates order
- Order API → Pricing and tax: reprices cart (evidence: `backend/app/api/v1/orders.py`)
- Order API → Order service: creates order (evidence: `backend/app/api/v1/orders.py`)
- Order API → Stripe payments: requests intent (evidence: `backend/app/api/v1/orders.py`)
- Stripe payments → Stripe Connect: creates charge
- Stripe Connect → Webhook inbox: sends event
- Webhook inbox → Payment and event records: persists event (evidence: `backend/app/api/v1/webhooks.py`)
- Webhook inbox → Payment worker: enqueues event (evidence: `backend/app/api/v1/webhooks.py`)
- Payment worker → Payment and event records: loads and updates (evidence: `backend/app/workers/tasks.py`)
- Payment worker → Tenant DB sessions: opens tenant session (evidence: `backend/app/workers/tasks.py`)
- Payment worker → Stripe payments: reads intent (evidence: `backend/app/workers/tasks.py`)
- Payment worker → Commerce records: advances order (evidence: `backend/app/workers/tasks.py`)
- Order tracking → Order API: polls status
- Commerce records → Kitchen board: paid order appears
- Restaurant API → Kitchen board: serves operations
- Restaurant API → Menu management: supports menu editing
- Restaurant API → Delivery operations: supports delivery
- Kitchen board → Delivery operations: hands off order
- Customer → Customer identity: signs in or checks out
- Customer identity → Clerk identity: authenticates customer
- Customer identity → Email delivery: supports account email
- API application → Storefront API: mounts API routes (evidence: `backend/app/main.py`)
- API application → Order API: mounts API routes (evidence: `backend/app/main.py`)
- API application → Webhook inbox: mounts API routes
- Order API → Tenant access: resolves request scope (evidence: `backend/app/api/v1/orders.py`)
- Tenant access → Tenant DB sessions: opens scoped sessions (evidence: `backend/app/api/deps.py`)
- Admin portal → Tenant access: uses admin access (evidence: `backend/app/api/v1/admin.py`)
- Admin portal → Stripe payments: manages Stripe setup (evidence: `backend/app/api/v1/admin.py`)
- Stripe payments → Payment and event records: records payment state
