# chaaniee/baiparts_inventory_pos_it14-l architecture

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

- Interactive diagram: https://gitdiagram.com/chaaniee/baiparts_inventory_pos_it14-l
- Repository: https://github.com/chaaniee/baiparts_inventory_pos_it14-l

## Overview

This is a browser-based inventory and point-of-sale application for managing parts across branches, with role-based access. The principal workflow is a signed-in staff member using a routed page to perform an inventory or sales task; the shared client sends requests to PHP endpoints, which read or update application data. The tree also shows purchasing, imports, reporting, low-stock alerts, user administration, and activity history. Several backend endpoints are unsampled, so their internal calls and data relationships are not asserted.

Main entry points: [`client/src/App.jsx`](https://github.com/chaaniee/baiparts_inventory_pos_it14-l/blob/main/client/src/App.jsx) (Routes and layout), [`client/src/api/client.js`](https://github.com/chaaniee/baiparts_inventory_pos_it14-l/blob/main/client/src/api/client.js) (HTTP client), [`client/src/context/AuthContext.jsx`](https://github.com/chaaniee/baiparts_inventory_pos_it14-l/blob/main/client/src/context/AuthContext.jsx) (Session context), [`client/src/pages/Dashboard.jsx`](https://github.com/chaaniee/baiparts_inventory_pos_it14-l/blob/main/client/src/pages/Dashboard.jsx) (Dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_app["Routes and layout<br/>[App.jsx]"]
  node_authcontext["Session context<br/>[AuthContext.jsx]"]
  node_apiclient["HTTP client<br/>[client.js]"]
  node_dashboard["Dashboard<br/>[Dashboard.jsx]"]
  node_login["Login<br/>[Login.jsx]"]
end

subgraph group_inventory["Inventory operations"]
  node_parts["Parts<br/>[Parts.jsx]"]
  node_import["Parts import<br/>[Import.jsx]"]
  node_stockmoves["Stock movements<br/>[StockMovements.jsx]"]
  node_lowstock["Low-stock alerts<br/>[LowStockAlerts.jsx]"]
end

subgraph group_commerce["Sales and purchasing"]
  node_pos["Point of sale<br/>[PointOfSales.jsx]"]
  node_saleshistory["Sales history<br/>[SalesHistory.jsx]"]
  node_purchaseorders["Purchase orders<br/>[PurchaseOrders.jsx]"]
  node_suppliers["Suppliers<br/>[Suppliers.jsx]"]
  node_reports["Reports<br/>[Reports.jsx]"]
end

subgraph group_platform["API and access"]
  node_users["User administration<br/>[Users.jsx]"]
  node_activity["Activity history<br/>[ActivityLog.jsx]"]
  node_api["PHP API endpoints"]
  node_authapi["Sign-in endpoint<br/>[login.php]"]
  node_authhelper["Access and role checks<br/>[auth.php]"]
  node_database[("MySQL database<br/>[db.php]")]
end

node_staff(("Staff user"))

node_staff -->|"uses"| node_app
node_app -->|"routes"| node_login
node_app -->|"routes"| node_dashboard
node_app -->|"routes"| node_parts
node_app -->|"routes"| node_import
node_app -->|"routes"| node_stockmoves
node_app -->|"routes"| node_lowstock
node_app -->|"routes"| node_pos
node_app -->|"routes"| node_saleshistory
node_app -->|"routes"| node_purchaseorders
node_app -->|"routes"| node_suppliers
node_app -->|"routes"| node_reports
node_app -->|"routes"| node_users
node_app -->|"routes"| node_activity
node_authcontext -->|"requests"| node_apiclient
node_login -.->|"signs in"| node_authcontext
node_dashboard -->|"requests"| node_apiclient
node_parts -->|"requests"| node_apiclient
node_import -->|"uploads"| node_apiclient
node_stockmoves -->|"requests"| node_apiclient
node_lowstock -->|"requests"| node_apiclient
node_pos -->|"requests"| node_apiclient
node_saleshistory -->|"requests"| node_apiclient
node_purchaseorders -->|"requests"| node_apiclient
node_suppliers -->|"requests"| node_apiclient
node_reports -->|"requests"| node_apiclient
node_users -->|"requests"| node_apiclient
node_activity -->|"requests"| node_apiclient
node_apiclient -->|"sends HTTP"| node_api
node_api -.->|"includes"| node_authapi
node_authhelper -->|"queries"| node_database
node_authapi -->|"queries"| node_database

click node_app "https://github.com/chaaniee/baiparts_inventory_pos_it14-l/blob/main/client/src/App.jsx"
click node_authcontext "https://github.com/chaaniee/baiparts_inventory_pos_it14-l/blob/main/client/src/context/AuthContext.jsx"
click node_apiclient "https://github.com/chaaniee/baiparts_inventory_pos_it14-l/blob/main/client/src/api/client.js"
click node_dashboard "https://github.com/chaaniee/baiparts_inventory_pos_it14-l/blob/main/client/src/pages/Dashboard.jsx"
click node_login "https://github.com/chaaniee/baiparts_inventory_pos_it14-l/blob/main/client/src/pages/Login.jsx"
click node_parts "https://github.com/chaaniee/baiparts_inventory_pos_it14-l/blob/main/client/src/pages/Parts.jsx"
click node_import "https://github.com/chaaniee/baiparts_inventory_pos_it14-l/blob/main/client/src/pages/Import.jsx"
click node_stockmoves "https://github.com/chaaniee/baiparts_inventory_pos_it14-l/blob/main/client/src/pages/StockMovements.jsx"
click node_lowstock "https://github.com/chaaniee/baiparts_inventory_pos_it14-l/blob/main/client/src/pages/LowStockAlerts.jsx"
click node_pos "https://github.com/chaaniee/baiparts_inventory_pos_it14-l/blob/main/client/src/pages/PointOfSales.jsx"
click node_saleshistory "https://github.com/chaaniee/baiparts_inventory_pos_it14-l/blob/main/client/src/pages/SalesHistory.jsx"
click node_purchaseorders "https://github.com/chaaniee/baiparts_inventory_pos_it14-l/blob/main/client/src/pages/PurchaseOrders.jsx"
click node_suppliers "https://github.com/chaaniee/baiparts_inventory_pos_it14-l/blob/main/client/src/pages/Suppliers.jsx"
click node_reports "https://github.com/chaaniee/baiparts_inventory_pos_it14-l/blob/main/client/src/pages/Reports.jsx"
click node_users "https://github.com/chaaniee/baiparts_inventory_pos_it14-l/blob/main/client/src/pages/Users.jsx"
click node_activity "https://github.com/chaaniee/baiparts_inventory_pos_it14-l/blob/main/client/src/pages/ActivityLog.jsx"
click node_api "https://github.com/chaaniee/baiparts_inventory_pos_it14-l/tree/main/api"
click node_authapi "https://github.com/chaaniee/baiparts_inventory_pos_it14-l/blob/main/api/auth/login.php"
click node_authhelper "https://github.com/chaaniee/baiparts_inventory_pos_it14-l/blob/main/api/helpers/auth.php"
click node_database "https://github.com/chaaniee/baiparts_inventory_pos_it14-l/blob/main/api/config/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_app,node_authcontext,node_apiclient,node_dashboard,node_login,node_staff toneBlue
class node_parts,node_import,node_stockmoves,node_lowstock toneAmber
class node_pos,node_saleshistory,node_purchaseorders,node_suppliers,node_reports toneMint
class node_users,node_activity,node_api,node_authapi,node_authhelper,node_database toneRose
```

## Components

### Web client

- [Routes and layout](https://github.com/chaaniee/baiparts_inventory_pos_it14-l/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Session context](https://github.com/chaaniee/baiparts_inventory_pos_it14-l/blob/main/client/src/context/AuthContext.jsx): `client/src/context/AuthContext.jsx`
- [HTTP client](https://github.com/chaaniee/baiparts_inventory_pos_it14-l/blob/main/client/src/api/client.js): `client/src/api/client.js`
- [Dashboard](https://github.com/chaaniee/baiparts_inventory_pos_it14-l/blob/main/client/src/pages/Dashboard.jsx): `client/src/pages/Dashboard.jsx`
- [Login](https://github.com/chaaniee/baiparts_inventory_pos_it14-l/blob/main/client/src/pages/Login.jsx): `client/src/pages/Login.jsx`

### Inventory operations

- [Parts](https://github.com/chaaniee/baiparts_inventory_pos_it14-l/blob/main/client/src/pages/Parts.jsx): `client/src/pages/Parts.jsx`
- [Parts import](https://github.com/chaaniee/baiparts_inventory_pos_it14-l/blob/main/client/src/pages/Import.jsx): `client/src/pages/Import.jsx`
- [Stock movements](https://github.com/chaaniee/baiparts_inventory_pos_it14-l/blob/main/client/src/pages/StockMovements.jsx): `client/src/pages/StockMovements.jsx`
- [Low-stock alerts](https://github.com/chaaniee/baiparts_inventory_pos_it14-l/blob/main/client/src/pages/LowStockAlerts.jsx): `client/src/pages/LowStockAlerts.jsx`

### Sales and purchasing

- [Point of sale](https://github.com/chaaniee/baiparts_inventory_pos_it14-l/blob/main/client/src/pages/PointOfSales.jsx): `client/src/pages/PointOfSales.jsx`
- [Sales history](https://github.com/chaaniee/baiparts_inventory_pos_it14-l/blob/main/client/src/pages/SalesHistory.jsx): `client/src/pages/SalesHistory.jsx`
- [Purchase orders](https://github.com/chaaniee/baiparts_inventory_pos_it14-l/blob/main/client/src/pages/PurchaseOrders.jsx): `client/src/pages/PurchaseOrders.jsx`
- [Suppliers](https://github.com/chaaniee/baiparts_inventory_pos_it14-l/blob/main/client/src/pages/Suppliers.jsx): `client/src/pages/Suppliers.jsx`
- [Reports](https://github.com/chaaniee/baiparts_inventory_pos_it14-l/blob/main/client/src/pages/Reports.jsx): `client/src/pages/Reports.jsx`

### API and access

- [User administration](https://github.com/chaaniee/baiparts_inventory_pos_it14-l/blob/main/client/src/pages/Users.jsx): `client/src/pages/Users.jsx`
- [Activity history](https://github.com/chaaniee/baiparts_inventory_pos_it14-l/blob/main/client/src/pages/ActivityLog.jsx): `client/src/pages/ActivityLog.jsx`
- [PHP API endpoints](https://github.com/chaaniee/baiparts_inventory_pos_it14-l/tree/main/api): `api`
- [Sign-in endpoint](https://github.com/chaaniee/baiparts_inventory_pos_it14-l/blob/main/api/auth/login.php): `api/auth/login.php`
- [Access and role checks](https://github.com/chaaniee/baiparts_inventory_pos_it14-l/blob/main/api/helpers/auth.php): `api/helpers/auth.php`
- [MySQL database](https://github.com/chaaniee/baiparts_inventory_pos_it14-l/blob/main/api/config/db.php): `api/config/db.php`

### Other components

- **Staff user**

## Connections

- Staff user → Routes and layout: uses (evidence: `client/src/App.jsx`)
- Routes and layout → Login: routes (evidence: `client/src/App.jsx`)
- Routes and layout → Dashboard: routes (evidence: `client/src/App.jsx`)
- Routes and layout → Parts: routes (evidence: `client/src/App.jsx`)
- Routes and layout → Parts import: routes (evidence: `client/src/App.jsx`)
- Routes and layout → Stock movements: routes (evidence: `client/src/App.jsx`)
- Routes and layout → Low-stock alerts: routes (evidence: `client/src/App.jsx`)
- Routes and layout → Point of sale: routes (evidence: `client/src/App.jsx`)
- Routes and layout → Sales history: routes (evidence: `client/src/App.jsx`)
- Routes and layout → Purchase orders: routes (evidence: `client/src/App.jsx`)
- Routes and layout → Suppliers: routes (evidence: `client/src/App.jsx`)
- Routes and layout → Reports: routes (evidence: `client/src/App.jsx`)
- Routes and layout → User administration: routes (evidence: `client/src/App.jsx`)
- Routes and layout → Activity history: routes (evidence: `client/src/App.jsx`)
- Session context → HTTP client: requests (evidence: `client/src/context/AuthContext.jsx`)
- Login → Session context: signs in
- Dashboard → HTTP client: requests (evidence: `client/src/pages/Dashboard.jsx`)
- Parts → HTTP client: requests (evidence: `client/src/pages/Parts.jsx`)
- Parts import → HTTP client: uploads (evidence: `client/src/pages/Import.jsx`)
- Stock movements → HTTP client: requests (evidence: `client/src/pages/StockMovements.jsx`)
- Low-stock alerts → HTTP client: requests (evidence: `client/src/pages/LowStockAlerts.jsx`)
- Point of sale → HTTP client: requests (evidence: `client/src/pages/PointOfSales.jsx`)
- Sales history → HTTP client: requests (evidence: `client/src/pages/SalesHistory.jsx`)
- Purchase orders → HTTP client: requests (evidence: `client/src/pages/PurchaseOrders.jsx`)
- Suppliers → HTTP client: requests (evidence: `client/src/pages/Suppliers.jsx`)
- Reports → HTTP client: requests (evidence: `client/src/pages/Reports.jsx`)
- User administration → HTTP client: requests (evidence: `client/src/pages/Users.jsx`)
- Activity history → HTTP client: requests (evidence: `client/src/pages/ActivityLog.jsx`)
- HTTP client → PHP API endpoints: sends HTTP (evidence: `client/src/api/client.js`)
- PHP API endpoints → Sign-in endpoint: includes (evidence: `api/auth/login.php`)
- Access and role checks → MySQL database: queries (evidence: `api/helpers/auth.php`)
- Sign-in endpoint → MySQL database: queries (evidence: `api/auth/login.php`)
