# unknown-uk030215/inventory-system architecture

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

- Interactive diagram: https://gitdiagram.com/unknown-uk030215/inventory-system
- Repository: https://github.com/unknown-uk030215/inventory-system

## Overview

This is a browser-based inventory management system with separate administrator and staff experiences. Users sign in, pass role-based route protection, and reach dashboards and task pages; staff can view assigned assets, scan QR codes, and submit reports, while administrators manage assets, users, reports, and disposed items. InventoryContext loads and distributes shared inventory data, with pages also making direct Supabase calls. The README gives no feature detail, so capabilities are inferred from routes and source-index references; several page implementations were not excerpted.

Main entry points: [`inventory-system/src/App.jsx`](https://github.com/unknown-uk030215/inventory-system/blob/main/inventory-system/src/App.jsx) (Route application), [`inventory-system/src/lib/supabase.js`](https://github.com/unknown-uk030215/inventory-system/blob/main/inventory-system/src/lib/supabase.js) (Supabase client), [`inventory-system/src/context/InventoryContext.jsx`](https://github.com/unknown-uk030215/inventory-system/blob/main/inventory-system/src/context/InventoryContext.jsx) (Inventory state), [`inventory-system/src/components/ProtectedRoute.jsx`](https://github.com/unknown-uk030215/inventory-system/blob/main/inventory-system/src/components/ProtectedRoute.jsx) (Role guard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_routing["App and access"]
  node_app["Route application<br/>[App.jsx]"]
  node_guard["Role guard<br/>[ProtectedRoute.jsx]"]
  node_login["Sign in<br/>[Login.jsx]"]
end

subgraph group_admin["Administration"]
  node_admin_layout["Admin shell<br/>[AdminLayout.jsx]"]
  node_admin_dashboard["Admin dashboard<br/>[Dashboard.jsx]"]
  node_admin_assets["Asset management<br/>[Assets.jsx]"]
  node_assets_enhanced["Enhanced assets"]
  node_admin_users["User management<br/>[Users.jsx]"]
  node_admin_reports["Report management<br/>[Reports.jsx]"]
  node_disposed["Disposed assets<br/>[DisposedAssets.jsx]"]
  node_admin_profile["Admin profile<br/>[Profile.jsx]"]
end

subgraph group_staff["Staff workspace"]
  node_staff_layout["Staff shell<br/>[StaffLayout.jsx]"]
  node_staff_dashboard["Staff dashboard<br/>[Dashboard.jsx]"]
  node_my_assets["My assets<br/>[MyAssets.jsx]"]
  node_scanner["QR scanner<br/>[QRScanner.jsx]"]
  node_my_reports["My reports<br/>[MyReports.jsx]"]
  node_staff_profile["Staff profile<br/>[Profile.jsx]"]
end

subgraph group_data["Inventory data"]
  node_inventory_context["Inventory state"]
  node_supabase_client["Supabase client<br/>[supabase.js]"]
end

node_visitor(("User"))
node_supabase[("Supabase service")]

node_visitor -->|"opens"| node_app
node_app -->|"routes"| node_login
node_app -->|"protects routes"| node_guard
node_guard -->|"admits admin"| node_admin_layout
node_guard -->|"admits staff"| node_staff_layout
node_app -->|"routes"| node_admin_dashboard
node_app -->|"routes"| node_admin_assets
node_app -->|"routes"| node_admin_users
node_app -->|"routes"| node_admin_reports
node_app -->|"routes"| node_disposed
node_app -->|"routes"| node_admin_profile
node_app -->|"routes"| node_staff_dashboard
node_app -->|"routes"| node_my_assets
node_app -->|"routes"| node_scanner
node_app -->|"routes"| node_my_reports
node_app -->|"routes"| node_staff_profile
node_admin_layout -->|"uses page title hook"| node_assets_enhanced
node_admin_assets -->|"reads and refreshes"| node_inventory_context
node_admin_assets -->|"writes assets"| node_supabase_client
node_assets_enhanced -->|"uses inventory state"| node_inventory_context
node_assets_enhanced -->|"uses data client"| node_supabase_client
node_admin_dashboard -->|"uses inventory state"| node_inventory_context
node_admin_reports -->|"uses inventory state"| node_inventory_context
node_admin_reports -->|"queries reports"| node_supabase_client
node_admin_users -->|"reads users"| node_inventory_context
node_admin_users -->|"manages accounts"| node_supabase_client
node_disposed -->|"uses inventory state"| node_inventory_context
node_admin_profile -->|"updates profile"| node_supabase_client
node_login -->|"authenticates"| node_supabase_client
node_staff_dashboard -->|"uses inventory state"| node_inventory_context
node_staff_dashboard -->|"queries data"| node_supabase_client
node_my_assets -->|"uses inventory state"| node_inventory_context
node_my_assets -->|"queries assets"| node_supabase_client
node_scanner -->|"refreshes inventory"| node_inventory_context
node_scanner -->|"looks up and reports"| node_supabase_client
node_my_reports -->|"uses report state"| node_inventory_context
node_staff_profile -->|"updates account"| node_supabase_client
node_inventory_context -->|"loads and subscribes"| node_supabase_client
node_supabase_client -->|"queries backend"| node_supabase

click node_app "https://github.com/unknown-uk030215/inventory-system/blob/main/inventory-system/src/App.jsx"
click node_guard "https://github.com/unknown-uk030215/inventory-system/blob/main/inventory-system/src/components/ProtectedRoute.jsx"
click node_login "https://github.com/unknown-uk030215/inventory-system/blob/main/inventory-system/src/pages/auth/Login.jsx"
click node_admin_layout "https://github.com/unknown-uk030215/inventory-system/blob/main/inventory-system/src/layouts/AdminLayout.jsx"
click node_staff_layout "https://github.com/unknown-uk030215/inventory-system/blob/main/inventory-system/src/layouts/StaffLayout.jsx"
click node_admin_dashboard "https://github.com/unknown-uk030215/inventory-system/blob/main/inventory-system/src/pages/admin/Dashboard.jsx"
click node_admin_assets "https://github.com/unknown-uk030215/inventory-system/blob/main/inventory-system/src/pages/admin/Assets.jsx"
click node_assets_enhanced "https://github.com/unknown-uk030215/inventory-system/blob/main/inventory-system/src/pages/admin/Assets-enhanced.jsx"
click node_admin_users "https://github.com/unknown-uk030215/inventory-system/blob/main/inventory-system/src/pages/admin/Users.jsx"
click node_admin_reports "https://github.com/unknown-uk030215/inventory-system/blob/main/inventory-system/src/pages/admin/Reports.jsx"
click node_disposed "https://github.com/unknown-uk030215/inventory-system/blob/main/inventory-system/src/pages/admin/DisposedAssets.jsx"
click node_admin_profile "https://github.com/unknown-uk030215/inventory-system/blob/main/inventory-system/src/pages/admin/Profile.jsx"
click node_staff_dashboard "https://github.com/unknown-uk030215/inventory-system/blob/main/inventory-system/src/pages/staff/Dashboard.jsx"
click node_my_assets "https://github.com/unknown-uk030215/inventory-system/blob/main/inventory-system/src/pages/staff/MyAssets.jsx"
click node_scanner "https://github.com/unknown-uk030215/inventory-system/blob/main/inventory-system/src/pages/staff/QRScanner.jsx"
click node_my_reports "https://github.com/unknown-uk030215/inventory-system/blob/main/inventory-system/src/pages/staff/MyReports.jsx"
click node_staff_profile "https://github.com/unknown-uk030215/inventory-system/blob/main/inventory-system/src/pages/staff/Profile.jsx"
click node_inventory_context "https://github.com/unknown-uk030215/inventory-system/blob/main/inventory-system/src/context/InventoryContext.jsx"
click node_supabase_client "https://github.com/unknown-uk030215/inventory-system/blob/main/inventory-system/src/lib/supabase.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_app,node_guard,node_login,node_visitor toneBlue
class node_admin_layout,node_admin_dashboard,node_admin_assets,node_assets_enhanced,node_admin_users,node_admin_reports,node_disposed,node_admin_profile,node_supabase toneAmber
class node_staff_layout,node_staff_dashboard,node_my_assets,node_scanner,node_my_reports,node_staff_profile toneMint
class node_inventory_context,node_supabase_client toneRose
```

## Components

### App and access

- [Route application](https://github.com/unknown-uk030215/inventory-system/blob/main/inventory-system/src/App.jsx): `inventory-system/src/App.jsx`
- [Role guard](https://github.com/unknown-uk030215/inventory-system/blob/main/inventory-system/src/components/ProtectedRoute.jsx): `inventory-system/src/components/ProtectedRoute.jsx`
- [Sign in](https://github.com/unknown-uk030215/inventory-system/blob/main/inventory-system/src/pages/auth/Login.jsx): `inventory-system/src/pages/auth/Login.jsx`

### Administration

- [Admin shell](https://github.com/unknown-uk030215/inventory-system/blob/main/inventory-system/src/layouts/AdminLayout.jsx): `inventory-system/src/layouts/AdminLayout.jsx`
- [Admin dashboard](https://github.com/unknown-uk030215/inventory-system/blob/main/inventory-system/src/pages/admin/Dashboard.jsx): `inventory-system/src/pages/admin/Dashboard.jsx`
- [Asset management](https://github.com/unknown-uk030215/inventory-system/blob/main/inventory-system/src/pages/admin/Assets.jsx): `inventory-system/src/pages/admin/Assets.jsx`
- [Enhanced assets](https://github.com/unknown-uk030215/inventory-system/blob/main/inventory-system/src/pages/admin/Assets-enhanced.jsx): `inventory-system/src/pages/admin/Assets-enhanced.jsx`
- [User management](https://github.com/unknown-uk030215/inventory-system/blob/main/inventory-system/src/pages/admin/Users.jsx): `inventory-system/src/pages/admin/Users.jsx`
- [Report management](https://github.com/unknown-uk030215/inventory-system/blob/main/inventory-system/src/pages/admin/Reports.jsx): `inventory-system/src/pages/admin/Reports.jsx`
- [Disposed assets](https://github.com/unknown-uk030215/inventory-system/blob/main/inventory-system/src/pages/admin/DisposedAssets.jsx): `inventory-system/src/pages/admin/DisposedAssets.jsx`
- [Admin profile](https://github.com/unknown-uk030215/inventory-system/blob/main/inventory-system/src/pages/admin/Profile.jsx): `inventory-system/src/pages/admin/Profile.jsx`

### Staff workspace

- [Staff shell](https://github.com/unknown-uk030215/inventory-system/blob/main/inventory-system/src/layouts/StaffLayout.jsx): `inventory-system/src/layouts/StaffLayout.jsx`
- [Staff dashboard](https://github.com/unknown-uk030215/inventory-system/blob/main/inventory-system/src/pages/staff/Dashboard.jsx): `inventory-system/src/pages/staff/Dashboard.jsx`
- [My assets](https://github.com/unknown-uk030215/inventory-system/blob/main/inventory-system/src/pages/staff/MyAssets.jsx): `inventory-system/src/pages/staff/MyAssets.jsx`
- [QR scanner](https://github.com/unknown-uk030215/inventory-system/blob/main/inventory-system/src/pages/staff/QRScanner.jsx): `inventory-system/src/pages/staff/QRScanner.jsx`
- [My reports](https://github.com/unknown-uk030215/inventory-system/blob/main/inventory-system/src/pages/staff/MyReports.jsx): `inventory-system/src/pages/staff/MyReports.jsx`
- [Staff profile](https://github.com/unknown-uk030215/inventory-system/blob/main/inventory-system/src/pages/staff/Profile.jsx): `inventory-system/src/pages/staff/Profile.jsx`

### Inventory data

- [Inventory state](https://github.com/unknown-uk030215/inventory-system/blob/main/inventory-system/src/context/InventoryContext.jsx): `inventory-system/src/context/InventoryContext.jsx`
- [Supabase client](https://github.com/unknown-uk030215/inventory-system/blob/main/inventory-system/src/lib/supabase.js): `inventory-system/src/lib/supabase.js`

### Other components

- **User**
- **Supabase service**

## Connections

- User → Route application: opens
- Route application → Sign in: routes (evidence: `inventory-system/src/App.jsx`)
- Route application → Role guard: protects routes (evidence: `inventory-system/src/App.jsx`)
- Role guard → Admin shell: admits admin (evidence: `inventory-system/src/App.jsx`)
- Role guard → Staff shell: admits staff (evidence: `inventory-system/src/App.jsx`)
- Route application → Admin dashboard: routes (evidence: `inventory-system/src/App.jsx`)
- Route application → Asset management: routes (evidence: `inventory-system/src/App.jsx`)
- Route application → User management: routes (evidence: `inventory-system/src/App.jsx`)
- Route application → Report management: routes (evidence: `inventory-system/src/App.jsx`)
- Route application → Disposed assets: routes (evidence: `inventory-system/src/App.jsx`)
- Route application → Admin profile: routes (evidence: `inventory-system/src/App.jsx`)
- Route application → Staff dashboard: routes (evidence: `inventory-system/src/App.jsx`)
- Route application → My assets: routes (evidence: `inventory-system/src/App.jsx`)
- Route application → QR scanner: routes (evidence: `inventory-system/src/App.jsx`)
- Route application → My reports: routes (evidence: `inventory-system/src/App.jsx`)
- Route application → Staff profile: routes (evidence: `inventory-system/src/App.jsx`)
- Admin shell → Enhanced assets: uses page title hook (evidence: `inventory-system/src/pages/admin/Assets-enhanced.jsx`)
- Asset management → Inventory state: reads and refreshes (evidence: `inventory-system/src/pages/admin/Assets.jsx`)
- Asset management → Supabase client: writes assets (evidence: `inventory-system/src/pages/admin/Assets.jsx`)
- Enhanced assets → Inventory state: uses inventory state (evidence: `inventory-system/src/pages/admin/Assets-enhanced.jsx`)
- Enhanced assets → Supabase client: uses data client (evidence: `inventory-system/src/pages/admin/Assets-enhanced.jsx`)
- Admin dashboard → Inventory state: uses inventory state (evidence: `inventory-system/src/pages/admin/Dashboard.jsx`)
- Report management → Inventory state: uses inventory state (evidence: `inventory-system/src/pages/admin/Reports.jsx`)
- Report management → Supabase client: queries reports (evidence: `inventory-system/src/pages/admin/Reports.jsx`)
- User management → Inventory state: reads users (evidence: `inventory-system/src/pages/admin/Users.jsx`)
- User management → Supabase client: manages accounts (evidence: `inventory-system/src/pages/admin/Users.jsx`)
- Disposed assets → Inventory state: uses inventory state (evidence: `inventory-system/src/pages/admin/DisposedAssets.jsx`)
- Admin profile → Supabase client: updates profile (evidence: `inventory-system/src/pages/admin/Profile.jsx`)
- Sign in → Supabase client: authenticates (evidence: `inventory-system/src/pages/auth/Login.jsx`)
- Staff dashboard → Inventory state: uses inventory state (evidence: `inventory-system/src/pages/staff/Dashboard.jsx`)
- Staff dashboard → Supabase client: queries data (evidence: `inventory-system/src/pages/staff/Dashboard.jsx`)
- My assets → Inventory state: uses inventory state (evidence: `inventory-system/src/pages/staff/MyAssets.jsx`)
- My assets → Supabase client: queries assets (evidence: `inventory-system/src/pages/staff/MyAssets.jsx`)
- QR scanner → Inventory state: refreshes inventory (evidence: `inventory-system/src/pages/staff/QRScanner.jsx`)
- QR scanner → Supabase client: looks up and reports (evidence: `inventory-system/src/pages/staff/QRScanner.jsx`)
- My reports → Inventory state: uses report state (evidence: `inventory-system/src/pages/staff/MyReports.jsx`)
- Staff profile → Supabase client: updates account (evidence: `inventory-system/src/pages/staff/Profile.jsx`)
- Inventory state → Supabase client: loads and subscribes (evidence: `inventory-system/src/context/InventoryContext.jsx`)
- Supabase client → Supabase service: queries backend (evidence: `inventory-system/src/lib/supabase.js`)
