# punithaj-hub/inventory_management_system architecture

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

- Interactive diagram: https://gitdiagram.com/punithaj-hub/inventory_management_system
- Repository: https://github.com/punithaj-hub/inventory_management_system

## Overview

This is a PHP/MySQL inventory-management web app. The principal workflow is staff login, role-based navigation, product/category maintenance, recording sales, and reviewing sales reports. The sampled code shows authentication and product writes, while the source index establishes shared page dependencies; storage internals and several advertised features were not excerpted. Supplier management, purchase orders, and low-stock alerts are documented in the README but have no corresponding paths in the supplied tree, so they are shown as unverified capabilities without invented source paths.

Main entry points: [`includes/load.php`](https://github.com/punithaj-hub/inventory_management_system/blob/main/includes/load.php) (Application bootstrap), [`layouts/admin_menu.php`](https://github.com/punithaj-hub/inventory_management_system/blob/main/layouts/admin_menu.php) (Admin navigation), [`layouts/user_menu.php`](https://github.com/punithaj-hub/inventory_management_system/blob/main/layouts/user_menu.php) (Staff navigation), [`product.php`](https://github.com/punithaj-hub/inventory_management_system/blob/main/product.php) (Product catalog)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and UI"]
  node_login["Login form<br/>[index.php]"]
  node_auth["Authentication<br/>[auth.php]"]
  node_session["Role session<br/>[session.php]"]
  node_header["Page shell<br/>[header.php]"]
  node_adminnav["Admin navigation<br/>[admin_menu.php]"]
  node_specialnav["Special navigation<br/>[special_menu.php]"]
  node_usernav["Staff navigation<br/>[user_menu.php]"]
  node_users["User management<br/>[users.php]"]
  node_groups["Role groups<br/>[group.php]"]
end

subgraph group_inventory["Inventory"]
  node_categories["Categories<br/>[categorie.php]"]
  node_products["Product catalog<br/>[product.php]"]
  node_productedit["Product creation and edit<br/>[add_product.php]"]
  node_media["Product media<br/>[media.php]"]
  node_supplierpo["Suppliers and orders"]
end

subgraph group_commerce["Sales"]
  node_sales["Sales management<br/>[sales.php]"]
  node_saleentry["Record sale<br/>[add_sale.php]"]
end

subgraph group_insights["Dashboards and reports"]
  node_dashboard["Admin dashboard<br/>[admin.php]"]
  node_reports["Sales reports<br/>[sales_report.php]"]
  node_daily["Daily sales<br/>[daily_sales.php]"]
  node_monthly["Monthly sales<br/>[monthly_sales.php]"]
  node_reportprocess["Report processing"]
  node_alerts["Low-stock alerts"]
end

subgraph group_platform["Shared platform"]
  node_load["Application bootstrap<br/>[load.php]"]
  node_functions["Shared functions<br/>[functions.php]"]
  node_sql["Inventory queries<br/>[sql.php]"]
  node_database["Database connection<br/>[database.php]"]
end

node_staff(("Staff user"))
node_mysql[("MySQL database")]

node_staff -->|"submits credentials"| node_login
node_login -->|"posts credentials"| node_auth
node_auth -->|"loads services"| node_load
node_auth -->|"starts session"| node_session
node_auth -->|"redirects by role"| node_staff
node_load -->|"requires"| node_functions
node_load -->|"requires"| node_session
node_load -->|"requires"| node_database
node_load -->|"requires"| node_sql
node_load -.->|"connects through"| node_mysql
node_products -->|"loads services"| node_load
node_productedit -->|"loads services"| node_load
node_productedit -->|"writes product"| node_sql
node_productedit -->|"reads category list"| node_categories
node_productedit -->|"reads media list"| node_media
node_header -->|"checks login"| node_session
node_header -->|"includes by role"| node_adminnav
node_header -->|"includes by role"| node_specialnav
node_header -->|"includes by role"| node_usernav
node_adminnav -->|"links to"| node_products
node_adminnav -->|"links to"| node_sales
node_adminnav -->|"links to"| node_categories
node_adminnav -->|"links to"| node_users
node_adminnav -->|"links to"| node_groups
node_usernav -->|"links to"| node_sales
node_usernav -->|"links to"| node_reports
node_usernav -->|"links to"| node_daily
node_usernav -->|"links to"| node_monthly
node_sales -.->|"links to"| node_saleentry
node_dashboard -->|"links to"| node_products
node_dashboard -->|"links to"| node_sales
node_dashboard -->|"requests summary data"| node_sql
node_reports -.->|"processes report"| node_reportprocess
node_daily -->|"loads services"| node_load
node_monthly -->|"loads services"| node_load
node_supplierpo -.->|"supports restocking"| node_products
node_alerts -.->|"monitors stock"| node_products

click node_login "https://github.com/punithaj-hub/inventory_management_system/blob/main/index.php"
click node_auth "https://github.com/punithaj-hub/inventory_management_system/blob/main/auth.php"
click node_session "https://github.com/punithaj-hub/inventory_management_system/blob/main/includes/session.php"
click node_header "https://github.com/punithaj-hub/inventory_management_system/blob/main/layouts/header.php"
click node_adminnav "https://github.com/punithaj-hub/inventory_management_system/blob/main/layouts/admin_menu.php"
click node_specialnav "https://github.com/punithaj-hub/inventory_management_system/blob/main/layouts/special_menu.php"
click node_usernav "https://github.com/punithaj-hub/inventory_management_system/blob/main/layouts/user_menu.php"
click node_categories "https://github.com/punithaj-hub/inventory_management_system/blob/main/categorie.php"
click node_products "https://github.com/punithaj-hub/inventory_management_system/blob/main/product.php"
click node_productedit "https://github.com/punithaj-hub/inventory_management_system/blob/main/add_product.php"
click node_media "https://github.com/punithaj-hub/inventory_management_system/blob/main/media.php"
click node_users "https://github.com/punithaj-hub/inventory_management_system/blob/main/users.php"
click node_groups "https://github.com/punithaj-hub/inventory_management_system/blob/main/group.php"
click node_sales "https://github.com/punithaj-hub/inventory_management_system/blob/main/sales.php"
click node_saleentry "https://github.com/punithaj-hub/inventory_management_system/blob/main/add_sale.php"
click node_dashboard "https://github.com/punithaj-hub/inventory_management_system/blob/main/admin.php"
click node_reports "https://github.com/punithaj-hub/inventory_management_system/blob/main/sales_report.php"
click node_daily "https://github.com/punithaj-hub/inventory_management_system/blob/main/daily_sales.php"
click node_monthly "https://github.com/punithaj-hub/inventory_management_system/blob/main/monthly_sales.php"
click node_reportprocess "https://github.com/punithaj-hub/inventory_management_system/blob/main/sale_report_process.php"
click node_load "https://github.com/punithaj-hub/inventory_management_system/blob/main/includes/load.php"
click node_functions "https://github.com/punithaj-hub/inventory_management_system/blob/main/includes/functions.php"
click node_sql "https://github.com/punithaj-hub/inventory_management_system/blob/main/includes/sql.php"
click node_database "https://github.com/punithaj-hub/inventory_management_system/blob/main/includes/database.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_auth,node_session,node_header,node_adminnav,node_specialnav,node_usernav,node_users,node_groups,node_staff toneBlue
class node_categories,node_products,node_productedit,node_media,node_supplierpo,node_mysql toneAmber
class node_sales,node_saleentry toneMint
class node_dashboard,node_reports,node_daily,node_monthly,node_reportprocess,node_alerts toneRose
class node_load,node_functions,node_sql,node_database toneIndigo
```

## Components

### Access and UI

- [Login form](https://github.com/punithaj-hub/inventory_management_system/blob/main/index.php): `index.php`
- [Authentication](https://github.com/punithaj-hub/inventory_management_system/blob/main/auth.php): `auth.php`
- [Role session](https://github.com/punithaj-hub/inventory_management_system/blob/main/includes/session.php): `includes/session.php`
- [Page shell](https://github.com/punithaj-hub/inventory_management_system/blob/main/layouts/header.php): `layouts/header.php`
- [Admin navigation](https://github.com/punithaj-hub/inventory_management_system/blob/main/layouts/admin_menu.php): `layouts/admin_menu.php`
- [Special navigation](https://github.com/punithaj-hub/inventory_management_system/blob/main/layouts/special_menu.php): `layouts/special_menu.php`
- [Staff navigation](https://github.com/punithaj-hub/inventory_management_system/blob/main/layouts/user_menu.php): `layouts/user_menu.php`
- [User management](https://github.com/punithaj-hub/inventory_management_system/blob/main/users.php): `users.php`
- [Role groups](https://github.com/punithaj-hub/inventory_management_system/blob/main/group.php): `group.php`

### Inventory

- [Categories](https://github.com/punithaj-hub/inventory_management_system/blob/main/categorie.php): `categorie.php`
- [Product catalog](https://github.com/punithaj-hub/inventory_management_system/blob/main/product.php): `product.php`
- [Product creation and edit](https://github.com/punithaj-hub/inventory_management_system/blob/main/add_product.php): `add_product.php`
- [Product media](https://github.com/punithaj-hub/inventory_management_system/blob/main/media.php): `media.php`
- **Suppliers and orders**

### Sales

- [Sales management](https://github.com/punithaj-hub/inventory_management_system/blob/main/sales.php): `sales.php`
- [Record sale](https://github.com/punithaj-hub/inventory_management_system/blob/main/add_sale.php): `add_sale.php`

### Dashboards and reports

- [Admin dashboard](https://github.com/punithaj-hub/inventory_management_system/blob/main/admin.php): `admin.php`
- [Sales reports](https://github.com/punithaj-hub/inventory_management_system/blob/main/sales_report.php): `sales_report.php`
- [Daily sales](https://github.com/punithaj-hub/inventory_management_system/blob/main/daily_sales.php): `daily_sales.php`
- [Monthly sales](https://github.com/punithaj-hub/inventory_management_system/blob/main/monthly_sales.php): `monthly_sales.php`
- [Report processing](https://github.com/punithaj-hub/inventory_management_system/blob/main/sale_report_process.php): `sale_report_process.php`
- **Low-stock alerts**

### Shared platform

- [Application bootstrap](https://github.com/punithaj-hub/inventory_management_system/blob/main/includes/load.php): `includes/load.php`
- [Shared functions](https://github.com/punithaj-hub/inventory_management_system/blob/main/includes/functions.php): `includes/functions.php`
- [Inventory queries](https://github.com/punithaj-hub/inventory_management_system/blob/main/includes/sql.php): `includes/sql.php`
- [Database connection](https://github.com/punithaj-hub/inventory_management_system/blob/main/includes/database.php): `includes/database.php`

### Other components

- **Staff user**
- **MySQL database**

## Connections

- Staff user → Login form: submits credentials (evidence: `index.php`)
- Login form → Authentication: posts credentials (evidence: `index.php`)
- Authentication → Application bootstrap: loads services (evidence: `auth.php`)
- Authentication → Role session: starts session
- Authentication → Staff user: redirects by role
- Application bootstrap → Shared functions: requires (evidence: `includes/load.php`)
- Application bootstrap → Role session: requires (evidence: `includes/load.php`)
- Application bootstrap → Database connection: requires (evidence: `includes/load.php`)
- Application bootstrap → Inventory queries: requires (evidence: `includes/load.php`)
- Application bootstrap → MySQL database: connects through
- Product catalog → Application bootstrap: loads services (evidence: `product.php`)
- Product creation and edit → Application bootstrap: loads services (evidence: `add_product.php`)
- Product creation and edit → Inventory queries: writes product (evidence: `add_product.php`)
- Product creation and edit → Categories: reads category list (evidence: `add_product.php`)
- Product creation and edit → Product media: reads media list (evidence: `add_product.php`)
- Page shell → Role session: checks login (evidence: `layouts/header.php`)
- Page shell → Admin navigation: includes by role (evidence: `layouts/header.php`)
- Page shell → Special navigation: includes by role (evidence: `layouts/header.php`)
- Page shell → Staff navigation: includes by role (evidence: `layouts/header.php`)
- Admin navigation → Product catalog: links to (evidence: `layouts/admin_menu.php`)
- Admin navigation → Sales management: links to (evidence: `layouts/admin_menu.php`)
- Admin navigation → Categories: links to (evidence: `layouts/admin_menu.php`)
- Admin navigation → User management: links to (evidence: `layouts/admin_menu.php`)
- Admin navigation → Role groups: links to (evidence: `layouts/admin_menu.php`)
- Staff navigation → Sales management: links to (evidence: `layouts/user_menu.php`)
- Staff navigation → Sales reports: links to (evidence: `layouts/user_menu.php`)
- Staff navigation → Daily sales: links to (evidence: `layouts/user_menu.php`)
- Staff navigation → Monthly sales: links to (evidence: `layouts/user_menu.php`)
- Sales management → Record sale: links to
- Admin dashboard → Product catalog: links to (evidence: `admin.php`)
- Admin dashboard → Sales management: links to (evidence: `admin.php`)
- Admin dashboard → Inventory queries: requests summary data (evidence: `admin.php`)
- Sales reports → Report processing: processes report
- Daily sales → Application bootstrap: loads services (evidence: `daily_sales.php`)
- Monthly sales → Application bootstrap: loads services (evidence: `monthly_sales.php`)
- Suppliers and orders → Product catalog: supports restocking (evidence: `README.md`)
- Low-stock alerts → Product catalog: monitors stock (evidence: `README.md`)
