# t0ff1xs/lanay-new-ui architecture

> Architecture diagram of the GitHub repository t0ff1xs/lanay-new-ui, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/t0ff1xs/lanay-new-ui
- Repository: https://github.com/t0ff1xs/lanay-new-ui

## Overview

Lanay is a PHP/MySQL restaurant system with a public catering and customer-request experience plus role-based staff stations. The main customer flow is browsing the public site, submitting catering or delivery requests, and exchanging messages; staff manage those requests and operational workflows through the JSON API. The README documents additional dine-in, kitchen, cashier, stock, driver, and owner capabilities. Connections reflect the sampled router/controller/model calls and README statements; several station and model implementations were not sampled, so their internal links are omitted.

Main entry points: [`core/Router.php`](https://github.com/t0ff1xs/lanay-new-ui/blob/main/core/Router.php) (API router), [`controllers/CustomerController.php`](https://github.com/t0ff1xs/lanay-new-ui/blob/main/controllers/CustomerController.php) (Customer requests), [`controllers/OwnerController.php`](https://github.com/t0ff1xs/lanay-new-ui/blob/main/controllers/OwnerController.php) (Owner operations), [`models/CateringModel.php`](https://github.com/t0ff1xs/lanay-new-ui/blob/main/models/CateringModel.php) (Catering inquiries)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Web entry points"]
  node_public_site["Public site<br/>[index.php]"]
  node_api["JSON API<br/>[api.php]"]
end

subgraph group_customer["Customer experience"]
  node_home_view["Catering page<br/>[home.php]"]
  node_customer_browser["Customer browser<br/>[customer.js]"]
  node_customer_controller["Customer requests"]
end

subgraph group_staff["Staff operations"]
  node_staff_pages["Staff stations<br/>[staff.php]"]
  node_station_scripts["Station scripts<br/>[common.js]"]
  node_owner_controller["Owner operations"]
  node_auth_controller["Staff authentication<br/>[AuthController.php]"]
  node_driver_controller["Driver operations"]
  node_order_controller["Orders"]
  node_cashier_controller["Payments"]
  node_stock_controller["Inventory"]
  node_kitchen_controller["Kitchen menu"]
end

subgraph group_domain["Domain and persistence"]
  node_catering_model["Catering inquiries<br/>[CateringModel.php]"]
  node_customer_model["Customer requests<br/>[CustomerModel.php]"]
  node_request_model["Request conversations"]
  node_driver_model["Delivery workflow<br/>[DriverModel.php]"]
  node_order_model["Order lifecycle<br/>[OrderModel.php]"]
  node_payment_model["Payment records<br/>[PaymentModel.php]"]
  node_staff_model["Staff accounts<br/>[StaffModel.php]"]
  node_bootstrap_model["Station data<br/>[BootstrapModel.php]"]
  node_database[("MySQL database")]
end

subgraph group_runtime["Request runtime"]
  node_router["API router<br/>[Router.php]"]
  node_request["Request parsing<br/>[Request.php]"]
  node_session["Session and access<br/>[Session.php]"]
  node_response["JSON responses<br/>[Response.php]"]
  node_controller_base["Controller base<br/>[Controller.php]"]
  node_view_renderer["View renderer<br/>[View.php]"]
end

node_visitor(("Customer or staff"))

node_visitor -->|"opens site"| node_public_site
node_public_site -->|"renders page"| node_home_view
node_visitor -->|"uses"| node_customer_browser
node_customer_browser -->|"submits requests"| node_api
node_staff_pages -.->|"loads scripts"| node_station_scripts
node_visitor -->|"opens stations"| node_staff_pages
node_station_scripts -->|"reads and writes"| node_api
node_api -->|"dispatches"| node_router
node_router -->|"reads method and action"| node_request
node_router -->|"checks access"| node_session
node_router -->|"routes requests"| node_customer_controller
node_router -->|"routes operations"| node_owner_controller
node_router -->|"routes sign-in"| node_auth_controller
node_router -->|"routes delivery"| node_driver_controller
node_router -->|"routes orders"| node_order_controller
node_router -->|"routes payments"| node_cashier_controller
node_router -->|"routes inventory"| node_stock_controller
node_router -->|"routes menu updates"| node_kitchen_controller
node_customer_controller -->|"creates inquiries"| node_catering_model
node_customer_controller -->|"handles requests"| node_customer_model
node_customer_controller -->|"reads and replies"| node_request_model
node_owner_controller -->|"creates and updates"| node_catering_model
node_owner_controller -->|"sends messages"| node_request_model
node_owner_controller -->|"manages accounts"| node_staff_model
node_auth_controller -->|"looks up staff"| node_staff_model
node_auth_controller -->|"signs in"| node_session
node_driver_controller -->|"updates deliveries"| node_driver_model
node_order_controller -->|"manages orders"| node_order_model
node_cashier_controller -->|"records payments"| node_payment_model
node_stock_controller -.->|"updates stock"| node_database
node_kitchen_controller -.->|"updates menu"| node_database
node_bootstrap_model -->|"loads messages"| node_request_model
node_bootstrap_model -->|"loads inquiry items"| node_catering_model
node_catering_model -->|"reads and writes"| node_database
node_bootstrap_model -->|"loads station data"| node_database
node_public_site -.->|"renders views"| node_view_renderer
node_view_renderer -->|"renders template"| node_home_view

click node_public_site "https://github.com/t0ff1xs/lanay-new-ui/blob/main/index.php"
click node_home_view "https://github.com/t0ff1xs/lanay-new-ui/blob/main/views/home.php"
click node_customer_browser "https://github.com/t0ff1xs/lanay-new-ui/blob/main/customer/customer.js"
click node_staff_pages "https://github.com/t0ff1xs/lanay-new-ui/blob/main/views/staff.php"
click node_station_scripts "https://github.com/t0ff1xs/lanay-new-ui/blob/main/js/common.js"
click node_api "https://github.com/t0ff1xs/lanay-new-ui/blob/main/api.php"
click node_router "https://github.com/t0ff1xs/lanay-new-ui/blob/main/core/Router.php"
click node_request "https://github.com/t0ff1xs/lanay-new-ui/blob/main/core/Request.php"
click node_session "https://github.com/t0ff1xs/lanay-new-ui/blob/main/core/Session.php"
click node_response "https://github.com/t0ff1xs/lanay-new-ui/blob/main/core/Response.php"
click node_controller_base "https://github.com/t0ff1xs/lanay-new-ui/blob/main/controllers/Controller.php"
click node_customer_controller "https://github.com/t0ff1xs/lanay-new-ui/blob/main/controllers/CustomerController.php"
click node_owner_controller "https://github.com/t0ff1xs/lanay-new-ui/blob/main/controllers/OwnerController.php"
click node_auth_controller "https://github.com/t0ff1xs/lanay-new-ui/blob/main/controllers/AuthController.php"
click node_driver_controller "https://github.com/t0ff1xs/lanay-new-ui/blob/main/controllers/DriverController.php"
click node_order_controller "https://github.com/t0ff1xs/lanay-new-ui/blob/main/controllers/OrderController.php"
click node_cashier_controller "https://github.com/t0ff1xs/lanay-new-ui/blob/main/controllers/CashierController.php"
click node_stock_controller "https://github.com/t0ff1xs/lanay-new-ui/blob/main/controllers/StockController.php"
click node_kitchen_controller "https://github.com/t0ff1xs/lanay-new-ui/blob/main/controllers/KitchenController.php"
click node_catering_model "https://github.com/t0ff1xs/lanay-new-ui/blob/main/models/CateringModel.php"
click node_customer_model "https://github.com/t0ff1xs/lanay-new-ui/blob/main/models/CustomerModel.php"
click node_request_model "https://github.com/t0ff1xs/lanay-new-ui/blob/main/models/CustomerRequestModel.php"
click node_driver_model "https://github.com/t0ff1xs/lanay-new-ui/blob/main/models/DriverModel.php"
click node_order_model "https://github.com/t0ff1xs/lanay-new-ui/blob/main/models/OrderModel.php"
click node_payment_model "https://github.com/t0ff1xs/lanay-new-ui/blob/main/models/PaymentModel.php"
click node_staff_model "https://github.com/t0ff1xs/lanay-new-ui/blob/main/models/StaffModel.php"
click node_bootstrap_model "https://github.com/t0ff1xs/lanay-new-ui/blob/main/models/BootstrapModel.php"
click node_view_renderer "https://github.com/t0ff1xs/lanay-new-ui/blob/main/core/View.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_public_site,node_api toneBlue
class node_home_view,node_customer_browser,node_customer_controller toneAmber
class node_staff_pages,node_station_scripts,node_owner_controller,node_auth_controller,node_driver_controller,node_order_controller,node_cashier_controller,node_stock_controller,node_kitchen_controller toneMint
class node_catering_model,node_customer_model,node_request_model,node_driver_model,node_order_model,node_payment_model,node_staff_model,node_bootstrap_model,node_database toneRose
class node_router,node_request,node_session,node_response,node_controller_base,node_view_renderer,node_visitor toneIndigo
```

## Components

### Web entry points

- [Public site](https://github.com/t0ff1xs/lanay-new-ui/blob/main/index.php): `index.php`
- [JSON API](https://github.com/t0ff1xs/lanay-new-ui/blob/main/api.php): `api.php`

### Customer experience

- [Catering page](https://github.com/t0ff1xs/lanay-new-ui/blob/main/views/home.php): `views/home.php`
- [Customer browser](https://github.com/t0ff1xs/lanay-new-ui/blob/main/customer/customer.js): `customer/customer.js`
- [Customer requests](https://github.com/t0ff1xs/lanay-new-ui/blob/main/controllers/CustomerController.php): `controllers/CustomerController.php`

### Staff operations

- [Staff stations](https://github.com/t0ff1xs/lanay-new-ui/blob/main/views/staff.php): `views/staff.php`
- [Station scripts](https://github.com/t0ff1xs/lanay-new-ui/blob/main/js/common.js): `js/common.js`
- [Owner operations](https://github.com/t0ff1xs/lanay-new-ui/blob/main/controllers/OwnerController.php): `controllers/OwnerController.php`
- [Staff authentication](https://github.com/t0ff1xs/lanay-new-ui/blob/main/controllers/AuthController.php): `controllers/AuthController.php`
- [Driver operations](https://github.com/t0ff1xs/lanay-new-ui/blob/main/controllers/DriverController.php): `controllers/DriverController.php`
- [Orders](https://github.com/t0ff1xs/lanay-new-ui/blob/main/controllers/OrderController.php): `controllers/OrderController.php`
- [Payments](https://github.com/t0ff1xs/lanay-new-ui/blob/main/controllers/CashierController.php): `controllers/CashierController.php`
- [Inventory](https://github.com/t0ff1xs/lanay-new-ui/blob/main/controllers/StockController.php): `controllers/StockController.php`
- [Kitchen menu](https://github.com/t0ff1xs/lanay-new-ui/blob/main/controllers/KitchenController.php): `controllers/KitchenController.php`

### Domain and persistence

- [Catering inquiries](https://github.com/t0ff1xs/lanay-new-ui/blob/main/models/CateringModel.php): `models/CateringModel.php`
- [Customer requests](https://github.com/t0ff1xs/lanay-new-ui/blob/main/models/CustomerModel.php): `models/CustomerModel.php`
- [Request conversations](https://github.com/t0ff1xs/lanay-new-ui/blob/main/models/CustomerRequestModel.php): `models/CustomerRequestModel.php`
- [Delivery workflow](https://github.com/t0ff1xs/lanay-new-ui/blob/main/models/DriverModel.php): `models/DriverModel.php`
- [Order lifecycle](https://github.com/t0ff1xs/lanay-new-ui/blob/main/models/OrderModel.php): `models/OrderModel.php`
- [Payment records](https://github.com/t0ff1xs/lanay-new-ui/blob/main/models/PaymentModel.php): `models/PaymentModel.php`
- [Staff accounts](https://github.com/t0ff1xs/lanay-new-ui/blob/main/models/StaffModel.php): `models/StaffModel.php`
- [Station data](https://github.com/t0ff1xs/lanay-new-ui/blob/main/models/BootstrapModel.php): `models/BootstrapModel.php`
- **MySQL database**

### Request runtime

- [API router](https://github.com/t0ff1xs/lanay-new-ui/blob/main/core/Router.php): `core/Router.php`
- [Request parsing](https://github.com/t0ff1xs/lanay-new-ui/blob/main/core/Request.php): `core/Request.php`
- [Session and access](https://github.com/t0ff1xs/lanay-new-ui/blob/main/core/Session.php): `core/Session.php`
- [JSON responses](https://github.com/t0ff1xs/lanay-new-ui/blob/main/core/Response.php): `core/Response.php`
- [Controller base](https://github.com/t0ff1xs/lanay-new-ui/blob/main/controllers/Controller.php): `controllers/Controller.php`
- [View renderer](https://github.com/t0ff1xs/lanay-new-ui/blob/main/core/View.php): `core/View.php`

### Other components

- **Customer or staff**

## Connections

- Customer or staff → Public site: opens site
- Public site → Catering page: renders page
- Customer or staff → Customer browser: uses
- Customer browser → JSON API: submits requests
- Staff stations → Station scripts: loads scripts
- Customer or staff → Staff stations: opens stations
- Station scripts → JSON API: reads and writes
- JSON API → API router: dispatches
- API router → Request parsing: reads method and action (evidence: `core/Router.php`)
- API router → Session and access: checks access (evidence: `core/Router.php`)
- API router → Customer requests: routes requests (evidence: `core/Router.php`)
- API router → Owner operations: routes operations (evidence: `core/Router.php`)
- API router → Staff authentication: routes sign-in (evidence: `core/Router.php`)
- API router → Driver operations: routes delivery (evidence: `core/Router.php`)
- API router → Orders: routes orders (evidence: `core/Router.php`)
- API router → Payments: routes payments (evidence: `core/Router.php`)
- API router → Inventory: routes inventory (evidence: `core/Router.php`)
- API router → Kitchen menu: routes menu updates (evidence: `core/Router.php`)
- Customer requests → Catering inquiries: creates inquiries (evidence: `controllers/CustomerController.php`)
- Customer requests → Customer requests: handles requests (evidence: `controllers/CustomerController.php`)
- Customer requests → Request conversations: reads and replies (evidence: `controllers/CustomerController.php`)
- Owner operations → Catering inquiries: creates and updates (evidence: `controllers/OwnerController.php`)
- Owner operations → Request conversations: sends messages (evidence: `controllers/OwnerController.php`)
- Owner operations → Staff accounts: manages accounts (evidence: `controllers/OwnerController.php`)
- Staff authentication → Staff accounts: looks up staff (evidence: `controllers/AuthController.php`)
- Staff authentication → Session and access: signs in (evidence: `controllers/AuthController.php`)
- Driver operations → Delivery workflow: updates deliveries (evidence: `controllers/DriverController.php`)
- Orders → Order lifecycle: manages orders (evidence: `controllers/OrderController.php`)
- Payments → Payment records: records payments (evidence: `controllers/CashierController.php`)
- Inventory → MySQL database: updates stock
- Kitchen menu → MySQL database: updates menu
- Station data → Request conversations: loads messages (evidence: `models/BootstrapModel.php`)
- Station data → Catering inquiries: loads inquiry items (evidence: `models/BootstrapModel.php`)
- Catering inquiries → MySQL database: reads and writes (evidence: `models/CateringModel.php`)
- Station data → MySQL database: loads station data (evidence: `models/BootstrapModel.php`)
- Public site → View renderer: renders views
- View renderer → Catering page: renders template (evidence: `views/home.php`)
