# sheilpian/inventory architecture

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

- Interactive diagram: https://gitdiagram.com/sheilpian/inventory
- Repository: https://github.com/sheilpian/inventory

## Overview

This is a PHP spare-parts inventory and warehouse management application. Users enter through the login page, then navigate the dashboard, master-data maintenance, inventory views and adjustments, transaction entry, and reports. Inventory includes stock by warehouse/location, 3D rack placement, thresholds, stock cards/history, and physical stock opname. The sampled pages query MySQL directly through a shared connection; navigation and page templates are shared components. Many page-to-database details are unsampled, so edges between those subsystems and storage are shown as unverified rather than asserted.

Main entry points: [`koneksi.php`](https://github.com/sheilpian/inventory/blob/main/koneksi.php) (MySQL connection), [`inventory/current_stock/current_stock.php`](https://github.com/sheilpian/inventory/blob/main/inventory/current_stock/current_stock.php) (Stock views and alerts), [`dashboard/dashboard.php`](https://github.com/sheilpian/inventory/blob/main/dashboard/dashboard.php) (Dashboard), [`components/sidebar.php`](https://github.com/sheilpian/inventory/blob/main/components/sidebar.php) (Sidebar navigation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and shell"]
  node_login["Login<br/>[index.php]"]
  node_dashboard["Dashboard<br/>[dashboard.php]"]
  node_navigation["Sidebar navigation<br/>[sidebar.php]"]
  node_presentation["Page shell<br/>[header.php]"]
  node_ui_behavior["Theme and sidebar behavior<br/>[footer.php]"]
  node_db_connection[("MySQL connection<br/>[koneksi.php]")]
  node_table_engine["Table interactions<br/>[table_engine.js]"]
end

subgraph group_master["Master data"]
  node_master_records["Master records"]
  node_parts_catalog["Parts catalog<br/>[master_barang.php]"]
  node_warehouse_setup["Warehouse and locations<br/>[location.php]"]
  node_stock_thresholds["Min-max stock<br/>[min_max.php]"]
end

subgraph group_inventory["Inventory operations"]
  node_inventory_views["Stock views and alerts<br/>[current_stock.php]"]
  node_warehouse_stock["Stock by warehouse"]
  node_location_stock["Location and 3D racks"]
  node_stock_card["Stock card and history<br/>[stock_card.php]"]
  node_adjustment["Stock adjustment<br/>[adjustment.php]"]
  node_opname["Physical stock opname<br/>[stock_opname.php]"]
end

subgraph group_transactions["Stock transactions"]
  node_incoming["Incoming goods<br/>[page.php]"]
  node_outgoing["Outgoing goods<br/>[page.php]"]
  node_transaction_hub["Transaction entry<br/>[transaksi.php]"]
end

subgraph group_reports["Reporting"]
  node_report_suite["Inventory reports"]
  node_report_nav["Report navigation<br/>[report_tabs.php]"]
end

node_user(("Warehouse user"))

node_user -->|"signs in"| node_login
node_user -.->|"selects pages"| node_navigation
node_login -->|"authenticates via"| node_db_connection
node_dashboard -->|"queries metrics"| node_db_connection
node_dashboard -->|"includes"| node_navigation
node_dashboard -->|"includes"| node_presentation
node_dashboard -->|"includes"| node_ui_behavior
node_navigation -.->|"styles with"| node_presentation
node_master_records -.->|"uses"| node_db_connection
node_inventory_views -.->|"queries stock"| node_db_connection
node_inventory_views -->|"includes"| node_navigation
node_inventory_views -->|"includes"| node_presentation
node_inventory_views -.->|"includes"| node_ui_behavior
node_inventory_views -.->|"uses thresholds"| node_stock_thresholds
node_warehouse_stock -.->|"queries stock"| node_db_connection
node_location_stock -.->|"reads and updates"| node_db_connection
node_stock_card -.->|"queries history"| node_db_connection
node_adjustment -.->|"updates stock"| node_db_connection
node_opname -.->|"records counts"| node_db_connection
node_transaction_hub -.->|"routes to"| node_incoming
node_transaction_hub -.->|"routes to"| node_outgoing
node_incoming -.->|"records receipts"| node_db_connection
node_outgoing -.->|"records issues"| node_db_connection
node_report_suite -.->|"queries reports"| node_db_connection
node_report_suite -.->|"uses navigation"| node_report_nav
node_table_engine -.->|"supports tables"| node_inventory_views

click node_login "https://github.com/sheilpian/inventory/blob/main/index.php"
click node_dashboard "https://github.com/sheilpian/inventory/blob/main/dashboard/dashboard.php"
click node_navigation "https://github.com/sheilpian/inventory/blob/main/components/sidebar.php"
click node_presentation "https://github.com/sheilpian/inventory/blob/main/components/header.php"
click node_ui_behavior "https://github.com/sheilpian/inventory/blob/main/components/footer.php"
click node_db_connection "https://github.com/sheilpian/inventory/blob/main/koneksi.php"
click node_master_records "https://github.com/sheilpian/inventory/tree/main/master_data"
click node_parts_catalog "https://github.com/sheilpian/inventory/blob/main/master_data/master-barang/master_barang.php"
click node_warehouse_setup "https://github.com/sheilpian/inventory/blob/main/master_data/location-rack-bin/location.php"
click node_stock_thresholds "https://github.com/sheilpian/inventory/blob/main/master_data/min-max_stock/min_max.php"
click node_inventory_views "https://github.com/sheilpian/inventory/blob/main/inventory/current_stock/current_stock.php"
click node_warehouse_stock "https://github.com/sheilpian/inventory/blob/main/inventory/stock_by_werehouse/stock_by_werehouse.php"
click node_location_stock "https://github.com/sheilpian/inventory/blob/main/inventory/stock_by_location/stock_by_location.php"
click node_stock_card "https://github.com/sheilpian/inventory/blob/main/inventory/stock_card/stock_card.php"
click node_adjustment "https://github.com/sheilpian/inventory/blob/main/inventory/adjustment/adjustment.php"
click node_opname "https://github.com/sheilpian/inventory/blob/main/inventory/stock_opname/stock_opname.php"
click node_incoming "https://github.com/sheilpian/inventory/blob/main/transaksi/incoming/page.php"
click node_outgoing "https://github.com/sheilpian/inventory/blob/main/transaksi/outgoing/page.php"
click node_transaction_hub "https://github.com/sheilpian/inventory/blob/main/transaksi.php"
click node_report_suite "https://github.com/sheilpian/inventory/tree/main/report"
click node_report_nav "https://github.com/sheilpian/inventory/blob/main/components/report_tabs.php"
click node_table_engine "https://github.com/sheilpian/inventory/blob/main/components/table_engine.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_login,node_dashboard,node_navigation,node_presentation,node_ui_behavior,node_db_connection,node_table_engine,node_user toneBlue
class node_master_records,node_parts_catalog,node_warehouse_setup,node_stock_thresholds toneAmber
class node_inventory_views,node_warehouse_stock,node_location_stock,node_stock_card,node_adjustment,node_opname toneMint
class node_incoming,node_outgoing,node_transaction_hub toneRose
class node_report_suite,node_report_nav toneIndigo
```

## Components

### Access and shell

- [Login](https://github.com/sheilpian/inventory/blob/main/index.php): `index.php`
- [Dashboard](https://github.com/sheilpian/inventory/blob/main/dashboard/dashboard.php): `dashboard/dashboard.php`
- [Sidebar navigation](https://github.com/sheilpian/inventory/blob/main/components/sidebar.php): `components/sidebar.php`
- [Page shell](https://github.com/sheilpian/inventory/blob/main/components/header.php): `components/header.php`
- [Theme and sidebar behavior](https://github.com/sheilpian/inventory/blob/main/components/footer.php): `components/footer.php`
- [MySQL connection](https://github.com/sheilpian/inventory/blob/main/koneksi.php): `koneksi.php`
- [Table interactions](https://github.com/sheilpian/inventory/blob/main/components/table_engine.js): `components/table_engine.js`

### Master data

- [Master records](https://github.com/sheilpian/inventory/tree/main/master_data): `master_data`
- [Parts catalog](https://github.com/sheilpian/inventory/blob/main/master_data/master-barang/master_barang.php): `master_data/master-barang/master_barang.php`
- [Warehouse and locations](https://github.com/sheilpian/inventory/blob/main/master_data/location-rack-bin/location.php): `master_data/location-rack-bin/location.php`
- [Min-max stock](https://github.com/sheilpian/inventory/blob/main/master_data/min-max_stock/min_max.php): `master_data/min-max_stock/min_max.php`

### Inventory operations

- [Stock views and alerts](https://github.com/sheilpian/inventory/blob/main/inventory/current_stock/current_stock.php): `inventory/current_stock/current_stock.php`
- [Stock by warehouse](https://github.com/sheilpian/inventory/blob/main/inventory/stock_by_werehouse/stock_by_werehouse.php): `inventory/stock_by_werehouse/stock_by_werehouse.php`
- [Location and 3D racks](https://github.com/sheilpian/inventory/blob/main/inventory/stock_by_location/stock_by_location.php): `inventory/stock_by_location/stock_by_location.php`
- [Stock card and history](https://github.com/sheilpian/inventory/blob/main/inventory/stock_card/stock_card.php): `inventory/stock_card/stock_card.php`
- [Stock adjustment](https://github.com/sheilpian/inventory/blob/main/inventory/adjustment/adjustment.php): `inventory/adjustment/adjustment.php`
- [Physical stock opname](https://github.com/sheilpian/inventory/blob/main/inventory/stock_opname/stock_opname.php): `inventory/stock_opname/stock_opname.php`

### Stock transactions

- [Incoming goods](https://github.com/sheilpian/inventory/blob/main/transaksi/incoming/page.php): `transaksi/incoming/page.php`
- [Outgoing goods](https://github.com/sheilpian/inventory/blob/main/transaksi/outgoing/page.php): `transaksi/outgoing/page.php`
- [Transaction entry](https://github.com/sheilpian/inventory/blob/main/transaksi.php): `transaksi.php`

### Reporting

- [Inventory reports](https://github.com/sheilpian/inventory/tree/main/report): `report`
- [Report navigation](https://github.com/sheilpian/inventory/blob/main/components/report_tabs.php): `components/report_tabs.php`

### Other components

- **Warehouse user**

## Connections

- Warehouse user → Login: signs in (evidence: `index.php`)
- Warehouse user → Sidebar navigation: selects pages
- Login → MySQL connection: authenticates via (evidence: `index.php`)
- Dashboard → MySQL connection: queries metrics (evidence: `dashboard/dashboard.php`)
- Dashboard → Sidebar navigation: includes (evidence: `dashboard/dashboard.php`)
- Dashboard → Page shell: includes (evidence: `dashboard/dashboard.php`)
- Dashboard → Theme and sidebar behavior: includes (evidence: `dashboard/dashboard.php`)
- Sidebar navigation → Page shell: styles with
- Master records → MySQL connection: uses (evidence: `master_data/master-barang/master_barang.php`)
- Stock views and alerts → MySQL connection: queries stock (evidence: `inventory/current_stock/current_stock.php`)
- Stock views and alerts → Sidebar navigation: includes (evidence: `inventory/current_stock/current_stock.php`)
- Stock views and alerts → Page shell: includes (evidence: `inventory/current_stock/current_stock.php`)
- Stock views and alerts → Theme and sidebar behavior: includes (evidence: `inventory/current_stock/current_stock.php`)
- Stock views and alerts → Min-max stock: uses thresholds
- Stock by warehouse → MySQL connection: queries stock (evidence: `inventory/stock_by_werehouse/stock_by_werehouse.php`)
- Location and 3D racks → MySQL connection: reads and updates (evidence: `inventory/stock_by_location/stock_by_location.php`)
- Stock card and history → MySQL connection: queries history (evidence: `inventory/stock_card/stock_card.php`)
- Stock adjustment → MySQL connection: updates stock (evidence: `inventory/adjustment/adjustment.php`)
- Physical stock opname → MySQL connection: records counts (evidence: `inventory/stock_opname/stock_opname.php`)
- Transaction entry → Incoming goods: routes to
- Transaction entry → Outgoing goods: routes to
- Incoming goods → MySQL connection: records receipts
- Outgoing goods → MySQL connection: records issues
- Inventory reports → MySQL connection: queries reports (evidence: `report/Incomming_report/incomming_report.php`)
- Inventory reports → Report navigation: uses navigation (evidence: `report/Incomming_report/incomming_report.php`)
- Table interactions → Stock views and alerts: supports tables
