# dezmshibe/chowza architecture

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

- Interactive diagram: https://gitdiagram.com/dezmshibe/chowza
- Repository: https://github.com/dezmshibe/chowza

## Overview

Chowza is a WhatsApp-first food-ordering and restaurant-management platform. Customers browse restaurant menus, build a cart, place orders, and track them; businesses manage orders and storefront operations, while administrators oversee the platform. The React app routes into customer, business, and admin experiences, with Supabase providing shared application data and serverless functions covering order, payment, tracking, and notification capabilities. Source excerpts establish frontend composition and some Supabase use; most serverless implementations were not sampled, so their links are left unverified.

Main entry points: [`src/App.tsx`](https://github.com/dezmshibe/chowza/blob/main/src/App.tsx) (Route dispatcher), [`src/components/BusinessApp.tsx`](https://github.com/dezmshibe/chowza/blob/main/src/components/BusinessApp.tsx) (Business portal), [`src/components/CustomerApp.tsx`](https://github.com/dezmshibe/chowza/blob/main/src/components/CustomerApp.tsx) (Customer experience), [`src/lib/supabase.ts`](https://github.com/dezmshibe/chowza/blob/main/src/lib/supabase.ts) (Supabase client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App entry"]
  node_app["Route dispatcher<br/>[App.tsx]"]
  node_state["Shared app state<br/>[AppContext.tsx]"]
end

subgraph group_customer["Customer ordering"]
  node_customer_app["Customer experience<br/>[CustomerApp.tsx]"]
  node_store["Restaurant storefront<br/>[CustomerStore.tsx]"]
  node_cart["Cart and checkout"]
  node_public_store["Public business store"]
  node_public_checkout["Public checkout<br/>[PublicCheckout.tsx]"]
  node_confirmation["Order confirmation"]
  node_tracker["Order tracking<br/>[OrderTracker.tsx]"]
end

subgraph group_business["Business operations"]
  node_business_app["Business portal<br/>[BusinessApp.tsx]"]
  node_business_orders["Order management"]
  node_menu_manager["Menu management"]
  node_profile_manager["Business profile"]
  node_promotions["Promotions"]
  node_analytics["Sales analytics<br/>[AnalyticsView.tsx]"]
  node_admin["Administration<br/>[AdminApp.tsx]"]
end

subgraph group_backend["Data and services"]
  node_supabase_client["Supabase client<br/>[supabase.ts]"]
  node_supabase_store[("Supabase data services")]
  node_create_order["Order creation API<br/>[index.ts]"]
  node_track_api["Order tracking API<br/>[index.ts]"]
  node_payment_api["Payment endpoints<br/>[index.ts]"]
  node_payment_engine["Payment engine<br/>[payment-engine.ts]"]
  node_push_api["Push notifications<br/>[index.ts]"]
  node_whatsapp_api["WhatsApp connection<br/>[index.ts]"]
end

node_customer_actor(("Customer"))
node_business_actor(("Restaurant staff"))
node_admin_actor(("Platform admin"))
node_payment_providers{{"PayFast and Yoco"}}

node_app -->|"wraps"| node_state
node_app -->|"routes to"| node_customer_app
node_app -->|"routes to"| node_business_app
node_app -->|"routes to"| node_admin
node_customer_actor -.->|"opens"| node_app
node_business_actor -.->|"opens"| node_app
node_admin_actor -.->|"opens"| node_app
node_customer_app -->|"renders"| node_store
node_customer_app -->|"renders"| node_cart
node_customer_app -->|"renders"| node_tracker
node_state -->|"reads"| node_supabase_client
node_state -->|"loads data"| node_supabase_store
node_public_store -->|"reads"| node_supabase_client
node_public_store -->|"renders"| node_public_checkout
node_public_store -->|"renders"| node_confirmation
node_business_app -.->|"dispatches to"| node_business_orders
node_business_app -.->|"dispatches to"| node_menu_manager
node_business_app -.->|"dispatches to"| node_profile_manager
node_business_app -->|"uses"| node_supabase_client
node_admin -->|"uses"| node_supabase_client
node_business_actor -.->|"manages"| node_promotions
node_business_actor -.->|"reviews"| node_analytics
node_cart -.->|"submits order"| node_create_order
node_public_checkout -.->|"submits order"| node_create_order
node_tracker -.->|"requests status"| node_track_api
node_create_order -.->|"writes order"| node_supabase_store
node_payment_api -.->|"uses"| node_payment_engine
node_payment_api -.->|"creates payment"| node_payment_providers
node_push_api -.->|"uses data"| node_supabase_store
node_whatsapp_api -.->|"integrates"| node_payment_providers

click node_app "https://github.com/dezmshibe/chowza/blob/main/src/App.tsx"
click node_state "https://github.com/dezmshibe/chowza/blob/main/src/context/AppContext.tsx"
click node_customer_app "https://github.com/dezmshibe/chowza/blob/main/src/components/CustomerApp.tsx"
click node_store "https://github.com/dezmshibe/chowza/blob/main/src/components/CustomerStore.tsx"
click node_cart "https://github.com/dezmshibe/chowza/blob/main/src/components/CartBottomSheet.tsx"
click node_public_store "https://github.com/dezmshibe/chowza/blob/main/src/components/PublicBusinessStore.tsx"
click node_public_checkout "https://github.com/dezmshibe/chowza/blob/main/src/components/PublicCheckout.tsx"
click node_confirmation "https://github.com/dezmshibe/chowza/blob/main/src/components/OrderConfirmation.tsx"
click node_tracker "https://github.com/dezmshibe/chowza/blob/main/src/components/OrderTracker.tsx"
click node_business_app "https://github.com/dezmshibe/chowza/blob/main/src/components/BusinessApp.tsx"
click node_business_orders "https://github.com/dezmshibe/chowza/blob/main/src/components/BusinessOrdersManager.tsx"
click node_menu_manager "https://github.com/dezmshibe/chowza/blob/main/src/components/BusinessMenuManager.tsx"
click node_profile_manager "https://github.com/dezmshibe/chowza/blob/main/src/components/BusinessProfileManager.tsx"
click node_promotions "https://github.com/dezmshibe/chowza/blob/main/src/components/BusinessPromotionsManager.tsx"
click node_analytics "https://github.com/dezmshibe/chowza/blob/main/src/components/AnalyticsView.tsx"
click node_admin "https://github.com/dezmshibe/chowza/blob/main/src/components/AdminApp.tsx"
click node_supabase_client "https://github.com/dezmshibe/chowza/blob/main/src/lib/supabase.ts"
click node_create_order "https://github.com/dezmshibe/chowza/blob/main/supabase/functions/create-order/index.ts"
click node_track_api "https://github.com/dezmshibe/chowza/blob/main/supabase/functions/track-order/index.ts"
click node_payment_api "https://github.com/dezmshibe/chowza/blob/main/supabase/functions/create-payfast-payment/index.ts"
click node_payment_engine "https://github.com/dezmshibe/chowza/blob/main/supabase/functions/_shared/payment-engine.ts"
click node_push_api "https://github.com/dezmshibe/chowza/blob/main/supabase/functions/send-push-notification/index.ts"
click node_whatsapp_api "https://github.com/dezmshibe/chowza/blob/main/supabase/functions/whatsapp-connect/index.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_app,node_state toneBlue
class node_customer_app,node_store,node_cart,node_public_store,node_public_checkout,node_confirmation,node_tracker toneAmber
class node_business_app,node_business_orders,node_menu_manager,node_profile_manager,node_promotions,node_analytics,node_admin toneMint
class node_supabase_client,node_supabase_store,node_create_order,node_track_api,node_payment_api,node_payment_engine,node_push_api,node_whatsapp_api toneRose
class node_customer_actor,node_business_actor,node_admin_actor,node_payment_providers toneIndigo
```

## Components

### App entry

- [Route dispatcher](https://github.com/dezmshibe/chowza/blob/main/src/App.tsx): `src/App.tsx`
- [Shared app state](https://github.com/dezmshibe/chowza/blob/main/src/context/AppContext.tsx): `src/context/AppContext.tsx`

### Customer ordering

- [Customer experience](https://github.com/dezmshibe/chowza/blob/main/src/components/CustomerApp.tsx): `src/components/CustomerApp.tsx`
- [Restaurant storefront](https://github.com/dezmshibe/chowza/blob/main/src/components/CustomerStore.tsx): `src/components/CustomerStore.tsx`
- [Cart and checkout](https://github.com/dezmshibe/chowza/blob/main/src/components/CartBottomSheet.tsx): `src/components/CartBottomSheet.tsx`
- [Public business store](https://github.com/dezmshibe/chowza/blob/main/src/components/PublicBusinessStore.tsx): `src/components/PublicBusinessStore.tsx`
- [Public checkout](https://github.com/dezmshibe/chowza/blob/main/src/components/PublicCheckout.tsx): `src/components/PublicCheckout.tsx`
- [Order confirmation](https://github.com/dezmshibe/chowza/blob/main/src/components/OrderConfirmation.tsx): `src/components/OrderConfirmation.tsx`
- [Order tracking](https://github.com/dezmshibe/chowza/blob/main/src/components/OrderTracker.tsx): `src/components/OrderTracker.tsx`

### Business operations

- [Business portal](https://github.com/dezmshibe/chowza/blob/main/src/components/BusinessApp.tsx): `src/components/BusinessApp.tsx`
- [Order management](https://github.com/dezmshibe/chowza/blob/main/src/components/BusinessOrdersManager.tsx): `src/components/BusinessOrdersManager.tsx`
- [Menu management](https://github.com/dezmshibe/chowza/blob/main/src/components/BusinessMenuManager.tsx): `src/components/BusinessMenuManager.tsx`
- [Business profile](https://github.com/dezmshibe/chowza/blob/main/src/components/BusinessProfileManager.tsx): `src/components/BusinessProfileManager.tsx`
- [Promotions](https://github.com/dezmshibe/chowza/blob/main/src/components/BusinessPromotionsManager.tsx): `src/components/BusinessPromotionsManager.tsx`
- [Sales analytics](https://github.com/dezmshibe/chowza/blob/main/src/components/AnalyticsView.tsx): `src/components/AnalyticsView.tsx`
- [Administration](https://github.com/dezmshibe/chowza/blob/main/src/components/AdminApp.tsx): `src/components/AdminApp.tsx`

### Data and services

- [Supabase client](https://github.com/dezmshibe/chowza/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`
- **Supabase data services**
- [Order creation API](https://github.com/dezmshibe/chowza/blob/main/supabase/functions/create-order/index.ts): `supabase/functions/create-order/index.ts`
- [Order tracking API](https://github.com/dezmshibe/chowza/blob/main/supabase/functions/track-order/index.ts): `supabase/functions/track-order/index.ts`
- [Payment endpoints](https://github.com/dezmshibe/chowza/blob/main/supabase/functions/create-payfast-payment/index.ts): `supabase/functions/create-payfast-payment/index.ts`
- [Payment engine](https://github.com/dezmshibe/chowza/blob/main/supabase/functions/_shared/payment-engine.ts): `supabase/functions/_shared/payment-engine.ts`
- [Push notifications](https://github.com/dezmshibe/chowza/blob/main/supabase/functions/send-push-notification/index.ts): `supabase/functions/send-push-notification/index.ts`
- [WhatsApp connection](https://github.com/dezmshibe/chowza/blob/main/supabase/functions/whatsapp-connect/index.ts): `supabase/functions/whatsapp-connect/index.ts`

### Other components

- **Customer**
- **Restaurant staff**
- **Platform admin**
- **PayFast and Yoco**

## Connections

- Route dispatcher → Shared app state: wraps (evidence: `src/App.tsx`)
- Route dispatcher → Customer experience: routes to (evidence: `src/App.tsx`)
- Route dispatcher → Business portal: routes to (evidence: `src/App.tsx`)
- Route dispatcher → Administration: routes to (evidence: `src/App.tsx`)
- Customer → Route dispatcher: opens
- Restaurant staff → Route dispatcher: opens
- Platform admin → Route dispatcher: opens
- Customer experience → Restaurant storefront: renders (evidence: `src/components/CustomerApp.tsx`)
- Customer experience → Cart and checkout: renders (evidence: `src/components/CustomerApp.tsx`)
- Customer experience → Order tracking: renders (evidence: `src/components/CustomerApp.tsx`)
- Shared app state → Supabase client: reads (evidence: `src/context/AppContext.tsx`)
- Shared app state → Supabase data services: loads data (evidence: `src/context/AppContext.tsx`)
- Public business store → Supabase client: reads (evidence: `src/components/PublicBusinessStore.tsx`)
- Public business store → Public checkout: renders (evidence: `src/components/PublicBusinessStore.tsx`)
- Public business store → Order confirmation: renders (evidence: `src/components/PublicBusinessStore.tsx`)
- Business portal → Order management: dispatches to
- Business portal → Menu management: dispatches to
- Business portal → Business profile: dispatches to
- Business portal → Supabase client: uses (evidence: `src/components/BusinessApp.tsx`)
- Administration → Supabase client: uses (evidence: `src/components/AdminApp.tsx`)
- Restaurant staff → Promotions: manages
- Restaurant staff → Sales analytics: reviews
- Cart and checkout → Order creation API: submits order
- Public checkout → Order creation API: submits order
- Order tracking → Order tracking API: requests status
- Order creation API → Supabase data services: writes order
- Payment endpoints → Payment engine: uses
- Payment endpoints → PayFast and Yoco: creates payment
- Push notifications → Supabase data services: uses data
- WhatsApp connection → PayFast and Yoco: integrates
