# darktotem/supply-hub-inventory-management-system architecture

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

- Interactive diagram: https://gitdiagram.com/darktotem/supply-hub-inventory-management-system
- Repository: https://github.com/darktotem/supply-hub-inventory-management-system

## Overview

Supply Hub is an inventory-management application with a React client and Flask API. Its documented workflows cover authentication and employee administration, inventory, supplier and supply-order management, warehouse deliveries and reports, sales, invoices/payments, and auditing. The sampled backend shows Flask registering controller blueprints; supply and warehouse handlers operate on inventory, supplier, order, and report models. Client-to-API wiring and several client screens were not shown, so those relationships are left unasserted.

Main entry points: [`server/app.py`](https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/server/app.py) (Flask API), [`server/controllers/supply.py`](https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/server/controllers/supply.py) (Supply management), [`server/controllers/warehouse.py`](https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/server/controllers/warehouse.py) (Warehouse operations), [`server/controllers/auth.py`](https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/server/controllers/auth.py) (Authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["React client"]
  node_main["Client entry<br/>[main.jsx]"]
  node_appui["Application shell<br/>[App.jsx]"]
  node_navbar["Navigation<br/>[Navbar.jsx]"]
  node_loginui["Login screen<br/>[login.jsx]"]
  node_employeesui["Employee admin<br/>[employees.jsx]"]
  node_inventoryui["Inventory screen<br/>[inventory.jsx]"]
  node_salesui["Sales screens<br/>[sales.js]"]
  node_customersui["Customer records<br/>[customers.jsx]"]
  node_ordersui["Customer orders"]
  node_supplyui["Supply screens<br/>[supply_orders.jsx]"]
  node_suppliersui["Supplier registry<br/>[reg_suppliers.jsx]"]
  node_historyui["Supply history<br/>[history.jsx]"]
  node_warehouseui["Warehouse screens<br/>[add_product.jsx]"]
  node_deliveriesui["Deliveries screen<br/>[deliveries.jsx]"]
  node_reportsui["Reports screen<br/>[reports.jsx]"]
  node_financeui["Invoice screen<br/>[invoices.jsx]"]
  node_paymentui["Payment screen<br/>[payment.jsx]"]
  node_auditui["Audit dashboard"]
end

subgraph group_identity["Identity and access"]
  node_auth["Authentication<br/>[auth.py]"]
  node_tokens["Token utilities<br/>[tokens.py]"]
  node_authguard["Request authorization<br/>[decorators.py]"]
end

subgraph group_operations["Operational API"]
  node_api["Flask API<br/>[app.py]"]
  node_supply["Supply management<br/>[supply.py]"]
  node_warehouse["Warehouse operations<br/>[warehouse.py]"]
  node_inventoryapi["Inventory API<br/>[inventory.py]"]
  node_sales["Sales API<br/>[sales.py]"]
  node_invoices["Invoice API<br/>[invoice.py]"]
end

subgraph group_domain["Domain and persistence"]
  node_dbext["Database extensions<br/>[extensions.py]"]
  node_inventory["Inventory model<br/>[inventory.py]"]
  node_supplier["Supplier model<br/>[supplier.py]"]
  node_supplyhistory["Supply history model<br/>[supply_history.py]"]
  node_report["Report model<br/>[report.py]"]
  node_user_model["User model<br/>[user.py]"]
end

node_user(("Employee"))

node_main -->|"renders"| node_appui
node_api -->|"registers"| node_auth
node_api -->|"registers"| node_supply
node_api -->|"registers"| node_warehouse
node_api -->|"registers"| node_inventoryapi
node_api -->|"registers"| node_sales
node_api -->|"registers"| node_invoices
node_auth -->|"queries"| node_user_model
node_auth -->|"creates tokens"| node_tokens
node_authguard -->|"decodes tokens"| node_tokens
node_authguard -->|"loads user"| node_user_model
node_supply -->|"reads and writes"| node_supplier
node_supply -->|"reads and writes"| node_supplyhistory
node_supply -->|"checks product"| node_inventory
node_warehouse -->|"updates stock"| node_inventory
node_warehouse -->|"reads and updates"| node_supplyhistory
node_warehouse -->|"creates report"| node_report
node_report -->|"queries stock"| node_inventory

click node_main "https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/client/src/main.jsx"
click node_appui "https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/client/src/App.jsx"
click node_navbar "https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/client/src/components/Navbar.jsx"
click node_loginui "https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/client/src/features/auth/login.jsx"
click node_employeesui "https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/client/src/features/admin/employees.jsx"
click node_inventoryui "https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/client/src/features/inventory/inventory.jsx"
click node_salesui "https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/client/src/features/sales/sales.js"
click node_customersui "https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/client/src/features/sales/customers.jsx"
click node_ordersui "https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/client/src/features/sales/customer_orders.jsx"
click node_supplyui "https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/client/src/features/supply/supply_orders.jsx"
click node_suppliersui "https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/client/src/features/supply/reg_suppliers.jsx"
click node_historyui "https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/client/src/features/supply/history.jsx"
click node_warehouseui "https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/client/src/features/wearhouse/add_product.jsx"
click node_deliveriesui "https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/client/src/features/wearhouse/deliveries.jsx"
click node_reportsui "https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/client/src/features/wearhouse/reports.jsx"
click node_financeui "https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/client/src/features/finance/invoices.jsx"
click node_paymentui "https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/client/src/features/finance/payment.jsx"
click node_auditui "https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/client/src/features/auditor/audit_dashboard.jsx"
click node_api "https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/server/app.py"
click node_auth "https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/server/controllers/auth.py"
click node_tokens "https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/server/utils/tokens.py"
click node_authguard "https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/server/utils/decorators.py"
click node_supply "https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/server/controllers/supply.py"
click node_warehouse "https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/server/controllers/warehouse.py"
click node_inventoryapi "https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/server/controllers/inventory.py"
click node_sales "https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/server/controllers/sales.py"
click node_invoices "https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/server/controllers/invoice.py"
click node_dbext "https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/server/extensions.py"
click node_inventory "https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/server/models/inventory.py"
click node_supplier "https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/server/models/supplier.py"
click node_supplyhistory "https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/server/models/supply_history.py"
click node_report "https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/server/models/report.py"
click node_user_model "https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/server/models/user.py"

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_main,node_appui,node_navbar,node_loginui,node_employeesui,node_inventoryui,node_salesui,node_customersui,node_ordersui,node_supplyui,node_suppliersui,node_historyui,node_warehouseui,node_deliveriesui,node_reportsui,node_financeui,node_paymentui,node_auditui toneBlue
class node_auth,node_tokens,node_authguard toneAmber
class node_api,node_supply,node_warehouse,node_inventoryapi,node_sales,node_invoices toneMint
class node_dbext,node_inventory,node_supplier,node_supplyhistory,node_report,node_user_model toneRose
class node_user toneIndigo
```

## Components

### React client

- [Client entry](https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/client/src/main.jsx): `client/src/main.jsx`
- [Application shell](https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Navigation](https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/client/src/components/Navbar.jsx): `client/src/components/Navbar.jsx`
- [Login screen](https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/client/src/features/auth/login.jsx): `client/src/features/auth/login.jsx`
- [Employee admin](https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/client/src/features/admin/employees.jsx): `client/src/features/admin/employees.jsx`
- [Inventory screen](https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/client/src/features/inventory/inventory.jsx): `client/src/features/inventory/inventory.jsx`
- [Sales screens](https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/client/src/features/sales/sales.js): `client/src/features/sales/sales.js`
- [Customer records](https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/client/src/features/sales/customers.jsx): `client/src/features/sales/customers.jsx`
- [Customer orders](https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/client/src/features/sales/customer_orders.jsx): `client/src/features/sales/customer_orders.jsx`
- [Supply screens](https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/client/src/features/supply/supply_orders.jsx): `client/src/features/supply/supply_orders.jsx`
- [Supplier registry](https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/client/src/features/supply/reg_suppliers.jsx): `client/src/features/supply/reg_suppliers.jsx`
- [Supply history](https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/client/src/features/supply/history.jsx): `client/src/features/supply/history.jsx`
- [Warehouse screens](https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/client/src/features/wearhouse/add_product.jsx): `client/src/features/wearhouse/add_product.jsx`
- [Deliveries screen](https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/client/src/features/wearhouse/deliveries.jsx): `client/src/features/wearhouse/deliveries.jsx`
- [Reports screen](https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/client/src/features/wearhouse/reports.jsx): `client/src/features/wearhouse/reports.jsx`
- [Invoice screen](https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/client/src/features/finance/invoices.jsx): `client/src/features/finance/invoices.jsx`
- [Payment screen](https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/client/src/features/finance/payment.jsx): `client/src/features/finance/payment.jsx`
- [Audit dashboard](https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/client/src/features/auditor/audit_dashboard.jsx): `client/src/features/auditor/audit_dashboard.jsx`

### Identity and access

- [Authentication](https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/server/controllers/auth.py): `server/controllers/auth.py`
- [Token utilities](https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/server/utils/tokens.py): `server/utils/tokens.py`
- [Request authorization](https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/server/utils/decorators.py): `server/utils/decorators.py`

### Operational API

- [Flask API](https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/server/app.py): `server/app.py`
- [Supply management](https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/server/controllers/supply.py): `server/controllers/supply.py`
- [Warehouse operations](https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/server/controllers/warehouse.py): `server/controllers/warehouse.py`
- [Inventory API](https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/server/controllers/inventory.py): `server/controllers/inventory.py`
- [Sales API](https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/server/controllers/sales.py): `server/controllers/sales.py`
- [Invoice API](https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/server/controllers/invoice.py): `server/controllers/invoice.py`

### Domain and persistence

- [Database extensions](https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/server/extensions.py): `server/extensions.py`
- [Inventory model](https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/server/models/inventory.py): `server/models/inventory.py`
- [Supplier model](https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/server/models/supplier.py): `server/models/supplier.py`
- [Supply history model](https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/server/models/supply_history.py): `server/models/supply_history.py`
- [Report model](https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/server/models/report.py): `server/models/report.py`
- [User model](https://github.com/darktotem/supply-hub-inventory-management-system/blob/main/server/models/user.py): `server/models/user.py`

### Other components

- **Employee**

## Connections

- Client entry → Application shell: renders (evidence: `client/src/main.jsx`)
- Flask API → Authentication: registers (evidence: `server/app.py`)
- Flask API → Supply management: registers (evidence: `server/app.py`)
- Flask API → Warehouse operations: registers (evidence: `server/app.py`)
- Flask API → Inventory API: registers (evidence: `server/app.py`)
- Flask API → Sales API: registers (evidence: `server/app.py`)
- Flask API → Invoice API: registers (evidence: `server/app.py`)
- Authentication → User model: queries (evidence: `server/controllers/auth.py`)
- Authentication → Token utilities: creates tokens (evidence: `server/controllers/auth.py`)
- Request authorization → Token utilities: decodes tokens (evidence: `server/utils/decorators.py`)
- Request authorization → User model: loads user (evidence: `server/utils/decorators.py`)
- Supply management → Supplier model: reads and writes (evidence: `server/controllers/supply.py`)
- Supply management → Supply history model: reads and writes (evidence: `server/controllers/supply.py`)
- Supply management → Inventory model: checks product (evidence: `server/controllers/supply.py`)
- Warehouse operations → Inventory model: updates stock (evidence: `server/controllers/warehouse.py`)
- Warehouse operations → Supply history model: reads and updates (evidence: `server/controllers/warehouse.py`)
- Warehouse operations → Report model: creates report (evidence: `server/controllers/warehouse.py`)
- Report model → Inventory model: queries stock (evidence: `server/models/report.py`)
