# aniketbhil/zestra architecture

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

- Interactive diagram: https://gitdiagram.com/aniketbhil/zestra
- Repository: https://github.com/aniketbhil/zestra

## Overview

Zestra serves diners and restaurant teams through a React client and FastAPI backend. The main diner journey is browse a QR-linked menu, place and pay for an order, then follow its live status; reservation booking is a separate customer journey. Restaurant workflows cover menu and inventory upkeep, orders, reservations, analytics, and AI insights. The backend also provides authentication, WebSockets, and scheduled background work. README feature descriptions support several subsystem links; unsampled route implementations are represented at their existing directory paths, not inferred in detail.

Main entry points: [`zestra-backend/app/main.py`](https://github.com/aniketbhil/zestra/blob/main/zestra-backend/app/main.py) (FastAPI application), [`zestra-frontend/src/services/api.js`](https://github.com/aniketbhil/zestra/blob/main/zestra-frontend/src/services/api.js) (API client), [`zestra-backend/app/workers/tasks.py`](https://github.com/aniketbhil/zestra/blob/main/zestra-backend/app/workers/tasks.py) (Scheduled tasks), [`zestra-frontend/src/App.jsx`](https://github.com/aniketbhil/zestra/blob/main/zestra-frontend/src/App.jsx) (Web application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_web_app["Web application<br/>[App.jsx]"]
  node_public_menu["Public menu<br/>[PublicMenu.jsx]"]
  node_checkout["Checkout<br/>[Checkout.jsx]"]
  node_order_tracking["Order tracking<br/>[OrderTracking.jsx]"]
  node_customer_reservations["Customer reservations"]
  node_dashboard["Restaurant dashboard<br/>[DashboardHome.jsx]"]
  node_api_client["API client<br/>[api.js]"]
  node_auth_store["Authentication state<br/>[useAuthStore.js]"]
  node_order_store["Diner order state<br/>[useOrderStore.js]"]
  node_restaurant_orders["Order dashboard state"]
  node_reservation_store["Reservation state"]
end

subgraph group_api["Backend API"]
  node_backend["FastAPI application<br/>[main.py]"]
  node_auth_api["Authentication API<br/>[auth.py]"]
  node_public_api["Public menu and orders<br/>[public.py]"]
  node_orders_api["Order API<br/>[orders.py]"]
  node_payments_api["Payments API<br/>[payments.py]"]
  node_reservations_api["Reservations API<br/>[reservations.py]"]
end

subgraph group_operations["Restaurant operations"]
  node_menu_api["Menu API<br/>[menu.py]"]
  node_inventory_api["Inventory API<br/>[inventory.py]"]
  node_restaurant_api["Restaurant API<br/>[restaurants.py]"]
  node_analytics_ai["Analytics and AI<br/>[ai.py]"]
  node_dashboard_api["Dashboard API<br/>[dashboard.py]"]
end

subgraph group_realtime["Realtime and jobs"]
  node_ws_api["WebSocket routes<br/>[ws.py]"]
  node_connection_manager["Connection manager"]
  node_worker_tasks["Scheduled tasks<br/>[tasks.py]"]
  node_worker["ARQ worker<br/>[worker.py]"]
end

subgraph group_platform["Persistence and integrations"]
  node_db_session["Database sessions<br/>[session.py]"]
  node_order_model[("Order records<br/>[order.py]")]
  node_inventory_model[("Inventory records<br/>[inventory_item.py]")]
end

node_diner(("Diner"))
node_restaurant_user(("Restaurant team"))
node_postgres[("PostgreSQL")]
node_redis[("Redis")]
node_razorpay["Razorpay"]

node_diner -->|"uses"| node_web_app
node_restaurant_user -->|"uses"| node_web_app
node_web_app -->|"routes to"| node_public_menu
node_web_app -->|"routes to"| node_dashboard
node_public_menu -->|"continues to"| node_checkout
node_checkout -->|"places order"| node_order_store
node_order_store -->|"calls"| node_api_client
node_customer_reservations -->|"uses"| node_reservation_store
node_reservation_store -->|"calls"| node_api_client
node_api_client -->|"HTTP requests"| node_backend
node_auth_store -->|"calls"| node_api_client
node_dashboard -->|"manages orders"| node_restaurant_orders
node_restaurant_orders -->|"calls"| node_api_client
node_backend -->|"mounts routes"| node_auth_api
node_backend -->|"mounts routes"| node_public_api
node_backend -.->|"mounts routes"| node_orders_api
node_backend -.->|"mounts routes"| node_payments_api
node_backend -.->|"mounts routes"| node_reservations_api
node_backend -.->|"mounts routes"| node_menu_api
node_backend -.->|"mounts routes"| node_inventory_api
node_backend -.->|"mounts routes"| node_restaurant_api
node_backend -.->|"mounts routes"| node_analytics_ai
node_backend -.->|"mounts routes"| node_dashboard_api
node_backend -->|"mounts"| node_ws_api
node_backend -->|"starts"| node_worker
node_worker -->|"registers"| node_worker_tasks
node_worker_tasks -->|"queries through"| node_db_session
node_worker_tasks -->|"checks stock"| node_inventory_model
node_worker_tasks -->|"broadcasts alerts"| node_connection_manager
node_ws_api -.->|"manages connections"| node_connection_manager
node_order_tracking -->|"tracks status"| node_order_store
node_order_store -->|"opens WebSocket"| node_backend
node_restaurant_orders -->|"opens WebSocket"| node_backend
node_orders_api -->|"persists orders"| node_order_model
node_db_session -->|"connects"| node_postgres
node_worker -->|"uses queue"| node_redis
node_payments_api -->|"creates and verifies"| node_razorpay

click node_web_app "https://github.com/aniketbhil/zestra/blob/main/zestra-frontend/src/App.jsx"
click node_public_menu "https://github.com/aniketbhil/zestra/blob/main/zestra-frontend/src/pages/public/PublicMenu.jsx"
click node_checkout "https://github.com/aniketbhil/zestra/blob/main/zestra-frontend/src/pages/public/Checkout.jsx"
click node_order_tracking "https://github.com/aniketbhil/zestra/blob/main/zestra-frontend/src/pages/public/OrderTracking.jsx"
click node_customer_reservations "https://github.com/aniketbhil/zestra/blob/main/zestra-frontend/src/store/dashboard/useReservationStore.js"
click node_dashboard "https://github.com/aniketbhil/zestra/blob/main/zestra-frontend/src/pages/dashboard/DashboardHome.jsx"
click node_api_client "https://github.com/aniketbhil/zestra/blob/main/zestra-frontend/src/services/api.js"
click node_auth_store "https://github.com/aniketbhil/zestra/blob/main/zestra-frontend/src/store/auth/useAuthStore.js"
click node_order_store "https://github.com/aniketbhil/zestra/blob/main/zestra-frontend/src/store/public/useOrderStore.js"
click node_restaurant_orders "https://github.com/aniketbhil/zestra/blob/main/zestra-frontend/src/store/dashboard/useRestaurantOrderStore.js"
click node_reservation_store "https://github.com/aniketbhil/zestra/blob/main/zestra-frontend/src/store/dashboard/useReservationStore.js"
click node_backend "https://github.com/aniketbhil/zestra/blob/main/zestra-backend/app/main.py"
click node_auth_api "https://github.com/aniketbhil/zestra/blob/main/zestra-backend/app/api/v1/auth.py"
click node_public_api "https://github.com/aniketbhil/zestra/blob/main/zestra-backend/app/api/v1/public.py"
click node_orders_api "https://github.com/aniketbhil/zestra/blob/main/zestra-backend/app/api/v1/orders.py"
click node_payments_api "https://github.com/aniketbhil/zestra/blob/main/zestra-backend/app/api/v1/payments.py"
click node_reservations_api "https://github.com/aniketbhil/zestra/blob/main/zestra-backend/app/api/v1/reservations.py"
click node_menu_api "https://github.com/aniketbhil/zestra/blob/main/zestra-backend/app/api/v1/menu.py"
click node_inventory_api "https://github.com/aniketbhil/zestra/blob/main/zestra-backend/app/api/v1/inventory.py"
click node_restaurant_api "https://github.com/aniketbhil/zestra/blob/main/zestra-backend/app/api/v1/restaurants.py"
click node_analytics_ai "https://github.com/aniketbhil/zestra/blob/main/zestra-backend/app/api/v1/ai.py"
click node_dashboard_api "https://github.com/aniketbhil/zestra/blob/main/zestra-backend/app/api/v1/dashboard.py"
click node_ws_api "https://github.com/aniketbhil/zestra/blob/main/zestra-backend/app/api/v1/ws.py"
click node_connection_manager "https://github.com/aniketbhil/zestra/blob/main/zestra-backend/app/services/connection_manager.py"
click node_worker_tasks "https://github.com/aniketbhil/zestra/blob/main/zestra-backend/app/workers/tasks.py"
click node_worker "https://github.com/aniketbhil/zestra/blob/main/zestra-backend/app/workers/worker.py"
click node_db_session "https://github.com/aniketbhil/zestra/blob/main/zestra-backend/app/db/session.py"
click node_order_model "https://github.com/aniketbhil/zestra/blob/main/zestra-backend/app/models/order.py"
click node_inventory_model "https://github.com/aniketbhil/zestra/blob/main/zestra-backend/app/models/inventory_item.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_web_app,node_public_menu,node_checkout,node_order_tracking,node_customer_reservations,node_dashboard,node_api_client,node_auth_store,node_order_store,node_restaurant_orders,node_reservation_store toneBlue
class node_backend,node_auth_api,node_public_api,node_orders_api,node_payments_api,node_reservations_api,node_postgres,node_redis toneAmber
class node_menu_api,node_inventory_api,node_restaurant_api,node_analytics_ai,node_dashboard_api toneMint
class node_ws_api,node_connection_manager,node_worker_tasks,node_worker toneRose
class node_db_session,node_order_model,node_inventory_model,node_diner,node_restaurant_user,node_razorpay toneIndigo
```

## Components

### Web client

- [Web application](https://github.com/aniketbhil/zestra/blob/main/zestra-frontend/src/App.jsx): `zestra-frontend/src/App.jsx`
- [Public menu](https://github.com/aniketbhil/zestra/blob/main/zestra-frontend/src/pages/public/PublicMenu.jsx): `zestra-frontend/src/pages/public/PublicMenu.jsx`
- [Checkout](https://github.com/aniketbhil/zestra/blob/main/zestra-frontend/src/pages/public/Checkout.jsx): `zestra-frontend/src/pages/public/Checkout.jsx`
- [Order tracking](https://github.com/aniketbhil/zestra/blob/main/zestra-frontend/src/pages/public/OrderTracking.jsx): `zestra-frontend/src/pages/public/OrderTracking.jsx`
- [Customer reservations](https://github.com/aniketbhil/zestra/blob/main/zestra-frontend/src/store/dashboard/useReservationStore.js): `zestra-frontend/src/store/dashboard/useReservationStore.js`
- [Restaurant dashboard](https://github.com/aniketbhil/zestra/blob/main/zestra-frontend/src/pages/dashboard/DashboardHome.jsx): `zestra-frontend/src/pages/dashboard/DashboardHome.jsx`
- [API client](https://github.com/aniketbhil/zestra/blob/main/zestra-frontend/src/services/api.js): `zestra-frontend/src/services/api.js`
- [Authentication state](https://github.com/aniketbhil/zestra/blob/main/zestra-frontend/src/store/auth/useAuthStore.js): `zestra-frontend/src/store/auth/useAuthStore.js`
- [Diner order state](https://github.com/aniketbhil/zestra/blob/main/zestra-frontend/src/store/public/useOrderStore.js): `zestra-frontend/src/store/public/useOrderStore.js`
- [Order dashboard state](https://github.com/aniketbhil/zestra/blob/main/zestra-frontend/src/store/dashboard/useRestaurantOrderStore.js): `zestra-frontend/src/store/dashboard/useRestaurantOrderStore.js`
- [Reservation state](https://github.com/aniketbhil/zestra/blob/main/zestra-frontend/src/store/dashboard/useReservationStore.js): `zestra-frontend/src/store/dashboard/useReservationStore.js`

### Backend API

- [FastAPI application](https://github.com/aniketbhil/zestra/blob/main/zestra-backend/app/main.py): `zestra-backend/app/main.py`
- [Authentication API](https://github.com/aniketbhil/zestra/blob/main/zestra-backend/app/api/v1/auth.py): `zestra-backend/app/api/v1/auth.py`
- [Public menu and orders](https://github.com/aniketbhil/zestra/blob/main/zestra-backend/app/api/v1/public.py): `zestra-backend/app/api/v1/public.py`
- [Order API](https://github.com/aniketbhil/zestra/blob/main/zestra-backend/app/api/v1/orders.py): `zestra-backend/app/api/v1/orders.py`
- [Payments API](https://github.com/aniketbhil/zestra/blob/main/zestra-backend/app/api/v1/payments.py): `zestra-backend/app/api/v1/payments.py`
- [Reservations API](https://github.com/aniketbhil/zestra/blob/main/zestra-backend/app/api/v1/reservations.py): `zestra-backend/app/api/v1/reservations.py`

### Restaurant operations

- [Menu API](https://github.com/aniketbhil/zestra/blob/main/zestra-backend/app/api/v1/menu.py): `zestra-backend/app/api/v1/menu.py`
- [Inventory API](https://github.com/aniketbhil/zestra/blob/main/zestra-backend/app/api/v1/inventory.py): `zestra-backend/app/api/v1/inventory.py`
- [Restaurant API](https://github.com/aniketbhil/zestra/blob/main/zestra-backend/app/api/v1/restaurants.py): `zestra-backend/app/api/v1/restaurants.py`
- [Analytics and AI](https://github.com/aniketbhil/zestra/blob/main/zestra-backend/app/api/v1/ai.py): `zestra-backend/app/api/v1/ai.py`
- [Dashboard API](https://github.com/aniketbhil/zestra/blob/main/zestra-backend/app/api/v1/dashboard.py): `zestra-backend/app/api/v1/dashboard.py`

### Realtime and jobs

- [WebSocket routes](https://github.com/aniketbhil/zestra/blob/main/zestra-backend/app/api/v1/ws.py): `zestra-backend/app/api/v1/ws.py`
- [Connection manager](https://github.com/aniketbhil/zestra/blob/main/zestra-backend/app/services/connection_manager.py): `zestra-backend/app/services/connection_manager.py`
- [Scheduled tasks](https://github.com/aniketbhil/zestra/blob/main/zestra-backend/app/workers/tasks.py): `zestra-backend/app/workers/tasks.py`
- [ARQ worker](https://github.com/aniketbhil/zestra/blob/main/zestra-backend/app/workers/worker.py): `zestra-backend/app/workers/worker.py`

### Persistence and integrations

- [Database sessions](https://github.com/aniketbhil/zestra/blob/main/zestra-backend/app/db/session.py): `zestra-backend/app/db/session.py`
- [Order records](https://github.com/aniketbhil/zestra/blob/main/zestra-backend/app/models/order.py): `zestra-backend/app/models/order.py`
- [Inventory records](https://github.com/aniketbhil/zestra/blob/main/zestra-backend/app/models/inventory_item.py): `zestra-backend/app/models/inventory_item.py`

### Other components

- **Diner**
- **Restaurant team**
- **PostgreSQL**
- **Redis**
- **Razorpay**

## Connections

- Diner → Web application: uses (evidence: `README.md`)
- Restaurant team → Web application: uses (evidence: `README.md`)
- Web application → Public menu: routes to (evidence: `README.md`)
- Web application → Restaurant dashboard: routes to (evidence: `README.md`)
- Public menu → Checkout: continues to (evidence: `README.md`)
- Checkout → Diner order state: places order (evidence: `README.md`)
- Diner order state → API client: calls (evidence: `zestra-frontend/src/store/public/useOrderStore.js`)
- Customer reservations → Reservation state: uses (evidence: `README.md`)
- Reservation state → API client: calls (evidence: `zestra-frontend/src/store/dashboard/useReservationStore.js`)
- API client → FastAPI application: HTTP requests (evidence: `README.md`)
- Authentication state → API client: calls (evidence: `zestra-frontend/src/store/auth/useAuthStore.js`)
- Restaurant dashboard → Order dashboard state: manages orders (evidence: `README.md`)
- Order dashboard state → API client: calls (evidence: `zestra-frontend/src/store/dashboard/useRestaurantOrderStore.js`)
- FastAPI application → Authentication API: mounts routes (evidence: `zestra-backend/app/main.py`)
- FastAPI application → Public menu and orders: mounts routes (evidence: `zestra-backend/app/main.py`)
- FastAPI application → Order API: mounts routes (evidence: `README.md`)
- FastAPI application → Payments API: mounts routes (evidence: `README.md`)
- FastAPI application → Reservations API: mounts routes (evidence: `README.md`)
- FastAPI application → Menu API: mounts routes (evidence: `README.md`)
- FastAPI application → Inventory API: mounts routes (evidence: `README.md`)
- FastAPI application → Restaurant API: mounts routes (evidence: `README.md`)
- FastAPI application → Analytics and AI: mounts routes (evidence: `README.md`)
- FastAPI application → Dashboard API: mounts routes (evidence: `README.md`)
- FastAPI application → WebSocket routes: mounts (evidence: `zestra-backend/app/main.py`)
- FastAPI application → ARQ worker: starts (evidence: `zestra-backend/app/main.py`)
- ARQ worker → Scheduled tasks: registers (evidence: `zestra-backend/app/workers/worker.py`)
- Scheduled tasks → Database sessions: queries through (evidence: `zestra-backend/app/workers/tasks.py`)
- Scheduled tasks → Inventory records: checks stock (evidence: `zestra-backend/app/workers/tasks.py`)
- Scheduled tasks → Connection manager: broadcasts alerts (evidence: `zestra-backend/app/workers/tasks.py`)
- WebSocket routes → Connection manager: manages connections
- Order tracking → Diner order state: tracks status (evidence: `README.md`)
- Diner order state → FastAPI application: opens WebSocket (evidence: `zestra-frontend/src/store/public/useOrderStore.js`)
- Order dashboard state → FastAPI application: opens WebSocket (evidence: `zestra-frontend/src/store/dashboard/useRestaurantOrderStore.js`)
- Order API → Order records: persists orders (evidence: `README.md`)
- Database sessions → PostgreSQL: connects (evidence: `README.md`)
- ARQ worker → Redis: uses queue (evidence: `zestra-backend/app/workers/worker.py`)
- Payments API → Razorpay: creates and verifies (evidence: `README.md`)
