# helijonarceno/system-demo architecture

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

- Interactive diagram: https://gitdiagram.com/helijonarceno/system-demo
- Repository: https://github.com/helijonarceno/system-demo

## Overview

This PHP application supports staff login and role-based access to inventory, point-of-sale, accounts, dashboards, and reports. The principal evidenced workflow is a sales user finding available stock, building a basket, adjusting quantities, taking payment, and recording a transaction and its details. Inventory maintenance and account administration are distinct supporting workflows; dashboard and reporting queries provide operational and sales views. The tree establishes these product areas, but the README is empty and most controller-to-model wiring was not sampled, so uncertain links are omitted.

Main entry points: [`models/db.php`](https://github.com/helijonarceno/system-demo/blob/master/models/db.php) (Database connection), [`controllers/pos.php`](https://github.com/helijonarceno/system-demo/blob/master/controllers/pos.php) (POS interactions), [`models/authorization/verify_account.php`](https://github.com/helijonarceno/system-demo/blob/master/models/authorization/verify_account.php) (Verify account), [`views/pos.php`](https://github.com/helijonarceno/system-demo/blob/master/views/pos.php) (POS screen)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and navigation"]
  node_login["Login screen<br/>[index.php]"]
  node_verify["Verify account<br/>[verify_account.php]"]
  node_sidebar["Role navigation<br/>[sidebar.php]"]
end

subgraph group_sales["Point of sale"]
  node_posview["POS screen<br/>[pos.php]"]
  node_posflow["POS interactions<br/>[pos.php]"]
  node_productsearch["Product search"]
  node_stockfetch["Stock lookup"]
  node_saleinsert["Record transaction"]
  node_detailinsert["Record sale lines"]
  node_gcash["GCash and top-up"]
end

subgraph group_inventory["Inventory operations"]
  node_inventoryview["Inventory screen<br/>[inventory.php]"]
  node_inventorycontrol["Inventory controller<br/>[inventory.php]"]
  node_productwrite["Product maintenance"]
  node_productupdate["Update product<br/>[update_product.php]"]
  node_masterdata["Master data"]
end

subgraph group_admin["Accounts and reporting"]
  node_accountview["Account administration<br/>[accounts.php]"]
  node_accountcontrol["Account controller<br/>[accounts.php]"]
  node_accountops["Account operations<br/>[fetch_accounts.php]"]
  node_dashboard["Dashboard<br/>[dashboard.php]"]
  node_dashboardcontrol["Dashboard controller<br/>[dashboard.php]"]
  node_metrics["Sales and stock metrics"]
  node_reports["Reports and history<br/>[reports.php]"]
end

subgraph group_data["Persistence layer"]
  node_dbconn["Database connection<br/>[db.php]"]
end

node_staff(("Staff user"))
node_database[("Application database")]

node_staff -->|"enters credentials"| node_login
node_login -->|"submits login"| node_verify
node_verify -->|"queries account"| node_dbconn
node_verify -->|"sets session"| node_sidebar
node_staff -->|"uses POS"| node_posview
node_posview -->|"loads interactions"| node_posflow
node_posflow -->|"searches stock"| node_productsearch
node_posflow -->|"checks quantity"| node_stockfetch
node_posflow -->|"records sale"| node_saleinsert
node_posflow -->|"records sale lines"| node_detailinsert
node_posview -->|"opens payment forms"| node_gcash
node_productsearch -->|"queries inventory view"| node_dbconn
node_stockfetch -->|"queries stock"| node_dbconn
node_saleinsert -->|"writes transaction"| node_dbconn
node_detailinsert -->|"writes sale lines"| node_dbconn
node_staff -->|"maintains inventory"| node_inventoryview
node_inventoryview -->|"loads page logic"| node_inventorycontrol
node_inventoryview -->|"submits product edit"| node_productupdate
node_productupdate -->|"updates inventory"| node_dbconn
node_staff -->|"administers accounts"| node_accountview
node_accountview -->|"loads account logic"| node_accountcontrol
node_accountview -->|"fetches accounts"| node_accountops
node_accountops -->|"queries accounts"| node_dbconn
node_staff -->|"views performance"| node_dashboard
node_dashboard -->|"loads dashboard"| node_dashboardcontrol
node_dashboardcontrol -->|"requests metrics"| node_metrics
node_staff -->|"reviews reports"| node_reports
node_dbconn -->|"connects"| node_database

click node_login "https://github.com/helijonarceno/system-demo/blob/master/index.php"
click node_verify "https://github.com/helijonarceno/system-demo/blob/master/models/authorization/verify_account.php"
click node_sidebar "https://github.com/helijonarceno/system-demo/blob/master/views/layout/sidebar.php"
click node_posview "https://github.com/helijonarceno/system-demo/blob/master/views/pos.php"
click node_posflow "https://github.com/helijonarceno/system-demo/blob/master/controllers/pos.php"
click node_productsearch "https://github.com/helijonarceno/system-demo/blob/master/models/search/search_products2.php"
click node_stockfetch "https://github.com/helijonarceno/system-demo/blob/master/models/fetch/fetch_product_stock.php"
click node_saleinsert "https://github.com/helijonarceno/system-demo/blob/master/models/insert/insert_transaction.php"
click node_detailinsert "https://github.com/helijonarceno/system-demo/blob/master/models/insert/insert_transaction_detail.php"
click node_gcash "https://github.com/helijonarceno/system-demo/tree/master/views/modals/pos"
click node_inventoryview "https://github.com/helijonarceno/system-demo/blob/master/views/inventory.php"
click node_inventorycontrol "https://github.com/helijonarceno/system-demo/blob/master/controllers/inventory.php"
click node_productwrite "https://github.com/helijonarceno/system-demo/tree/master/models/insert"
click node_productupdate "https://github.com/helijonarceno/system-demo/blob/master/models/update/update_product.php"
click node_masterdata "https://github.com/helijonarceno/system-demo/tree/master/models/insert"
click node_accountview "https://github.com/helijonarceno/system-demo/blob/master/views/accounts.php"
click node_accountcontrol "https://github.com/helijonarceno/system-demo/blob/master/controllers/accounts.php"
click node_accountops "https://github.com/helijonarceno/system-demo/blob/master/models/fetch/fetch_accounts.php"
click node_dashboard "https://github.com/helijonarceno/system-demo/blob/master/views/dashboard.php"
click node_dashboardcontrol "https://github.com/helijonarceno/system-demo/blob/master/controllers/dashboard.php"
click node_metrics "https://github.com/helijonarceno/system-demo/tree/master/models/dashboard"
click node_reports "https://github.com/helijonarceno/system-demo/blob/master/views/reports.php"
click node_dbconn "https://github.com/helijonarceno/system-demo/blob/master/models/db.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_login,node_verify,node_sidebar,node_staff toneBlue
class node_posview,node_posflow,node_productsearch,node_stockfetch,node_saleinsert,node_detailinsert,node_gcash,node_database toneAmber
class node_inventoryview,node_inventorycontrol,node_productwrite,node_productupdate,node_masterdata toneMint
class node_accountview,node_accountcontrol,node_accountops,node_dashboard,node_dashboardcontrol,node_metrics,node_reports toneRose
class node_dbconn toneIndigo
```

## Components

### Access and navigation

- [Login screen](https://github.com/helijonarceno/system-demo/blob/master/index.php): `index.php`
- [Verify account](https://github.com/helijonarceno/system-demo/blob/master/models/authorization/verify_account.php): `models/authorization/verify_account.php`
- [Role navigation](https://github.com/helijonarceno/system-demo/blob/master/views/layout/sidebar.php): `views/layout/sidebar.php`

### Point of sale

- [POS screen](https://github.com/helijonarceno/system-demo/blob/master/views/pos.php): `views/pos.php`
- [POS interactions](https://github.com/helijonarceno/system-demo/blob/master/controllers/pos.php): `controllers/pos.php`
- [Product search](https://github.com/helijonarceno/system-demo/blob/master/models/search/search_products2.php): `models/search/search_products2.php`
- [Stock lookup](https://github.com/helijonarceno/system-demo/blob/master/models/fetch/fetch_product_stock.php): `models/fetch/fetch_product_stock.php`
- [Record transaction](https://github.com/helijonarceno/system-demo/blob/master/models/insert/insert_transaction.php): `models/insert/insert_transaction.php`
- [Record sale lines](https://github.com/helijonarceno/system-demo/blob/master/models/insert/insert_transaction_detail.php): `models/insert/insert_transaction_detail.php`
- [GCash and top-up](https://github.com/helijonarceno/system-demo/tree/master/views/modals/pos): `views/modals/pos`

### Inventory operations

- [Inventory screen](https://github.com/helijonarceno/system-demo/blob/master/views/inventory.php): `views/inventory.php`
- [Inventory controller](https://github.com/helijonarceno/system-demo/blob/master/controllers/inventory.php): `controllers/inventory.php`
- [Product maintenance](https://github.com/helijonarceno/system-demo/tree/master/models/insert): `models/insert`
- [Update product](https://github.com/helijonarceno/system-demo/blob/master/models/update/update_product.php): `models/update/update_product.php`
- [Master data](https://github.com/helijonarceno/system-demo/tree/master/models/insert): `models/insert`

### Accounts and reporting

- [Account administration](https://github.com/helijonarceno/system-demo/blob/master/views/accounts.php): `views/accounts.php`
- [Account controller](https://github.com/helijonarceno/system-demo/blob/master/controllers/accounts.php): `controllers/accounts.php`
- [Account operations](https://github.com/helijonarceno/system-demo/blob/master/models/fetch/fetch_accounts.php): `models/fetch/fetch_accounts.php`
- [Dashboard](https://github.com/helijonarceno/system-demo/blob/master/views/dashboard.php): `views/dashboard.php`
- [Dashboard controller](https://github.com/helijonarceno/system-demo/blob/master/controllers/dashboard.php): `controllers/dashboard.php`
- [Sales and stock metrics](https://github.com/helijonarceno/system-demo/tree/master/models/dashboard): `models/dashboard`
- [Reports and history](https://github.com/helijonarceno/system-demo/blob/master/views/reports.php): `views/reports.php`

### Persistence layer

- [Database connection](https://github.com/helijonarceno/system-demo/blob/master/models/db.php): `models/db.php`

### Other components

- **Staff user**
- **Application database**

## Connections

- Staff user → Login screen: enters credentials
- Login screen → Verify account: submits login
- Verify account → Database connection: queries account
- Verify account → Role navigation: sets session
- Staff user → POS screen: uses POS
- POS screen → POS interactions: loads interactions
- POS interactions → Product search: searches stock
- POS interactions → Stock lookup: checks quantity
- POS interactions → Record transaction: records sale
- POS interactions → Record sale lines: records sale lines
- POS screen → GCash and top-up: opens payment forms
- Product search → Database connection: queries inventory view
- Stock lookup → Database connection: queries stock
- Record transaction → Database connection: writes transaction
- Record sale lines → Database connection: writes sale lines
- Staff user → Inventory screen: maintains inventory
- Inventory screen → Inventory controller: loads page logic
- Inventory screen → Update product: submits product edit
- Update product → Database connection: updates inventory
- Staff user → Account administration: administers accounts
- Account administration → Account controller: loads account logic
- Account administration → Account operations: fetches accounts
- Account operations → Database connection: queries accounts
- Staff user → Dashboard: views performance
- Dashboard → Dashboard controller: loads dashboard
- Dashboard controller → Sales and stock metrics: requests metrics
- Staff user → Reports and history: reviews reports
- Database connection → Application database: connects
