# gordomamon-jpg/zabisu architecture

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

- Interactive diagram: https://gitdiagram.com/gordomamon-jpg/zabisu
- Repository: https://github.com/gordomamon-jpg/zabisu

## Overview

Zabisu is a restaurant ordering and operations application. Customers view the published menu, configure an order, and proceed through separate payment, confirmation, and status pages; restaurant staff manage menus and orders and use operational, inventory, finance, and reporting tools. WhatsApp supports a documented customer channel and a separate webhook/API integration. The excerpts establish selected include relationships, but not all page-to-page transitions or database wiring, so those connections are omitted rather than inferred.

Main entry points: [`restaurante/nuevo_pedido.php`](https://github.com/gordomamon-jpg/zabisu/blob/main/restaurante/nuevo_pedido.php) (Staff order entry), [`cliente/pedido.php`](https://github.com/gordomamon-jpg/zabisu/blob/main/cliente/pedido.php) (Order capture), [`restaurante/auth_check.php`](https://github.com/gordomamon-jpg/zabisu/blob/main/restaurante/auth_check.php) (Staff authorization), [`includes/menu_programado.php`](https://github.com/gordomamon-jpg/zabisu/blob/main/includes/menu_programado.php) (Scheduled menus)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer["Customer ordering"]
  node_menu["Daily menu<br/>[menu.php]"]
  node_order["Order capture<br/>[pedido.php]"]
  node_payment["Payment<br/>[pago.php]"]
  node_confirmation["Order confirmation<br/>[confirmar.php]"]
  node_order_status["Order status<br/>[estado_pedido.php]"]
  node_feedback["Customer feedback"]
  node_suggestion["Menu suggestions"]
end

subgraph group_restaurant["Restaurant operations"]
  node_staff_orders["Order operations<br/>[pedidos.php]"]
  node_staff_order_entry["Staff order entry<br/>[nuevo_pedido.php]"]
  node_menus["Menu management<br/>[menus.php]"]
  node_inventory["Inventory<br/>[inventario.php]"]
  node_finance["Finance and expenses<br/>[finanzas.php]"]
  node_sales_reports["Sales reporting<br/>[reporte_ventas.php]"]
  node_quotes["Quotations<br/>[cotizaciones.php]"]
  node_surveys["Surveys<br/>[encuestas.php]"]
  node_broadcast["Customer outreach<br/>[difusion.php]"]
end

subgraph group_shared["Shared runtime"]
  node_scheduled_menu["Scheduled menus"]
  node_dish_options["Dish options<br/>[opciones_plato.php]"]
  node_natural_water["Natural water rules<br/>[agua_natural.php]"]
  node_security["Session security<br/>[seguridad.php]"]
  node_admin_auth["Staff authorization<br/>[auth_check.php]"]
end

subgraph group_messaging["Messaging integrations"]
  node_whatsapp_api["WhatsApp API<br/>[whatsapp_api.php]"]
  node_whatsapp_webhook["WhatsApp webhook<br/>[whatsapp.php]"]
  node_whatsapp_service["WhatsApp service<br/>[server.js]"]
  node_whatsapp_channel["WhatsApp channel<br/>[canal_whatsapp.php]"]
end

node_customer(("Customer"))
node_admin(("Restaurant staff"))
node_whatsapp{{"WhatsApp"}}

node_customer -->|"views menu"| node_menu
node_customer -->|"places order"| node_order
node_admin -->|"manages orders"| node_staff_orders
node_admin -->|"manages menus"| node_menus
node_admin -->|"manages stock"| node_inventory
node_admin -->|"reviews finances"| node_finance
node_admin -->|"reviews sales"| node_sales_reports
node_admin -->|"manages quotes"| node_quotes
node_admin -->|"reviews surveys"| node_surveys
node_admin -->|"sends outreach"| node_broadcast
node_menu -->|"activates schedule"| node_scheduled_menu
node_order -->|"activates schedule"| node_scheduled_menu
node_order -->|"uses options"| node_dish_options
node_order -->|"uses water rules"| node_natural_water
node_staff_order_entry -->|"uses schedule"| node_scheduled_menu
node_staff_order_entry -->|"uses options"| node_dish_options
node_staff_order_entry -->|"uses water rules"| node_natural_water
node_staff_order_entry -->|"checks access"| node_admin_auth
node_staff_orders -->|"checks access"| node_admin_auth
node_menus -->|"checks access"| node_admin_auth
node_admin_auth -->|"calls security"| node_security
node_whatsapp_webhook -->|"uses API"| node_whatsapp_api
node_whatsapp_channel -.->|"links channel"| node_whatsapp

click node_menu "https://github.com/gordomamon-jpg/zabisu/blob/main/cliente/menu.php"
click node_order "https://github.com/gordomamon-jpg/zabisu/blob/main/cliente/pedido.php"
click node_payment "https://github.com/gordomamon-jpg/zabisu/blob/main/cliente/pago.php"
click node_confirmation "https://github.com/gordomamon-jpg/zabisu/blob/main/cliente/confirmar.php"
click node_order_status "https://github.com/gordomamon-jpg/zabisu/blob/main/cliente/estado_pedido.php"
click node_feedback "https://github.com/gordomamon-jpg/zabisu/blob/main/cliente/guardar_feedback.php"
click node_suggestion "https://github.com/gordomamon-jpg/zabisu/blob/main/cliente/guardar_sugerencia.php"
click node_staff_orders "https://github.com/gordomamon-jpg/zabisu/blob/main/restaurante/pedidos.php"
click node_staff_order_entry "https://github.com/gordomamon-jpg/zabisu/blob/main/restaurante/nuevo_pedido.php"
click node_menus "https://github.com/gordomamon-jpg/zabisu/blob/main/restaurante/menus.php"
click node_inventory "https://github.com/gordomamon-jpg/zabisu/blob/main/restaurante/inventario.php"
click node_finance "https://github.com/gordomamon-jpg/zabisu/blob/main/restaurante/finanzas.php"
click node_sales_reports "https://github.com/gordomamon-jpg/zabisu/blob/main/restaurante/reporte_ventas.php"
click node_quotes "https://github.com/gordomamon-jpg/zabisu/blob/main/restaurante/cotizaciones.php"
click node_surveys "https://github.com/gordomamon-jpg/zabisu/blob/main/restaurante/encuestas.php"
click node_broadcast "https://github.com/gordomamon-jpg/zabisu/blob/main/restaurante/difusion.php"
click node_scheduled_menu "https://github.com/gordomamon-jpg/zabisu/blob/main/includes/menu_programado.php"
click node_dish_options "https://github.com/gordomamon-jpg/zabisu/blob/main/includes/opciones_plato.php"
click node_natural_water "https://github.com/gordomamon-jpg/zabisu/blob/main/includes/agua_natural.php"
click node_security "https://github.com/gordomamon-jpg/zabisu/blob/main/includes/seguridad.php"
click node_admin_auth "https://github.com/gordomamon-jpg/zabisu/blob/main/restaurante/auth_check.php"
click node_whatsapp_api "https://github.com/gordomamon-jpg/zabisu/blob/main/includes/whatsapp_api.php"
click node_whatsapp_webhook "https://github.com/gordomamon-jpg/zabisu/blob/main/webhooks/whatsapp.php"
click node_whatsapp_service "https://github.com/gordomamon-jpg/zabisu/blob/main/wa-service/server.js"
click node_whatsapp_channel "https://github.com/gordomamon-jpg/zabisu/blob/main/includes/canal_whatsapp.php"

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,node_order,node_payment,node_confirmation,node_order_status,node_feedback,node_suggestion toneBlue
class node_staff_orders,node_staff_order_entry,node_menus,node_inventory,node_finance,node_sales_reports,node_quotes,node_surveys,node_broadcast toneAmber
class node_scheduled_menu,node_dish_options,node_natural_water,node_security,node_admin_auth toneMint
class node_whatsapp_api,node_whatsapp_webhook,node_whatsapp_service,node_whatsapp_channel toneRose
class node_customer,node_admin,node_whatsapp toneIndigo
```

## Components

### Customer ordering

- [Daily menu](https://github.com/gordomamon-jpg/zabisu/blob/main/cliente/menu.php): `cliente/menu.php`
- [Order capture](https://github.com/gordomamon-jpg/zabisu/blob/main/cliente/pedido.php): `cliente/pedido.php`
- [Payment](https://github.com/gordomamon-jpg/zabisu/blob/main/cliente/pago.php): `cliente/pago.php`
- [Order confirmation](https://github.com/gordomamon-jpg/zabisu/blob/main/cliente/confirmar.php): `cliente/confirmar.php`
- [Order status](https://github.com/gordomamon-jpg/zabisu/blob/main/cliente/estado_pedido.php): `cliente/estado_pedido.php`
- [Customer feedback](https://github.com/gordomamon-jpg/zabisu/blob/main/cliente/guardar_feedback.php): `cliente/guardar_feedback.php`
- [Menu suggestions](https://github.com/gordomamon-jpg/zabisu/blob/main/cliente/guardar_sugerencia.php): `cliente/guardar_sugerencia.php`

### Restaurant operations

- [Order operations](https://github.com/gordomamon-jpg/zabisu/blob/main/restaurante/pedidos.php): `restaurante/pedidos.php`
- [Staff order entry](https://github.com/gordomamon-jpg/zabisu/blob/main/restaurante/nuevo_pedido.php): `restaurante/nuevo_pedido.php`
- [Menu management](https://github.com/gordomamon-jpg/zabisu/blob/main/restaurante/menus.php): `restaurante/menus.php`
- [Inventory](https://github.com/gordomamon-jpg/zabisu/blob/main/restaurante/inventario.php): `restaurante/inventario.php`
- [Finance and expenses](https://github.com/gordomamon-jpg/zabisu/blob/main/restaurante/finanzas.php): `restaurante/finanzas.php`
- [Sales reporting](https://github.com/gordomamon-jpg/zabisu/blob/main/restaurante/reporte_ventas.php): `restaurante/reporte_ventas.php`
- [Quotations](https://github.com/gordomamon-jpg/zabisu/blob/main/restaurante/cotizaciones.php): `restaurante/cotizaciones.php`
- [Surveys](https://github.com/gordomamon-jpg/zabisu/blob/main/restaurante/encuestas.php): `restaurante/encuestas.php`
- [Customer outreach](https://github.com/gordomamon-jpg/zabisu/blob/main/restaurante/difusion.php): `restaurante/difusion.php`

### Shared runtime

- [Scheduled menus](https://github.com/gordomamon-jpg/zabisu/blob/main/includes/menu_programado.php): `includes/menu_programado.php`
- [Dish options](https://github.com/gordomamon-jpg/zabisu/blob/main/includes/opciones_plato.php): `includes/opciones_plato.php`
- [Natural water rules](https://github.com/gordomamon-jpg/zabisu/blob/main/includes/agua_natural.php): `includes/agua_natural.php`
- [Session security](https://github.com/gordomamon-jpg/zabisu/blob/main/includes/seguridad.php): `includes/seguridad.php`
- [Staff authorization](https://github.com/gordomamon-jpg/zabisu/blob/main/restaurante/auth_check.php): `restaurante/auth_check.php`

### Messaging integrations

- [WhatsApp API](https://github.com/gordomamon-jpg/zabisu/blob/main/includes/whatsapp_api.php): `includes/whatsapp_api.php`
- [WhatsApp webhook](https://github.com/gordomamon-jpg/zabisu/blob/main/webhooks/whatsapp.php): `webhooks/whatsapp.php`
- [WhatsApp service](https://github.com/gordomamon-jpg/zabisu/blob/main/wa-service/server.js): `wa-service/server.js`
- [WhatsApp channel](https://github.com/gordomamon-jpg/zabisu/blob/main/includes/canal_whatsapp.php): `includes/canal_whatsapp.php`

### Other components

- **Customer**
- **Restaurant staff**
- **WhatsApp**

## Connections

- Customer → Daily menu: views menu
- Customer → Order capture: places order
- Restaurant staff → Order operations: manages orders
- Restaurant staff → Menu management: manages menus
- Restaurant staff → Inventory: manages stock
- Restaurant staff → Finance and expenses: reviews finances
- Restaurant staff → Sales reporting: reviews sales
- Restaurant staff → Quotations: manages quotes
- Restaurant staff → Surveys: reviews surveys
- Restaurant staff → Customer outreach: sends outreach
- Daily menu → Scheduled menus: activates schedule (evidence: `cliente/menu.php`)
- Order capture → Scheduled menus: activates schedule (evidence: `cliente/pedido.php`)
- Order capture → Dish options: uses options (evidence: `cliente/pedido.php`)
- Order capture → Natural water rules: uses water rules (evidence: `cliente/pedido.php`)
- Staff order entry → Scheduled menus: uses schedule (evidence: `restaurante/nuevo_pedido.php`)
- Staff order entry → Dish options: uses options (evidence: `restaurante/nuevo_pedido.php`)
- Staff order entry → Natural water rules: uses water rules (evidence: `restaurante/nuevo_pedido.php`)
- Staff order entry → Staff authorization: checks access (evidence: `restaurante/nuevo_pedido.php`)
- Order operations → Staff authorization: checks access (evidence: `restaurante/pedidos.php`)
- Menu management → Staff authorization: checks access
- Staff authorization → Session security: calls security (evidence: `restaurante/auth_check.php`)
- WhatsApp webhook → WhatsApp API: uses API (evidence: `webhooks/whatsapp.php`)
- WhatsApp channel → WhatsApp: links channel (evidence: `includes/canal_whatsapp.php`)
