# x11kifz/coffeeshopmanagement architecture

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

- Interactive diagram: https://gitdiagram.com/x11kifz/coffeeshopmanagement
- Repository: https://github.com/x11kifz/coffeeshopmanagement

## Overview

Kanit is a coffee-shop web application with customer-facing pages and staff-oriented menu, order, stock, and attendance functions. The visible server workflow serves pages, handles registration and login with session-based access checks, and exposes API operations that read and write MySQL data. Menu and order management, along with staff attendance, are distinct domain areas. The source excerpts show server routes and database queries, but not the browser pages’ API calls or the implementations of every page route; those connections are therefore not inferred.

Main entry points: [`server/index.js`](https://github.com/x11kifz/coffeeshopmanagement/blob/main/server/index.js) (Express app), [`server/public/index.html`](https://github.com/x11kifz/coffeeshopmanagement/blob/main/server/public/index.html) (Home page), [`server/public/login.html`](https://github.com/x11kifz/coffeeshopmanagement/blob/main/server/public/login.html) (Login page), [`server/public/register.html`](https://github.com/x11kifz/coffeeshopmanagement/blob/main/server/public/register.html) (Registration page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web pages"]
  node_home["Home page<br/>[index.html]"]
  node_login["Login page<br/>[login.html]"]
  node_register["Registration page<br/>[register.html]"]
  node_menuui["Menu page<br/>[menu.html]"]
  node_ordersui["Orders page<br/>[orders.html]"]
  node_staffui["Staff page<br/>[staff.html]"]
  node_stockui["Stock page<br/>[stock.html]"]
end

subgraph group_server["Application server"]
  node_web["Express app<br/>[index.js]"]
end

subgraph group_domains["Shop operations"]
  node_attendance["Staff attendance<br/>[index.js]"]
  node_menu["Menu management<br/>[index.js]"]
  node_orders["Order management<br/>[index.js]"]
end

subgraph group_identity["Identity and access"]
  node_auth["Registration and login<br/>[index.js]"]
  node_sessions["Session access checks<br/>[index.js]"]
end

node_visitor(("Visitor or staff"))
node_mysql[("MySQL database")]

node_visitor -->|"requests pages"| node_web
node_web -->|"serves"| node_home
node_web -->|"serves"| node_login
node_web -->|"serves"| node_register
node_web -->|"serves"| node_menuui
node_web -->|"serves"| node_ordersui
node_web -->|"handles"| node_auth
node_web -->|"checks access"| node_sessions
node_web -->|"routes"| node_attendance
node_web -->|"routes"| node_menu
node_web -->|"routes"| node_orders
node_auth -->|"queries"| node_mysql
node_attendance -->|"reads and writes"| node_mysql
node_menu -->|"reads and writes"| node_mysql
node_orders -->|"reads and writes"| node_mysql

click node_web "https://github.com/x11kifz/coffeeshopmanagement/blob/main/server/index.js"
click node_home "https://github.com/x11kifz/coffeeshopmanagement/blob/main/server/public/index.html"
click node_login "https://github.com/x11kifz/coffeeshopmanagement/blob/main/server/public/login.html"
click node_register "https://github.com/x11kifz/coffeeshopmanagement/blob/main/server/public/register.html"
click node_menuui "https://github.com/x11kifz/coffeeshopmanagement/blob/main/server/public/menu.html"
click node_ordersui "https://github.com/x11kifz/coffeeshopmanagement/blob/main/server/public/orders.html"
click node_staffui "https://github.com/x11kifz/coffeeshopmanagement/blob/main/server/public/staff.html"
click node_stockui "https://github.com/x11kifz/coffeeshopmanagement/blob/main/server/public/stock.html"
click node_auth "https://github.com/x11kifz/coffeeshopmanagement/blob/main/server/index.js"
click node_sessions "https://github.com/x11kifz/coffeeshopmanagement/blob/main/server/index.js"
click node_attendance "https://github.com/x11kifz/coffeeshopmanagement/blob/main/server/index.js"
click node_menu "https://github.com/x11kifz/coffeeshopmanagement/blob/main/server/index.js"
click node_orders "https://github.com/x11kifz/coffeeshopmanagement/blob/main/server/index.js"

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_home,node_login,node_register,node_menuui,node_ordersui,node_staffui,node_stockui toneBlue
class node_web,node_mysql toneAmber
class node_attendance,node_menu,node_orders toneMint
class node_auth,node_sessions toneRose
class node_visitor toneIndigo
```

## Components

### Web pages

- [Home page](https://github.com/x11kifz/coffeeshopmanagement/blob/main/server/public/index.html): `server/public/index.html`
- [Login page](https://github.com/x11kifz/coffeeshopmanagement/blob/main/server/public/login.html): `server/public/login.html`
- [Registration page](https://github.com/x11kifz/coffeeshopmanagement/blob/main/server/public/register.html): `server/public/register.html`
- [Menu page](https://github.com/x11kifz/coffeeshopmanagement/blob/main/server/public/menu.html): `server/public/menu.html`
- [Orders page](https://github.com/x11kifz/coffeeshopmanagement/blob/main/server/public/orders.html): `server/public/orders.html`
- [Staff page](https://github.com/x11kifz/coffeeshopmanagement/blob/main/server/public/staff.html): `server/public/staff.html`
- [Stock page](https://github.com/x11kifz/coffeeshopmanagement/blob/main/server/public/stock.html): `server/public/stock.html`

### Application server

- [Express app](https://github.com/x11kifz/coffeeshopmanagement/blob/main/server/index.js): `server/index.js`

### Shop operations

- [Staff attendance](https://github.com/x11kifz/coffeeshopmanagement/blob/main/server/index.js): `server/index.js`
- [Menu management](https://github.com/x11kifz/coffeeshopmanagement/blob/main/server/index.js): `server/index.js`
- [Order management](https://github.com/x11kifz/coffeeshopmanagement/blob/main/server/index.js): `server/index.js`

### Identity and access

- [Registration and login](https://github.com/x11kifz/coffeeshopmanagement/blob/main/server/index.js): `server/index.js`
- [Session access checks](https://github.com/x11kifz/coffeeshopmanagement/blob/main/server/index.js): `server/index.js`

### Other components

- **Visitor or staff**
- **MySQL database**

## Connections

- Visitor or staff → Express app: requests pages (evidence: `server/index.js`)
- Express app → Home page: serves (evidence: `server/index.js`)
- Express app → Login page: serves (evidence: `server/index.js`)
- Express app → Registration page: serves (evidence: `server/index.js`)
- Express app → Menu page: serves (evidence: `server/index.js`)
- Express app → Orders page: serves (evidence: `server/index.js`)
- Express app → Registration and login: handles (evidence: `server/index.js`)
- Express app → Session access checks: checks access (evidence: `server/index.js`)
- Express app → Staff attendance: routes (evidence: `server/index.js`)
- Express app → Menu management: routes (evidence: `server/index.js`)
- Express app → Order management: routes (evidence: `server/index.js`)
- Registration and login → MySQL database: queries (evidence: `server/index.js`)
- Staff attendance → MySQL database: reads and writes (evidence: `server/index.js`)
- Menu management → MySQL database: reads and writes (evidence: `server/index.js`)
- Order management → MySQL database: reads and writes (evidence: `server/index.js`)
