# massdann/kasir-dkrispy architecture

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

- Interactive diagram: https://gitdiagram.com/massdann/kasir-dkrispy
- Repository: https://github.com/massdann/kasir-dkrispy

## Overview

This is a PHP point-of-sale and restaurant order-management application. Staff enter through a session-aware page router, work with menu, customer, order, and user screens, then manage order items and record cash or QRIS payments; administrators also have dashboard and reporting views. PHP pages and request handlers issue SQL through a shared MySQL connection. The supplied excerpts show routing, shared layout, menu/order-item operations, and payment handling; several other major screens are present in the source index but were not sampled, so their internal behavior is not expanded here.

Main entry points: [`proses/connect.php`](https://github.com/massdann/kasir-dkrispy/blob/main/proses/connect.php) (MySQL connection), [`main.php`](https://github.com/massdann/kasir-dkrispy/blob/main/main.php) (Shared layout), [`order_item.php`](https://github.com/massdann/kasir-dkrispy/blob/main/order_item.php) (Order items), [`index.php`](https://github.com/massdann/kasir-dkrispy/blob/main/index.php) (Page router)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Routing and layout"]
  node_router["Page router<br/>[index.php]"]
  node_login["Login screen<br/>[login.php]"]
  node_layout["Shared layout<br/>[main.php]"]
  node_header["Header<br/>[header.php]"]
  node_sidebar["Navigation<br/>[sidebar.php]"]
end

subgraph group_sales["Sales operations"]
  node_orders["Orders<br/>[orders.php]"]
  node_counterorders["Counter orders<br/>[cs_order.php]"]
  node_items["Order items<br/>[order_item.php]"]
  node_itemhandlers["Item handlers"]
  node_payment["Payment handler<br/>[proses_bayar.php]"]
  node_itemview["Item view<br/>[view_item.php]"]
  node_fried["Fried items<br/>[fried.php]"]
end

subgraph group_admin["Administration"]
  node_dashboard["Dashboard<br/>[home.php]"]
  node_menu["Menu catalog<br/>[menu.php]"]
  node_menuhandlers["Menu handlers"]
  node_customers["Customers<br/>[customers.php]"]
  node_users["User management<br/>[user.php]"]
  node_report["Reports<br/>[report.php]"]
end

subgraph group_storage["Persistence"]
  node_database[("Application database")]
  node_connection["MySQL connection<br/>[connect.php]"]
end

node_staff(("Staff"))

node_staff -->|"requests pages"| node_router
node_router -->|"routes views"| node_layout
node_router -->|"routes login"| node_login
node_layout -->|"includes"| node_header
node_layout -->|"includes"| node_sidebar
node_menu -->|"submits forms"| node_menuhandlers
node_items -->|"submits edits"| node_itemhandlers
node_items -.->|"submits payment"| node_payment
node_layout -->|"queries user"| node_connection
node_menu -->|"queries catalog"| node_connection
node_items -->|"queries order items"| node_connection
node_dashboard -->|"queries data"| node_connection
node_orders -->|"queries data"| node_connection
node_customers -->|"queries data"| node_connection
node_counterorders -->|"queries data"| node_connection
node_users -->|"queries users"| node_connection
node_report -->|"queries data"| node_connection
node_itemview -->|"queries data"| node_connection
node_fried -->|"queries data"| node_connection
node_menuhandlers -->|"uses connection"| node_connection
node_itemhandlers -->|"uses connection"| node_connection
node_payment -->|"records payment"| node_connection
node_connection -->|"connects"| node_database

click node_router "https://github.com/massdann/kasir-dkrispy/blob/main/index.php"
click node_login "https://github.com/massdann/kasir-dkrispy/blob/main/login.php"
click node_layout "https://github.com/massdann/kasir-dkrispy/blob/main/main.php"
click node_header "https://github.com/massdann/kasir-dkrispy/blob/main/header.php"
click node_sidebar "https://github.com/massdann/kasir-dkrispy/blob/main/sidebar.php"
click node_dashboard "https://github.com/massdann/kasir-dkrispy/blob/main/home.php"
click node_menu "https://github.com/massdann/kasir-dkrispy/blob/main/menu.php"
click node_menuhandlers "https://github.com/massdann/kasir-dkrispy/tree/main/proses"
click node_customers "https://github.com/massdann/kasir-dkrispy/blob/main/customers.php"
click node_users "https://github.com/massdann/kasir-dkrispy/blob/main/user.php"
click node_report "https://github.com/massdann/kasir-dkrispy/blob/main/report.php"
click node_orders "https://github.com/massdann/kasir-dkrispy/blob/main/orders.php"
click node_counterorders "https://github.com/massdann/kasir-dkrispy/blob/main/cs_order.php"
click node_items "https://github.com/massdann/kasir-dkrispy/blob/main/order_item.php"
click node_itemhandlers "https://github.com/massdann/kasir-dkrispy/tree/main/proses"
click node_payment "https://github.com/massdann/kasir-dkrispy/blob/main/proses/proses_bayar.php"
click node_itemview "https://github.com/massdann/kasir-dkrispy/blob/main/view_item.php"
click node_fried "https://github.com/massdann/kasir-dkrispy/blob/main/fried.php"
click node_database "https://github.com/massdann/kasir-dkrispy/tree/main/mysql/data/db_d%400027kriuk"
click node_connection "https://github.com/massdann/kasir-dkrispy/blob/main/proses/connect.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_router,node_login,node_layout,node_header,node_sidebar toneBlue
class node_orders,node_counterorders,node_items,node_itemhandlers,node_payment,node_itemview,node_fried toneAmber
class node_dashboard,node_menu,node_menuhandlers,node_customers,node_users,node_report toneMint
class node_database,node_connection toneRose
class node_staff toneIndigo
```

## Components

### Routing and layout

- [Page router](https://github.com/massdann/kasir-dkrispy/blob/main/index.php): `index.php`
- [Login screen](https://github.com/massdann/kasir-dkrispy/blob/main/login.php): `login.php`
- [Shared layout](https://github.com/massdann/kasir-dkrispy/blob/main/main.php): `main.php`
- [Header](https://github.com/massdann/kasir-dkrispy/blob/main/header.php): `header.php`
- [Navigation](https://github.com/massdann/kasir-dkrispy/blob/main/sidebar.php): `sidebar.php`

### Sales operations

- [Orders](https://github.com/massdann/kasir-dkrispy/blob/main/orders.php): `orders.php`
- [Counter orders](https://github.com/massdann/kasir-dkrispy/blob/main/cs_order.php): `cs_order.php`
- [Order items](https://github.com/massdann/kasir-dkrispy/blob/main/order_item.php): `order_item.php`
- [Item handlers](https://github.com/massdann/kasir-dkrispy/tree/main/proses): `proses`
- [Payment handler](https://github.com/massdann/kasir-dkrispy/blob/main/proses/proses_bayar.php): `proses/proses_bayar.php`
- [Item view](https://github.com/massdann/kasir-dkrispy/blob/main/view_item.php): `view_item.php`
- [Fried items](https://github.com/massdann/kasir-dkrispy/blob/main/fried.php): `fried.php`

### Administration

- [Dashboard](https://github.com/massdann/kasir-dkrispy/blob/main/home.php): `home.php`
- [Menu catalog](https://github.com/massdann/kasir-dkrispy/blob/main/menu.php): `menu.php`
- [Menu handlers](https://github.com/massdann/kasir-dkrispy/tree/main/proses): `proses`
- [Customers](https://github.com/massdann/kasir-dkrispy/blob/main/customers.php): `customers.php`
- [User management](https://github.com/massdann/kasir-dkrispy/blob/main/user.php): `user.php`
- [Reports](https://github.com/massdann/kasir-dkrispy/blob/main/report.php): `report.php`

### Persistence

- [Application database](https://github.com/massdann/kasir-dkrispy/tree/main/mysql/data/db_d%400027kriuk): `mysql/data/db_d@0027kriuk`
- [MySQL connection](https://github.com/massdann/kasir-dkrispy/blob/main/proses/connect.php): `proses/connect.php`

### Other components

- **Staff**

## Connections

- Staff → Page router: requests pages (evidence: `index.php`)
- Page router → Shared layout: routes views (evidence: `index.php`)
- Page router → Login screen: routes login (evidence: `index.php`)
- Shared layout → Header: includes (evidence: `main.php`)
- Shared layout → Navigation: includes (evidence: `main.php`)
- Menu catalog → Menu handlers: submits forms (evidence: `menu.php`)
- Order items → Item handlers: submits edits (evidence: `order_item.php`)
- Order items → Payment handler: submits payment
- Shared layout → MySQL connection: queries user (evidence: `main.php`)
- Menu catalog → MySQL connection: queries catalog (evidence: `menu.php`)
- Order items → MySQL connection: queries order items (evidence: `order_item.php`)
- Dashboard → MySQL connection: queries data (evidence: `home.php`)
- Orders → MySQL connection: queries data (evidence: `orders.php`)
- Customers → MySQL connection: queries data (evidence: `customers.php`)
- Counter orders → MySQL connection: queries data (evidence: `cs_order.php`)
- User management → MySQL connection: queries users (evidence: `user.php`)
- Reports → MySQL connection: queries data (evidence: `report.php`)
- Item view → MySQL connection: queries data (evidence: `view_item.php`)
- Fried items → MySQL connection: queries data (evidence: `fried.php`)
- Menu handlers → MySQL connection: uses connection (evidence: `proses/proses_input_menu.php`)
- Item handlers → MySQL connection: uses connection (evidence: `proses/proses_input_orderitem.php`)
- Payment handler → MySQL connection: records payment (evidence: `proses/proses_bayar.php`)
- MySQL connection → Application database: connects (evidence: `proses/connect.php`)
