# adm1n1strat0r-mam/techdesk-360 architecture

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

- Interactive diagram: https://gitdiagram.com/adm1n1strat0r-mam/techdesk-360
- Repository: https://github.com/adm1n1strat0r-mam/techdesk-360

## Overview

ITserve is an IT support and asset-management application. Users sign in, then work through dashboard, lab-case, inventory, branch, and user/device-record screens; the React app coordinates page state and API calls, while the Express API routes requests to controllers and MongoDB models. The README also documents vendor coordination, warranty tracking, branch visits, and hardware disposal, though their implementation details are not shown in the supplied excerpts. Edges are limited to excerpted calls, indexed references, or README statements; unsampled wiring is omitted.

Main entry points: [`client/src/App.jsx`](https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/client/src/App.jsx) (App coordinator), [`server/src/middleware/authenticate.middleware.js`](https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/server/src/middleware/authenticate.middleware.js) (Authentication and permissions), [`server/src/app.js`](https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/server/src/app.js) (HTTP application), [`server/src/models/user.js`](https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/server/src/models/user.js) (User records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client application"]
  node_app_shell["App coordinator<br/>[App.jsx]"]
  node_auth_context["Auth context<br/>[auth-context.jsx]"]
  node_api_client["API client<br/>[api.js]"]
  node_inventory_ui["Inventory screens"]
  node_branch_ui["Branch screens"]
  node_lab_ui["Lab workflows"]
  node_id_ui["User and ID screens"]
  node_support_ui["Dashboard and lab overview<br/>[DashboardPage.jsx]"]
  node_account_ui["Account screens<br/>[AccountPages.jsx]"]
end

subgraph group_api["API and access control"]
  node_express_app["HTTP application<br/>[app.js]"]
  node_auth_routes["Authentication routes<br/>[auth.routes.js]"]
  node_user_routes["User routes<br/>[user.routes.js]"]
  node_branch_routes["Branch routes<br/>[branch.routes.js]"]
  node_inventory_routes["Inventory routes"]
  node_lab_routes["Lab-case routes<br/>[labCase.routes.js]"]
  node_access_control["Authentication and permissions"]
  node_auth_controller["Sign-in handling<br/>[auth.controller.js]"]
end

subgraph group_operations["Operations domains"]
  node_user_controller["User administration<br/>[user.controller.js]"]
  node_branch_controller["Branch management"]
  node_inventory_controller["Inventory import"]
  node_inventory_service["Inventory parsing and summary"]
  node_lab_controller["Lab case lifecycle"]
  node_role_controller["Role administration<br/>[role.controller.js]"]
end

subgraph group_data["Persistence"]
  node_users_store[("User records<br/>[user.js]")]
  node_branches_store[("Branch records<br/>[Branch.js]")]
  node_inventory_store[("Inventory records<br/>[InventoryRecord.js]")]
  node_lab_store[("Lab cases<br/>[LabCase.js]")]
  node_counter_store[("Case counters<br/>[Counter.js]")]
  node_roles_store[("Role records<br/>[Role.js]")]
end

node_user_actor(("Staff user"))
node_mongo[("MongoDB")]

node_user_actor -->|"uses"| node_app_shell
node_app_shell -->|"provides auth"| node_auth_context
node_app_shell -->|"calls"| node_api_client
node_app_shell -->|"renders"| node_inventory_ui
node_app_shell -->|"renders"| node_branch_ui
node_app_shell -->|"renders"| node_lab_ui
node_app_shell -->|"renders"| node_id_ui
node_app_shell -->|"renders"| node_support_ui
node_app_shell -->|"renders"| node_account_ui
node_express_app -->|"mounts"| node_auth_routes
node_express_app -->|"mounts"| node_user_routes
node_express_app -->|"mounts"| node_branch_routes
node_express_app -->|"mounts"| node_inventory_routes
node_express_app -->|"mounts"| node_lab_routes
node_auth_routes -->|"dispatches"| node_auth_controller
node_user_routes -->|"dispatches"| node_user_controller
node_branch_routes -->|"dispatches"| node_branch_controller
node_inventory_routes -->|"dispatches"| node_inventory_controller
node_lab_routes -->|"dispatches"| node_lab_controller
node_user_routes -->|"authenticates and checks"| node_access_control
node_branch_routes -->|"authenticates and checks"| node_access_control
node_inventory_routes -->|"authenticates and checks"| node_access_control
node_lab_routes -->|"authenticates and checks"| node_access_control
node_auth_controller -->|"reads and updates"| node_users_store
node_access_control -->|"checks account"| node_users_store
node_access_control -->|"checks permissions"| node_roles_store
node_branch_controller -->|"reads and writes"| node_branches_store
node_inventory_controller -->|"delegates to"| node_inventory_service
node_inventory_service -->|"reads and writes"| node_inventory_store
node_lab_controller -->|"reads and writes"| node_lab_store
node_lab_controller -->|"increments"| node_counter_store
node_user_controller -->|"manages"| node_users_store
node_role_controller -->|"manages"| node_roles_store
node_role_controller -->|"updates assignments"| node_users_store
node_inventory_ui -->|"imports and submits"| node_api_client
node_inventory_ui -->|"imports into"| node_mongo

click node_app_shell "https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/client/src/App.jsx"
click node_auth_context "https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/client/src/auth-context.jsx"
click node_api_client "https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/client/src/api.js"
click node_inventory_ui "https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/client/src/pages/InventoryManagementPage.jsx"
click node_branch_ui "https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/client/src/pages/BranchManagementPages.jsx"
click node_lab_ui "https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/client/src/pages/LabWorkflowPages.jsx"
click node_id_ui "https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/client/src/pages/IdWorkflowPages.jsx"
click node_support_ui "https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/client/src/pages/DashboardPage.jsx"
click node_account_ui "https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/client/src/pages/AccountPages.jsx"
click node_express_app "https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/server/src/app.js"
click node_auth_routes "https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/server/src/routes/auth.routes.js"
click node_user_routes "https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/server/src/routes/user.routes.js"
click node_branch_routes "https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/server/src/routes/branch.routes.js"
click node_inventory_routes "https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/server/src/routes/inventory.routes.js"
click node_lab_routes "https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/server/src/routes/labCase.routes.js"
click node_access_control "https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/server/src/middleware/authenticate.middleware.js"
click node_auth_controller "https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/server/src/controllers/auth.controller.js"
click node_user_controller "https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/server/src/controllers/user.controller.js"
click node_branch_controller "https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/server/src/controllers/branch.controller.js"
click node_inventory_controller "https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/server/src/controllers/inventory.controller.js"
click node_inventory_service "https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/server/src/services/inventory.service.js"
click node_lab_controller "https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/server/src/controllers/labCase.controller.js"
click node_role_controller "https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/server/src/controllers/role.controller.js"
click node_users_store "https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/server/src/models/user.js"
click node_branches_store "https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/server/src/models/Branch.js"
click node_inventory_store "https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/server/src/models/InventoryRecord.js"
click node_lab_store "https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/server/src/models/LabCase.js"
click node_counter_store "https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/server/src/models/Counter.js"
click node_roles_store "https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/server/src/models/Role.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_shell,node_auth_context,node_api_client,node_inventory_ui,node_branch_ui,node_lab_ui,node_id_ui,node_support_ui,node_account_ui,node_user_actor toneBlue
class node_express_app,node_auth_routes,node_user_routes,node_branch_routes,node_inventory_routes,node_lab_routes,node_access_control,node_auth_controller,node_mongo toneAmber
class node_user_controller,node_branch_controller,node_inventory_controller,node_inventory_service,node_lab_controller,node_role_controller toneMint
class node_users_store,node_branches_store,node_inventory_store,node_lab_store,node_counter_store,node_roles_store toneRose
```

## Components

### Client application

- [App coordinator](https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Auth context](https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/client/src/auth-context.jsx): `client/src/auth-context.jsx`
- [API client](https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/client/src/api.js): `client/src/api.js`
- [Inventory screens](https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/client/src/pages/InventoryManagementPage.jsx): `client/src/pages/InventoryManagementPage.jsx`
- [Branch screens](https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/client/src/pages/BranchManagementPages.jsx): `client/src/pages/BranchManagementPages.jsx`
- [Lab workflows](https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/client/src/pages/LabWorkflowPages.jsx): `client/src/pages/LabWorkflowPages.jsx`
- [User and ID screens](https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/client/src/pages/IdWorkflowPages.jsx): `client/src/pages/IdWorkflowPages.jsx`
- [Dashboard and lab overview](https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/client/src/pages/DashboardPage.jsx): `client/src/pages/DashboardPage.jsx`
- [Account screens](https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/client/src/pages/AccountPages.jsx): `client/src/pages/AccountPages.jsx`

### API and access control

- [HTTP application](https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/server/src/app.js): `server/src/app.js`
- [Authentication routes](https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/server/src/routes/auth.routes.js): `server/src/routes/auth.routes.js`
- [User routes](https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/server/src/routes/user.routes.js): `server/src/routes/user.routes.js`
- [Branch routes](https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/server/src/routes/branch.routes.js): `server/src/routes/branch.routes.js`
- [Inventory routes](https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/server/src/routes/inventory.routes.js): `server/src/routes/inventory.routes.js`
- [Lab-case routes](https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/server/src/routes/labCase.routes.js): `server/src/routes/labCase.routes.js`
- [Authentication and permissions](https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/server/src/middleware/authenticate.middleware.js): `server/src/middleware/authenticate.middleware.js`
- [Sign-in handling](https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/server/src/controllers/auth.controller.js): `server/src/controllers/auth.controller.js`

### Operations domains

- [User administration](https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/server/src/controllers/user.controller.js): `server/src/controllers/user.controller.js`
- [Branch management](https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/server/src/controllers/branch.controller.js): `server/src/controllers/branch.controller.js`
- [Inventory import](https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/server/src/controllers/inventory.controller.js): `server/src/controllers/inventory.controller.js`
- [Inventory parsing and summary](https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/server/src/services/inventory.service.js): `server/src/services/inventory.service.js`
- [Lab case lifecycle](https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/server/src/controllers/labCase.controller.js): `server/src/controllers/labCase.controller.js`
- [Role administration](https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/server/src/controllers/role.controller.js): `server/src/controllers/role.controller.js`

### Persistence

- [User records](https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/server/src/models/user.js): `server/src/models/user.js`
- [Branch records](https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/server/src/models/Branch.js): `server/src/models/Branch.js`
- [Inventory records](https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/server/src/models/InventoryRecord.js): `server/src/models/InventoryRecord.js`
- [Lab cases](https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/server/src/models/LabCase.js): `server/src/models/LabCase.js`
- [Case counters](https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/server/src/models/Counter.js): `server/src/models/Counter.js`
- [Role records](https://github.com/adm1n1strat0r-mam/techdesk-360/blob/main/server/src/models/Role.js): `server/src/models/Role.js`

### Other components

- **Staff user**
- **MongoDB**

## Connections

- Staff user → App coordinator: uses
- App coordinator → Auth context: provides auth (evidence: `client/src/App.jsx`)
- App coordinator → API client: calls (evidence: `client/src/App.jsx`)
- App coordinator → Inventory screens: renders (evidence: `client/src/App.jsx`)
- App coordinator → Branch screens: renders (evidence: `client/src/App.jsx`)
- App coordinator → Lab workflows: renders (evidence: `client/src/App.jsx`)
- App coordinator → User and ID screens: renders (evidence: `client/src/App.jsx`)
- App coordinator → Dashboard and lab overview: renders (evidence: `client/src/App.jsx`)
- App coordinator → Account screens: renders (evidence: `client/src/App.jsx`)
- HTTP application → Authentication routes: mounts (evidence: `server/src/app.js`)
- HTTP application → User routes: mounts (evidence: `server/src/app.js`)
- HTTP application → Branch routes: mounts (evidence: `server/src/app.js`)
- HTTP application → Inventory routes: mounts (evidence: `server/src/app.js`)
- HTTP application → Lab-case routes: mounts (evidence: `server/src/app.js`)
- Authentication routes → Sign-in handling: dispatches (evidence: `server/src/routes/auth.routes.js`)
- User routes → User administration: dispatches (evidence: `server/src/routes/user.routes.js`)
- Branch routes → Branch management: dispatches (evidence: `server/src/controllers/branch.controller.js`)
- Inventory routes → Inventory import: dispatches (evidence: `server/src/routes/inventory.routes.js`)
- Lab-case routes → Lab case lifecycle: dispatches (evidence: `server/src/routes/labCase.routes.js`)
- User routes → Authentication and permissions: authenticates and checks (evidence: `server/src/routes/user.routes.js`)
- Branch routes → Authentication and permissions: authenticates and checks (evidence: `server/src/routes/branch.routes.js`)
- Inventory routes → Authentication and permissions: authenticates and checks (evidence: `server/src/routes/inventory.routes.js`)
- Lab-case routes → Authentication and permissions: authenticates and checks (evidence: `server/src/routes/labCase.routes.js`)
- Sign-in handling → User records: reads and updates (evidence: `server/src/controllers/auth.controller.js`)
- Authentication and permissions → User records: checks account (evidence: `server/src/middleware/authenticate.middleware.js`)
- Authentication and permissions → Role records: checks permissions
- Branch management → Branch records: reads and writes (evidence: `server/src/controllers/branch.controller.js`)
- Inventory import → Inventory parsing and summary: delegates to (evidence: `server/src/controllers/inventory.controller.js`)
- Inventory parsing and summary → Inventory records: reads and writes (evidence: `server/src/services/inventory.service.js`)
- Lab case lifecycle → Lab cases: reads and writes (evidence: `server/src/controllers/labCase.controller.js`)
- Lab case lifecycle → Case counters: increments (evidence: `server/src/controllers/labCase.controller.js`)
- User administration → User records: manages (evidence: `server/src/controllers/user.controller.js`)
- Role administration → Role records: manages (evidence: `server/src/controllers/role.controller.js`)
- Role administration → User records: updates assignments (evidence: `server/src/controllers/role.controller.js`)
- Inventory screens → API client: imports and submits (evidence: `client/src/pages/InventoryManagementPage.jsx`)
- Inventory screens → MongoDB: imports into (evidence: `README.md`)
