# bin20599/uongbigo-vercel architecture

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

- Interactive diagram: https://gitdiagram.com/bin20599/uongbigo-vercel
- Repository: https://github.com/bin20599/uongbigo-vercel

## Overview

Uong Bi GO is a Vietnamese food-ordering application with browser-based buyer, staff, and admin screens, a Python API, and Supabase Postgres. The intended buyer journey is browsing the menu, managing a cart, placing an order, and paying; staff handle kitchen status and admins manage menu items and view statistics. The sampled frontend helper and backend excerpt show different API modes, so frontend-to-endpoint wiring is not asserted here; the README documents the deployed Vercel/Supabase architecture.

Main entry points: [`api/index.py`](https://github.com/bin20599/uongbigo-vercel/blob/main/api/index.py) (API router), [`supabase.sql`](https://github.com/bin20599/uongbigo-vercel/blob/main/supabase.sql) (Supabase Postgres), [`js/api.js`](https://github.com/bin20599/uongbigo-vercel/blob/main/js/api.js) (API client), [`menu.html`](https://github.com/bin20599/uongbigo-vercel/blob/main/menu.html) (Menu screen)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Browser screens"]
  node_menu_screen["Menu screen<br/>[menu.html]"]
  node_cart_screen["Cart screen<br/>[cart.html]"]
  node_orders_screen["Order history<br/>[orders.html]"]
  node_kds_screen["Kitchen screen<br/>[kds.html]"]
  node_admin_dashboard["Admin dashboard<br/>[dashboard.html]"]
  node_admin_menu["Menu management"]
  node_admin_orders["Admin orders<br/>[orders.html]"]
  node_cart_logic["Cart state<br/>[cart.js]"]
  node_api_client["API client<br/>[api.js]"]
end

subgraph group_backend["API domains"]
  node_api_handler["API router<br/>[index.py]"]
  node_auth["Authentication<br/>[index.py]"]
  node_menu_domain["Menu operations<br/>[index.py]"]
  node_orders_domain["Order operations<br/>[index.py]"]
  node_payment["QR payment<br/>[index.py]"]
  node_kds_domain["Kitchen updates<br/>[index.py]"]
  node_admin_domain["Admin operations<br/>[index.py]"]
end

subgraph group_data["Persistence"]
  node_supabase[("Supabase Postgres<br/>[supabase.sql]")]
end

node_buyer(("Buyer"))

node_buyer -->|"browses"| node_menu_screen
node_buyer -->|"orders through"| node_cart_screen
node_api_client -->|"requests API"| node_api_handler
node_api_handler -->|"dispatches"| node_auth
node_api_handler -->|"dispatches"| node_menu_domain
node_api_handler -->|"dispatches"| node_orders_domain
node_api_handler -->|"dispatches"| node_payment
node_api_handler -->|"dispatches"| node_kds_domain
node_api_handler -->|"dispatches"| node_admin_domain
node_auth -->|"reads users"| node_supabase
node_menu_domain -->|"reads menu"| node_supabase
node_orders_domain -->|"reads/writes orders"| node_supabase
node_payment -->|"updates orders"| node_supabase
node_kds_domain -->|"updates menu"| node_supabase
node_admin_domain -->|"reads/writes data"| node_supabase

click node_menu_screen "https://github.com/bin20599/uongbigo-vercel/blob/main/menu.html"
click node_cart_screen "https://github.com/bin20599/uongbigo-vercel/blob/main/cart.html"
click node_orders_screen "https://github.com/bin20599/uongbigo-vercel/blob/main/orders.html"
click node_kds_screen "https://github.com/bin20599/uongbigo-vercel/blob/main/kds.html"
click node_admin_dashboard "https://github.com/bin20599/uongbigo-vercel/blob/main/admin/dashboard.html"
click node_admin_menu "https://github.com/bin20599/uongbigo-vercel/blob/main/admin/menu-management.html"
click node_admin_orders "https://github.com/bin20599/uongbigo-vercel/blob/main/admin/orders.html"
click node_cart_logic "https://github.com/bin20599/uongbigo-vercel/blob/main/js/cart.js"
click node_api_client "https://github.com/bin20599/uongbigo-vercel/blob/main/js/api.js"
click node_api_handler "https://github.com/bin20599/uongbigo-vercel/blob/main/api/index.py"
click node_auth "https://github.com/bin20599/uongbigo-vercel/blob/main/api/index.py"
click node_menu_domain "https://github.com/bin20599/uongbigo-vercel/blob/main/api/index.py"
click node_orders_domain "https://github.com/bin20599/uongbigo-vercel/blob/main/api/index.py"
click node_payment "https://github.com/bin20599/uongbigo-vercel/blob/main/api/index.py"
click node_kds_domain "https://github.com/bin20599/uongbigo-vercel/blob/main/api/index.py"
click node_admin_domain "https://github.com/bin20599/uongbigo-vercel/blob/main/api/index.py"
click node_supabase "https://github.com/bin20599/uongbigo-vercel/blob/main/supabase.sql"

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_menu_screen,node_cart_screen,node_orders_screen,node_kds_screen,node_admin_dashboard,node_admin_menu,node_admin_orders,node_cart_logic,node_api_client toneBlue
class node_api_handler,node_auth,node_menu_domain,node_orders_domain,node_payment,node_kds_domain,node_admin_domain toneAmber
class node_supabase toneMint
class node_buyer toneIndigo
```

## Components

### Browser screens

- [Menu screen](https://github.com/bin20599/uongbigo-vercel/blob/main/menu.html): `menu.html`
- [Cart screen](https://github.com/bin20599/uongbigo-vercel/blob/main/cart.html): `cart.html`
- [Order history](https://github.com/bin20599/uongbigo-vercel/blob/main/orders.html): `orders.html`
- [Kitchen screen](https://github.com/bin20599/uongbigo-vercel/blob/main/kds.html): `kds.html`
- [Admin dashboard](https://github.com/bin20599/uongbigo-vercel/blob/main/admin/dashboard.html): `admin/dashboard.html`
- [Menu management](https://github.com/bin20599/uongbigo-vercel/blob/main/admin/menu-management.html): `admin/menu-management.html`
- [Admin orders](https://github.com/bin20599/uongbigo-vercel/blob/main/admin/orders.html): `admin/orders.html`
- [Cart state](https://github.com/bin20599/uongbigo-vercel/blob/main/js/cart.js): `js/cart.js`
- [API client](https://github.com/bin20599/uongbigo-vercel/blob/main/js/api.js): `js/api.js`

### API domains

- [API router](https://github.com/bin20599/uongbigo-vercel/blob/main/api/index.py): `api/index.py`
- [Authentication](https://github.com/bin20599/uongbigo-vercel/blob/main/api/index.py): `api/index.py`
- [Menu operations](https://github.com/bin20599/uongbigo-vercel/blob/main/api/index.py): `api/index.py`
- [Order operations](https://github.com/bin20599/uongbigo-vercel/blob/main/api/index.py): `api/index.py`
- [QR payment](https://github.com/bin20599/uongbigo-vercel/blob/main/api/index.py): `api/index.py`
- [Kitchen updates](https://github.com/bin20599/uongbigo-vercel/blob/main/api/index.py): `api/index.py`
- [Admin operations](https://github.com/bin20599/uongbigo-vercel/blob/main/api/index.py): `api/index.py`

### Persistence

- [Supabase Postgres](https://github.com/bin20599/uongbigo-vercel/blob/main/supabase.sql): `supabase.sql`

### Other components

- **Buyer**

## Connections

- Buyer → Menu screen: browses (evidence: `README.md`)
- Buyer → Cart screen: orders through (evidence: `README.md`)
- API client → API router: requests API
- API router → Authentication: dispatches (evidence: `api/index.py`)
- API router → Menu operations: dispatches (evidence: `api/index.py`)
- API router → Order operations: dispatches (evidence: `api/index.py`)
- API router → QR payment: dispatches (evidence: `api/index.py`)
- API router → Kitchen updates: dispatches (evidence: `api/index.py`)
- API router → Admin operations: dispatches (evidence: `api/index.py`)
- Authentication → Supabase Postgres: reads users (evidence: `api/index.py`)
- Menu operations → Supabase Postgres: reads menu (evidence: `api/index.py`)
- Order operations → Supabase Postgres: reads/writes orders (evidence: `api/index.py`)
- QR payment → Supabase Postgres: updates orders (evidence: `api/index.py`)
- Kitchen updates → Supabase Postgres: updates menu (evidence: `api/index.py`)
- Admin operations → Supabase Postgres: reads/writes data (evidence: `api/index.py`)
