# abourne18/smartdine architecture

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

- Interactive diagram: https://gitdiagram.com/abourne18/smartdine
- Repository: https://github.com/abourne18/smartdine

## Overview

SmartDine is a restaurant ordering and administration application. Customers scan a table QR code, browse menu categories, build a cart, submit or add to an order, and track or cancel it. Staff log in to manage tables and menu availability, monitor orders and update their statuses, and review daily revenue reports. The sampled frontend modules call a single Express API, which queries MySQL. The README is empty, and several modules are only partially excerpted, so the graph omits unverified links and does not imply details beyond the shown calls.

Main entry points: [`backend/server.js`](https://github.com/abourne18/smartdine/blob/main/backend/server.js) (Express API), [`frontend/js/pelanggan.js`](https://github.com/abourne18/smartdine/blob/main/frontend/js/pelanggan.js) (Menu and ordering), [`frontend/js/index.js`](https://github.com/abourne18/smartdine/blob/main/frontend/js/index.js) (QR table scan), [`frontend/js/admin-menu.js`](https://github.com/abourne18/smartdine/blob/main/frontend/js/admin-menu.js) (Tables and menu)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer["Customer ordering"]
  node_table_scan["QR table scan<br/>[index.js]"]
  node_customer_order["Menu and ordering<br/>[pelanggan.js]"]
end

subgraph group_admin["Staff administration"]
  node_staff_login["Staff login<br/>[login.js]"]
  node_admin_core["Dashboard and alerts<br/>[admin-core.js]"]
  node_admin_menu["Tables and menu<br/>[admin-menu.js]"]
  node_admin_orders["Orders and history<br/>[admin-orders.js]"]
  node_admin_report["Reports and QR<br/>[admin-report.js]"]
end

subgraph group_service["API and persistence"]
  node_api["Express API<br/>[server.js]"]
  node_mysql[("MySQL restaurant data<br/>[restoran.sql]")]
end

node_customer(("Restaurant customer"))
node_staff(("Restaurant staff"))

node_customer -.->|"scans QR"| node_table_scan
node_table_scan -->|"checks tables"| node_api
node_table_scan -->|"opens ordering"| node_customer_order
node_customer -.->|"places orders"| node_customer_order
node_customer_order -->|"loads menu and categories"| node_api
node_customer_order -->|"submits and updates orders"| node_api
node_staff -.->|"logs in"| node_staff_login
node_staff_login -->|"authenticates"| node_api
node_staff -.->|"uses dashboard"| node_admin_core
node_admin_core -->|"polls active orders"| node_api
node_admin_menu -->|"manages tables and menu"| node_api
node_admin_menu -->|"loads categories"| node_api
node_admin_orders -->|"loads orders and stats"| node_api
node_admin_orders -->|"updates order status"| node_api
node_admin_report -->|"loads daily reports"| node_api
node_admin_report -->|"manages categories and QR"| node_api
node_api -->|"queries restaurant data"| node_mysql

click node_table_scan "https://github.com/abourne18/smartdine/blob/main/frontend/js/index.js"
click node_customer_order "https://github.com/abourne18/smartdine/blob/main/frontend/js/pelanggan.js"
click node_staff_login "https://github.com/abourne18/smartdine/blob/main/frontend/js/login.js"
click node_admin_core "https://github.com/abourne18/smartdine/blob/main/frontend/js/admin-core.js"
click node_admin_menu "https://github.com/abourne18/smartdine/blob/main/frontend/js/admin-menu.js"
click node_admin_orders "https://github.com/abourne18/smartdine/blob/main/frontend/js/admin-orders.js"
click node_admin_report "https://github.com/abourne18/smartdine/blob/main/frontend/js/admin-report.js"
click node_api "https://github.com/abourne18/smartdine/blob/main/backend/server.js"
click node_mysql "https://github.com/abourne18/smartdine/blob/main/database/restoran.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_table_scan,node_customer_order toneBlue
class node_staff_login,node_admin_core,node_admin_menu,node_admin_orders,node_admin_report toneAmber
class node_api,node_mysql toneMint
class node_customer,node_staff toneIndigo
```

## Components

### Customer ordering

- [QR table scan](https://github.com/abourne18/smartdine/blob/main/frontend/js/index.js): `frontend/js/index.js`
- [Menu and ordering](https://github.com/abourne18/smartdine/blob/main/frontend/js/pelanggan.js): `frontend/js/pelanggan.js`

### Staff administration

- [Staff login](https://github.com/abourne18/smartdine/blob/main/frontend/js/login.js): `frontend/js/login.js`
- [Dashboard and alerts](https://github.com/abourne18/smartdine/blob/main/frontend/js/admin-core.js): `frontend/js/admin-core.js`
- [Tables and menu](https://github.com/abourne18/smartdine/blob/main/frontend/js/admin-menu.js): `frontend/js/admin-menu.js`
- [Orders and history](https://github.com/abourne18/smartdine/blob/main/frontend/js/admin-orders.js): `frontend/js/admin-orders.js`
- [Reports and QR](https://github.com/abourne18/smartdine/blob/main/frontend/js/admin-report.js): `frontend/js/admin-report.js`

### API and persistence

- [Express API](https://github.com/abourne18/smartdine/blob/main/backend/server.js): `backend/server.js`
- [MySQL restaurant data](https://github.com/abourne18/smartdine/blob/main/database/restoran.sql): `database/restoran.sql`

### Other components

- **Restaurant customer**
- **Restaurant staff**

## Connections

- Restaurant customer → QR table scan: scans QR
- QR table scan → Express API: checks tables (evidence: `frontend/js/index.js`)
- QR table scan → Menu and ordering: opens ordering (evidence: `frontend/js/index.js`)
- Restaurant customer → Menu and ordering: places orders
- Menu and ordering → Express API: loads menu and categories (evidence: `frontend/js/pelanggan.js`)
- Menu and ordering → Express API: submits and updates orders (evidence: `frontend/js/pelanggan.js`)
- Restaurant staff → Staff login: logs in
- Staff login → Express API: authenticates (evidence: `frontend/js/login.js`)
- Restaurant staff → Dashboard and alerts: uses dashboard
- Dashboard and alerts → Express API: polls active orders (evidence: `frontend/js/admin-core.js`)
- Tables and menu → Express API: manages tables and menu (evidence: `frontend/js/admin-menu.js`)
- Tables and menu → Express API: loads categories (evidence: `frontend/js/admin-menu.js`)
- Orders and history → Express API: loads orders and stats (evidence: `frontend/js/admin-orders.js`)
- Orders and history → Express API: updates order status (evidence: `frontend/js/admin-orders.js`)
- Reports and QR → Express API: loads daily reports (evidence: `frontend/js/admin-report.js`)
- Reports and QR → Express API: manages categories and QR (evidence: `frontend/js/admin-report.js`)
- Express API → MySQL restaurant data: queries restaurant data (evidence: `backend/server.js`)
