# swymmm/qr-code-menu- architecture

> Architecture diagram of the GitHub repository swymmm/qr-code-menu-, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/swymmm/qr-code-menu-
- Repository: https://github.com/swymmm/qr-code-menu-

## Overview

Food Mall QR Ordering is a Flask-based, table-aware food ordering demo. Guests scan a table QR, choose an outlet, browse its menu, build a cart, submit a mock-payment checkout, and track order status. Outlet staff manage kitchen order status; admins manage outlets and menu items. The sampled app.py excerpt shows SQLite-backed routes and checkout/order creation, while the README documents status tracking and admin capabilities whose route details are partly unsampled. QR generation is a separate utility that creates table-linked images.

Main entry points: [`app.py`](https://github.com/swymmm/qr-code-menu-/blob/main/app.py) (Flask routes), [`database.py`](https://github.com/swymmm/qr-code-menu-/blob/main/database.py) (Food mall database), [`templates/index.html`](https://github.com/swymmm/qr-code-menu-/blob/main/templates/index.html) (Outlet selection), [`templates/menu.html`](https://github.com/swymmm/qr-code-menu-/blob/main/templates/menu.html) (Menu browsing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_guest["Guest ordering"]
  node_app["Flask routes<br/>[app.py]"]
  node_welcome["Outlet selection<br/>[index.html]"]
  node_menu["Menu browsing<br/>[menu.html]"]
  node_cart["Cart<br/>[cart.html]"]
  node_checkout["Checkout<br/>[checkout.html]"]
  node_status["Order tracking<br/>[status.html]"]
end

subgraph group_operations["Order operations"]
  node_kitchen["Kitchen orders<br/>[kitchen.html]"]
  node_outlet_login["Outlet login<br/>[login.html]"]
end

subgraph group_management["Administration"]
  node_admin_login["Admin login<br/>[admin_login.html]"]
  node_admin_dashboard["Outlet and menu admin"]
end

subgraph group_data["Persistence and QR"]
  node_sqlite[("Food mall database<br/>[database.py]")]
  node_qr_generator["Table QR generator<br/>[generate_qr.py]"]
  node_qr_images["Generated table QRs"]
end

node_guest_actor(("Guest"))
node_staff_actor(("Outlet staff"))
node_admin_actor(("Administrator"))

node_guest_actor -->|"opens table link"| node_app
node_app -->|"reads outlets"| node_sqlite
node_app -->|"renders selection"| node_welcome
node_welcome -->|"chooses outlet"| node_app
node_app -->|"reads menu"| node_sqlite
node_app -->|"renders menu"| node_menu
node_menu -->|"adds items"| node_app
node_app -->|"renders cart"| node_cart
node_cart -->|"requests checkout"| node_app
node_app -->|"renders checkout"| node_checkout
node_checkout -->|"submits order"| node_app
node_app -->|"writes order and payment"| node_sqlite
node_app -->|"reads order status"| node_sqlite
node_app -->|"renders tracking"| node_status
node_staff_actor -->|"signs in"| node_outlet_login
node_outlet_login -->|"submits credentials"| node_app
node_app -->|"reads kitchen orders"| node_sqlite
node_app -->|"renders orders"| node_kitchen
node_kitchen -->|"updates status"| node_app
node_app -->|"updates order"| node_sqlite
node_admin_actor -->|"signs in"| node_admin_login
node_admin_login -->|"submits credentials"| node_app
node_app -->|"reads and changes catalog"| node_sqlite
node_app -->|"renders administration"| node_admin_dashboard
node_admin_dashboard -->|"manages catalog"| node_app
node_qr_generator -->|"writes QR images"| node_qr_images

click node_app "https://github.com/swymmm/qr-code-menu-/blob/main/app.py"
click node_welcome "https://github.com/swymmm/qr-code-menu-/blob/main/templates/index.html"
click node_menu "https://github.com/swymmm/qr-code-menu-/blob/main/templates/menu.html"
click node_cart "https://github.com/swymmm/qr-code-menu-/blob/main/templates/cart.html"
click node_checkout "https://github.com/swymmm/qr-code-menu-/blob/main/templates/checkout.html"
click node_status "https://github.com/swymmm/qr-code-menu-/blob/main/templates/status.html"
click node_kitchen "https://github.com/swymmm/qr-code-menu-/blob/main/templates/kitchen.html"
click node_outlet_login "https://github.com/swymmm/qr-code-menu-/blob/main/templates/login.html"
click node_admin_login "https://github.com/swymmm/qr-code-menu-/blob/main/templates/admin_login.html"
click node_admin_dashboard "https://github.com/swymmm/qr-code-menu-/blob/main/templates/outlet_dashboard.html"
click node_sqlite "https://github.com/swymmm/qr-code-menu-/blob/main/database.py"
click node_qr_generator "https://github.com/swymmm/qr-code-menu-/blob/main/generate_qr.py"
click node_qr_images "https://github.com/swymmm/qr-code-menu-/tree/main/static/qr"

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_welcome,node_menu,node_cart,node_checkout,node_status toneBlue
class node_kitchen,node_outlet_login toneAmber
class node_admin_login,node_admin_dashboard toneMint
class node_sqlite,node_qr_generator,node_qr_images toneRose
class node_guest_actor,node_staff_actor,node_admin_actor toneIndigo
```

## Components

### Guest ordering

- [Flask routes](https://github.com/swymmm/qr-code-menu-/blob/main/app.py): `app.py`
- [Outlet selection](https://github.com/swymmm/qr-code-menu-/blob/main/templates/index.html): `templates/index.html`
- [Menu browsing](https://github.com/swymmm/qr-code-menu-/blob/main/templates/menu.html): `templates/menu.html`
- [Cart](https://github.com/swymmm/qr-code-menu-/blob/main/templates/cart.html): `templates/cart.html`
- [Checkout](https://github.com/swymmm/qr-code-menu-/blob/main/templates/checkout.html): `templates/checkout.html`
- [Order tracking](https://github.com/swymmm/qr-code-menu-/blob/main/templates/status.html): `templates/status.html`

### Order operations

- [Kitchen orders](https://github.com/swymmm/qr-code-menu-/blob/main/templates/kitchen.html): `templates/kitchen.html`
- [Outlet login](https://github.com/swymmm/qr-code-menu-/blob/main/templates/login.html): `templates/login.html`

### Administration

- [Admin login](https://github.com/swymmm/qr-code-menu-/blob/main/templates/admin_login.html): `templates/admin_login.html`
- [Outlet and menu admin](https://github.com/swymmm/qr-code-menu-/blob/main/templates/outlet_dashboard.html): `templates/outlet_dashboard.html`

### Persistence and QR

- [Food mall database](https://github.com/swymmm/qr-code-menu-/blob/main/database.py): `database.py`
- [Table QR generator](https://github.com/swymmm/qr-code-menu-/blob/main/generate_qr.py): `generate_qr.py`
- [Generated table QRs](https://github.com/swymmm/qr-code-menu-/tree/main/static/qr): `static/qr`

### Other components

- **Guest**
- **Outlet staff**
- **Administrator**

## Connections

- Guest → Flask routes: opens table link
- Flask routes → Food mall database: reads outlets
- Flask routes → Outlet selection: renders selection
- Outlet selection → Flask routes: chooses outlet
- Flask routes → Food mall database: reads menu
- Flask routes → Menu browsing: renders menu
- Menu browsing → Flask routes: adds items
- Flask routes → Cart: renders cart
- Cart → Flask routes: requests checkout
- Flask routes → Checkout: renders checkout
- Checkout → Flask routes: submits order
- Flask routes → Food mall database: writes order and payment
- Flask routes → Food mall database: reads order status
- Flask routes → Order tracking: renders tracking
- Outlet staff → Outlet login: signs in
- Outlet login → Flask routes: submits credentials
- Flask routes → Food mall database: reads kitchen orders
- Flask routes → Kitchen orders: renders orders
- Kitchen orders → Flask routes: updates status
- Flask routes → Food mall database: updates order
- Administrator → Admin login: signs in
- Admin login → Flask routes: submits credentials
- Flask routes → Food mall database: reads and changes catalog
- Flask routes → Outlet and menu admin: renders administration
- Outlet and menu admin → Flask routes: manages catalog
- Table QR generator → Generated table QRs: writes QR images
