# charlesjythambrad/itams_project architecture

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

- Interactive diagram: https://gitdiagram.com/charlesjythambrad/itams_project
- Repository: https://github.com/charlesjythambrad/itams_project

## Overview

ITAMS is a role-segregated IT asset custody and lifecycle platform backed by Supabase. Users sign in through the shared authentication context; guarded routes then dispatch them to ITSD, inventory-staff, or end-user workspaces. Inventory staff manage asset records, assignments and borrowing, repairs, and warranty views; ITSD provides administration and user management, while end users have a personal custody dashboard. The sampled authentication and global search code directly confirms Supabase interactions; the README and route registry establish the broader role and capability map, but unsampled page-level data wiring is not inferred.

Main entry points: [`src/routes/AppRoutes.jsx`](https://github.com/charlesjythambrad/itams_project/blob/main/src/routes/AppRoutes.jsx) (Route registry), [`src/components/inventory/GlobalInventorySearch.jsx`](https://github.com/charlesjythambrad/itams_project/blob/main/src/components/inventory/GlobalInventorySearch.jsx) (Global inventory search), [`src/context/AuthContext.jsx`](https://github.com/charlesjythambrad/itams_project/blob/main/src/context/AuthContext.jsx) (Auth provider), [`src/App.jsx`](https://github.com/charlesjythambrad/itams_project/blob/main/src/App.jsx) (Application root)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App and access"]
  node_app["Application root<br/>[App.jsx]"]
  node_routes["Route registry<br/>[AppRoutes.jsx]"]
  node_guard["Protected routes<br/>[ProtectedRoute.jsx]"]
  node_login["Login interface<br/>[LoginPage.jsx]"]
end

subgraph group_identity["Identity and roles"]
  node_auth["Auth provider<br/>[AuthContext.jsx]"]
  node_client["Supabase client<br/>[supabaseClient.js]"]
  node_rolehook["Role metadata<br/>[useUserRole.js]"]
end

subgraph group_inventory["Asset operations"]
  node_assets["Asset management<br/>[AssetsPage.jsx]"]
  node_custody["Assignments and returns"]
  node_repairs["Repair tracking<br/>[RepairsPage.jsx]"]
  node_warranty["Warranty tracking<br/>[WarrantyPage.jsx]"]
  node_search["Global inventory search"]
end

subgraph group_consoles["Role workspaces"]
  node_dashboard["Role dashboard dispatch<br/>[DashboardPage.jsx]"]
  node_itsd["ITSD console"]
  node_users["User administration"]
  node_staff["Inventory console"]
  node_enduser["End-user custody"]
end

node_people(("Platform users"))
node_supabase[("Supabase Auth and Postgres")]

node_people -->|"opens"| node_app
node_app -->|"provides auth"| node_auth
node_app -->|"renders routes"| node_routes
node_routes -->|"routes sign-in"| node_login
node_login -->|"signs in"| node_auth
node_auth -->|"uses client"| node_client
node_client -->|"auth and queries"| node_supabase
node_supabase -->|"session and records"| node_auth
node_routes -->|"guards access"| node_guard
node_guard -->|"checks session"| node_auth
node_routes -->|"routes dashboard"| node_dashboard
node_dashboard -->|"resolves role"| node_rolehook
node_routes -->|"routes ITSD"| node_itsd
node_routes -->|"routes admin"| node_users
node_routes -->|"routes staff"| node_staff
node_routes -->|"routes end user"| node_enduser
node_routes -->|"routes assets"| node_assets
node_routes -->|"routes custody"| node_custody
node_routes -->|"routes repairs"| node_repairs
node_routes -->|"routes warranty"| node_warranty
node_staff -->|"offers search"| node_search
node_search -->|"queries records"| node_client
node_search -->|"navigates results"| node_assets
node_search -->|"navigates results"| node_custody
node_search -->|"navigates results"| node_repairs

click node_app "https://github.com/charlesjythambrad/itams_project/blob/main/src/App.jsx"
click node_routes "https://github.com/charlesjythambrad/itams_project/blob/main/src/routes/AppRoutes.jsx"
click node_guard "https://github.com/charlesjythambrad/itams_project/blob/main/src/routes/ProtectedRoute.jsx"
click node_login "https://github.com/charlesjythambrad/itams_project/blob/main/src/pages/LoginPage.jsx"
click node_auth "https://github.com/charlesjythambrad/itams_project/blob/main/src/context/AuthContext.jsx"
click node_client "https://github.com/charlesjythambrad/itams_project/blob/main/src/lib/supabaseClient.js"
click node_rolehook "https://github.com/charlesjythambrad/itams_project/blob/main/src/hooks/useUserRole.js"
click node_dashboard "https://github.com/charlesjythambrad/itams_project/blob/main/src/pages/DashboardPage.jsx"
click node_itsd "https://github.com/charlesjythambrad/itams_project/tree/main/src/pages/itsd"
click node_users "https://github.com/charlesjythambrad/itams_project/blob/main/src/pages/itsd/UserManagementPage.jsx"
click node_staff "https://github.com/charlesjythambrad/itams_project/tree/main/src/pages/inventory_staff"
click node_enduser "https://github.com/charlesjythambrad/itams_project/tree/main/src/pages/end_users"
click node_assets "https://github.com/charlesjythambrad/itams_project/blob/main/src/pages/inventory_staff/AssetsPage.jsx"
click node_custody "https://github.com/charlesjythambrad/itams_project/blob/main/src/pages/inventory_staff/BorrowedReturnPage.jsx"
click node_repairs "https://github.com/charlesjythambrad/itams_project/blob/main/src/pages/inventory_staff/RepairsPage.jsx"
click node_warranty "https://github.com/charlesjythambrad/itams_project/blob/main/src/pages/inventory_staff/WarrantyPage.jsx"
click node_search "https://github.com/charlesjythambrad/itams_project/blob/main/src/components/inventory/GlobalInventorySearch.jsx"

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_routes,node_guard,node_login,node_people toneBlue
class node_auth,node_client,node_rolehook,node_supabase toneAmber
class node_assets,node_custody,node_repairs,node_warranty,node_search toneMint
class node_dashboard,node_itsd,node_users,node_staff,node_enduser toneRose
```

## Components

### App and access

- [Application root](https://github.com/charlesjythambrad/itams_project/blob/main/src/App.jsx): `src/App.jsx`
- [Route registry](https://github.com/charlesjythambrad/itams_project/blob/main/src/routes/AppRoutes.jsx): `src/routes/AppRoutes.jsx`
- [Protected routes](https://github.com/charlesjythambrad/itams_project/blob/main/src/routes/ProtectedRoute.jsx): `src/routes/ProtectedRoute.jsx`
- [Login interface](https://github.com/charlesjythambrad/itams_project/blob/main/src/pages/LoginPage.jsx): `src/pages/LoginPage.jsx`

### Identity and roles

- [Auth provider](https://github.com/charlesjythambrad/itams_project/blob/main/src/context/AuthContext.jsx): `src/context/AuthContext.jsx`
- [Supabase client](https://github.com/charlesjythambrad/itams_project/blob/main/src/lib/supabaseClient.js): `src/lib/supabaseClient.js`
- [Role metadata](https://github.com/charlesjythambrad/itams_project/blob/main/src/hooks/useUserRole.js): `src/hooks/useUserRole.js`

### Asset operations

- [Asset management](https://github.com/charlesjythambrad/itams_project/blob/main/src/pages/inventory_staff/AssetsPage.jsx): `src/pages/inventory_staff/AssetsPage.jsx`
- [Assignments and returns](https://github.com/charlesjythambrad/itams_project/blob/main/src/pages/inventory_staff/BorrowedReturnPage.jsx): `src/pages/inventory_staff/BorrowedReturnPage.jsx`
- [Repair tracking](https://github.com/charlesjythambrad/itams_project/blob/main/src/pages/inventory_staff/RepairsPage.jsx): `src/pages/inventory_staff/RepairsPage.jsx`
- [Warranty tracking](https://github.com/charlesjythambrad/itams_project/blob/main/src/pages/inventory_staff/WarrantyPage.jsx): `src/pages/inventory_staff/WarrantyPage.jsx`
- [Global inventory search](https://github.com/charlesjythambrad/itams_project/blob/main/src/components/inventory/GlobalInventorySearch.jsx): `src/components/inventory/GlobalInventorySearch.jsx`

### Role workspaces

- [Role dashboard dispatch](https://github.com/charlesjythambrad/itams_project/blob/main/src/pages/DashboardPage.jsx): `src/pages/DashboardPage.jsx`
- [ITSD console](https://github.com/charlesjythambrad/itams_project/tree/main/src/pages/itsd): `src/pages/itsd`
- [User administration](https://github.com/charlesjythambrad/itams_project/blob/main/src/pages/itsd/UserManagementPage.jsx): `src/pages/itsd/UserManagementPage.jsx`
- [Inventory console](https://github.com/charlesjythambrad/itams_project/tree/main/src/pages/inventory_staff): `src/pages/inventory_staff`
- [End-user custody](https://github.com/charlesjythambrad/itams_project/tree/main/src/pages/end_users): `src/pages/end_users`

### Other components

- **Platform users**
- **Supabase Auth and Postgres**

## Connections

- Platform users → Application root: opens
- Application root → Auth provider: provides auth
- Application root → Route registry: renders routes
- Route registry → Login interface: routes sign-in
- Login interface → Auth provider: signs in
- Auth provider → Supabase client: uses client
- Supabase client → Supabase Auth and Postgres: auth and queries
- Supabase Auth and Postgres → Auth provider: session and records
- Route registry → Protected routes: guards access
- Protected routes → Auth provider: checks session
- Route registry → Role dashboard dispatch: routes dashboard
- Role dashboard dispatch → Role metadata: resolves role
- Route registry → ITSD console: routes ITSD
- Route registry → User administration: routes admin
- Route registry → Inventory console: routes staff
- Route registry → End-user custody: routes end user
- Route registry → Asset management: routes assets
- Route registry → Assignments and returns: routes custody
- Route registry → Repair tracking: routes repairs
- Route registry → Warranty tracking: routes warranty
- Inventory console → Global inventory search: offers search
- Global inventory search → Supabase client: queries records
- Global inventory search → Asset management: navigates results
- Global inventory search → Assignments and returns: navigates results
- Global inventory search → Repair tracking: navigates results
