# olivzx/ns_gourmet_gestor_omega architecture

> Architecture diagram of the GitHub repository olivzx/ns_gourmet_gestor_omega, 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/olivzx/ns_gourmet_gestor_omega
- Repository: https://github.com/olivzx/ns_gourmet_gestor_omega

## Overview

NS Gourmet is a public digital menu and ordering portal. Customers browse and search products, add items to a cart, provide fulfillment and payment details, then submit an order and receive confirmation. The browser uses public menu and order endpoints; local development serves a file-backed demo, while the separate API handlers call Supabase RPCs when configured. The README also describes Omega integration and administrative, delivery, and reporting features as future plans, so they are not shown as implemented components. Edges reflect the excerpts and README; the SQL migrations were not sampled.

Main entry points: [`mock-server.js`](https://github.com/olivzx/ns_gourmet_gestor_omega/blob/main/mock-server.js) (Local demo server), [`pedido.html`](https://github.com/olivzx/ns_gourmet_gestor_omega/blob/main/pedido.html) (Menu page), [`pedido.js`](https://github.com/olivzx/ns_gourmet_gestor_omega/blob/main/pedido.js) (Browse and cart), [`lib/supabase.js`](https://github.com/olivzx/ns_gourmet_gestor_omega/blob/main/lib/supabase.js) (Supabase RPC client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer_ui["Customer portal"]
  node_page["Menu page<br/>[pedido.html]"]
  node_styles["Responsive layout<br/>[pedido.css]"]
  node_menu_cart["Browse and cart<br/>[pedido.js]"]
  node_checkout["Checkout and confirmation<br/>[pedido.js]"]
  node_catalog["Demo catalog<br/>[menu.json]"]
end

subgraph group_api["Public order API"]
  node_local_server["Local demo server<br/>[mock-server.js]"]
  node_menu_route["Menu endpoint<br/>[menu.js]"]
  node_order_route["Order endpoint<br/>[orders.js]"]
end

subgraph group_persistence["Order persistence"]
  node_rpc_client["Supabase RPC client<br/>[supabase.js]"]
  node_supabase[("Supabase database")]
  node_db_migrations["Public-order migrations"]
end

node_customer(("Customer"))

node_customer -->|"opens"| node_page
node_page -->|"uses styles"| node_styles
node_page -.->|"loads script"| node_menu_cart
node_menu_cart -->|"fetches menu"| node_local_server
node_local_server -->|"reads"| node_catalog
node_menu_cart -->|"opens checkout"| node_checkout
node_checkout -->|"submits order"| node_local_server
node_local_server -.->|"serves same path"| node_menu_route
node_local_server -.->|"serves same path"| node_order_route
node_menu_route -->|"calls RPC"| node_rpc_client
node_order_route -->|"calls RPC"| node_rpc_client
node_rpc_client -->|"sends RPC"| node_supabase
node_db_migrations -.->|"defines database changes"| node_supabase

click node_page "https://github.com/olivzx/ns_gourmet_gestor_omega/blob/main/pedido.html"
click node_styles "https://github.com/olivzx/ns_gourmet_gestor_omega/blob/main/pedido.css"
click node_menu_cart "https://github.com/olivzx/ns_gourmet_gestor_omega/blob/main/pedido.js"
click node_checkout "https://github.com/olivzx/ns_gourmet_gestor_omega/blob/main/pedido.js"
click node_catalog "https://github.com/olivzx/ns_gourmet_gestor_omega/blob/main/data/menu.json"
click node_local_server "https://github.com/olivzx/ns_gourmet_gestor_omega/blob/main/mock-server.js"
click node_menu_route "https://github.com/olivzx/ns_gourmet_gestor_omega/blob/main/api/public-order/menu.js"
click node_order_route "https://github.com/olivzx/ns_gourmet_gestor_omega/blob/main/api/public-order/orders.js"
click node_rpc_client "https://github.com/olivzx/ns_gourmet_gestor_omega/blob/main/lib/supabase.js"
click node_db_migrations "https://github.com/olivzx/ns_gourmet_gestor_omega/tree/main/supabase/migrations"

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_page,node_styles,node_menu_cart,node_checkout,node_catalog toneBlue
class node_local_server,node_menu_route,node_order_route toneAmber
class node_rpc_client,node_supabase,node_db_migrations toneMint
class node_customer toneIndigo
```

## Components

### Customer portal

- [Menu page](https://github.com/olivzx/ns_gourmet_gestor_omega/blob/main/pedido.html): `pedido.html`
- [Responsive layout](https://github.com/olivzx/ns_gourmet_gestor_omega/blob/main/pedido.css): `pedido.css`
- [Browse and cart](https://github.com/olivzx/ns_gourmet_gestor_omega/blob/main/pedido.js): `pedido.js`
- [Checkout and confirmation](https://github.com/olivzx/ns_gourmet_gestor_omega/blob/main/pedido.js): `pedido.js`
- [Demo catalog](https://github.com/olivzx/ns_gourmet_gestor_omega/blob/main/data/menu.json): `data/menu.json`

### Public order API

- [Local demo server](https://github.com/olivzx/ns_gourmet_gestor_omega/blob/main/mock-server.js): `mock-server.js`
- [Menu endpoint](https://github.com/olivzx/ns_gourmet_gestor_omega/blob/main/api/public-order/menu.js): `api/public-order/menu.js`
- [Order endpoint](https://github.com/olivzx/ns_gourmet_gestor_omega/blob/main/api/public-order/orders.js): `api/public-order/orders.js`

### Order persistence

- [Supabase RPC client](https://github.com/olivzx/ns_gourmet_gestor_omega/blob/main/lib/supabase.js): `lib/supabase.js`
- **Supabase database**
- [Public-order migrations](https://github.com/olivzx/ns_gourmet_gestor_omega/tree/main/supabase/migrations): `supabase/migrations`

### Other components

- **Customer**

## Connections

- Customer → Menu page: opens (evidence: `README.md`)
- Menu page → Responsive layout: uses styles (evidence: `README.md`)
- Menu page → Browse and cart: loads script
- Browse and cart → Local demo server: fetches menu (evidence: `pedido.js`)
- Local demo server → Demo catalog: reads (evidence: `mock-server.js`)
- Browse and cart → Checkout and confirmation: opens checkout (evidence: `pedido.js`)
- Checkout and confirmation → Local demo server: submits order (evidence: `pedido.js`)
- Local demo server → Menu endpoint: serves same path
- Local demo server → Order endpoint: serves same path
- Menu endpoint → Supabase RPC client: calls RPC (evidence: `api/public-order/menu.js`)
- Order endpoint → Supabase RPC client: calls RPC (evidence: `api/public-order/orders.js`)
- Supabase RPC client → Supabase database: sends RPC (evidence: `lib/supabase.js`)
- Public-order migrations → Supabase database: defines database changes
