# aiannyyyy/nscsl-dashboard architecture

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

- Interactive diagram: https://gitdiagram.com/aiannyyyy/nscsl-dashboard
- Repository: https://github.com/aiannyyyy/nscsl-dashboard

## Overview

NSCSL Modern Dashboard is a multi-domain operational dashboard with React/TypeScript views and an Express API backed by MySQL and Oracle. Users sign in, enter protected dashboard routes, and use domain tools such as laboratory and PDO reporting, follow-up, intranet file management, chat, and IT job orders. The IT job-order workflow includes requests, approvals, queueing, assignment, and resolution. The graph highlights that workflow and documented product areas; unsampled service and route wiring is omitted where the evidence does not establish a connection.

Main entry points: [`frontend/src/App.tsx`](https://github.com/aiannyyyy/nscsl-dashboard/blob/main/frontend/src/App.tsx) (Route shell), [`backend/config/database.js`](https://github.com/aiannyyyy/nscsl-dashboard/blob/main/backend/config/database.js) (Database pools), [`backend/server.js`](https://github.com/aiannyyyy/nscsl-dashboard/blob/main/backend/server.js) (Express server), [`frontend/src/context/AuthContext.tsx`](https://github.com/aiannyyyy/nscsl-dashboard/blob/main/frontend/src/context/AuthContext.tsx) (Auth state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Dashboard UI"]
  node_app["Route shell<br/>[App.tsx]"]
  node_auth_ui["Auth state<br/>[AuthContext.tsx]"]
  node_job_ui["Job order manager"]
  node_job_hooks["Job order hooks"]
  node_job_service["Job order API client"]
  node_pdo_ui["PDO reporting"]
  node_lab_ui["Laboratory reporting"]
  node_follow_ui["Follow-up tools"]
  node_intranet_ui["Intranet files"]
end

subgraph group_backend["API Runtime"]
  node_server["Express server<br/>[server.js]"]
  node_job_routes["Job-order routes"]
  node_pdo_routes["PDO routes"]
  node_lab_routes["Laboratory routes"]
  node_follow_routes["Follow-up routes"]
end

subgraph group_operations["Operational Workflows"]
  node_job_controller["Job-order workflow"]
  node_chat_controller["Chat messaging<br/>[chatController.js]"]
  node_nsf_controller["NSF facilities"]
end

subgraph group_records["Data And Files"]
  node_intranet_controller["File management<br/>[fileController.js]"]
end

subgraph group_shared["Shared Services"]
  node_auth_middleware["Request authentication<br/>[authMiddleware.js]"]
  node_database[("Database pools<br/>[database.js]")]
  node_auth_service["Authentication API client<br/>[authService.ts]"]
end

node_user(("Dashboard user"))

node_user -.->|"opens dashboard"| node_app
node_app -->|"provides auth"| node_auth_ui
node_app -->|"routes to"| node_pdo_ui
node_app -->|"routes to"| node_lab_ui
node_app -->|"routes to"| node_follow_ui
node_app -->|"routes to"| node_job_ui
node_auth_ui -->|"calls"| node_auth_service
node_job_ui -->|"uses"| node_job_hooks
node_job_hooks -->|"calls"| node_job_service
node_server -.->|"mounts"| node_job_routes
node_job_routes -->|"dispatches"| node_job_controller
node_job_controller -->|"queries"| node_database
node_server -->|"mounts"| node_pdo_routes
node_pdo_routes -->|"dispatches"| node_nsf_controller
node_nsf_controller -->|"queries"| node_database
node_server -->|"mounts"| node_lab_routes
node_server -.->|"mounts"| node_follow_routes
node_chat_controller -->|"queries"| node_database
node_intranet_controller -->|"queries"| node_database
node_auth_middleware -->|"loads user"| node_database

click node_app "https://github.com/aiannyyyy/nscsl-dashboard/blob/main/frontend/src/App.tsx"
click node_auth_ui "https://github.com/aiannyyyy/nscsl-dashboard/blob/main/frontend/src/context/AuthContext.tsx"
click node_job_ui "https://github.com/aiannyyyy/nscsl-dashboard/blob/main/frontend/src/components/GlobalJobOrderManager.tsx"
click node_job_hooks "https://github.com/aiannyyyy/nscsl-dashboard/blob/main/frontend/src/hooks/ITHooks/useJobOrderHooks.ts"
click node_job_service "https://github.com/aiannyyyy/nscsl-dashboard/blob/main/frontend/src/services/ITServices/itJobOrderService.ts"
click node_pdo_ui "https://github.com/aiannyyyy/nscsl-dashboard/tree/main/frontend/src/pages/pdo"
click node_lab_ui "https://github.com/aiannyyyy/nscsl-dashboard/tree/main/frontend/src/pages/laboratory"
click node_follow_ui "https://github.com/aiannyyyy/nscsl-dashboard/tree/main/frontend/src/pages/followup"
click node_intranet_ui "https://github.com/aiannyyyy/nscsl-dashboard/tree/main/frontend/src/pages/intranet"
click node_server "https://github.com/aiannyyyy/nscsl-dashboard/blob/main/backend/server.js"
click node_job_routes "https://github.com/aiannyyyy/nscsl-dashboard/blob/main/backend/routes/ITRoutes/itJobOrderRoutes.js"
click node_job_controller "https://github.com/aiannyyyy/nscsl-dashboard/blob/main/backend/controllers/ITController/itJobOrderController.js"
click node_chat_controller "https://github.com/aiannyyyy/nscsl-dashboard/blob/main/backend/controllers/ChatController/chatController.js"
click node_pdo_routes "https://github.com/aiannyyyy/nscsl-dashboard/tree/main/backend/routes/PDORoutes"
click node_nsf_controller "https://github.com/aiannyyyy/nscsl-dashboard/blob/main/backend/controllers/PDOController/nsfFacilitiesController.js"
click node_lab_routes "https://github.com/aiannyyyy/nscsl-dashboard/tree/main/backend/routes/LaboratoryRoutes"
click node_follow_routes "https://github.com/aiannyyyy/nscsl-dashboard/tree/main/backend/routes/FollowupRoutes"
click node_intranet_controller "https://github.com/aiannyyyy/nscsl-dashboard/blob/main/backend/controllers/IntranetController/fileController.js"
click node_auth_middleware "https://github.com/aiannyyyy/nscsl-dashboard/blob/main/backend/middleware/authMiddleware.js"
click node_database "https://github.com/aiannyyyy/nscsl-dashboard/blob/main/backend/config/database.js"
click node_auth_service "https://github.com/aiannyyyy/nscsl-dashboard/blob/main/frontend/src/services/authService.ts"

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_auth_ui,node_job_ui,node_job_hooks,node_job_service,node_pdo_ui,node_lab_ui,node_follow_ui,node_intranet_ui,node_user toneBlue
class node_server,node_job_routes,node_pdo_routes,node_lab_routes,node_follow_routes toneAmber
class node_job_controller,node_chat_controller,node_nsf_controller toneMint
class node_intranet_controller toneRose
class node_auth_middleware,node_database,node_auth_service toneIndigo
```

## Components

### Dashboard UI

- [Route shell](https://github.com/aiannyyyy/nscsl-dashboard/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Auth state](https://github.com/aiannyyyy/nscsl-dashboard/blob/main/frontend/src/context/AuthContext.tsx): `frontend/src/context/AuthContext.tsx`
- [Job order manager](https://github.com/aiannyyyy/nscsl-dashboard/blob/main/frontend/src/components/GlobalJobOrderManager.tsx): `frontend/src/components/GlobalJobOrderManager.tsx`
- [Job order hooks](https://github.com/aiannyyyy/nscsl-dashboard/blob/main/frontend/src/hooks/ITHooks/useJobOrderHooks.ts): `frontend/src/hooks/ITHooks/useJobOrderHooks.ts`
- [Job order API client](https://github.com/aiannyyyy/nscsl-dashboard/blob/main/frontend/src/services/ITServices/itJobOrderService.ts): `frontend/src/services/ITServices/itJobOrderService.ts`
- [PDO reporting](https://github.com/aiannyyyy/nscsl-dashboard/tree/main/frontend/src/pages/pdo): `frontend/src/pages/pdo`
- [Laboratory reporting](https://github.com/aiannyyyy/nscsl-dashboard/tree/main/frontend/src/pages/laboratory): `frontend/src/pages/laboratory`
- [Follow-up tools](https://github.com/aiannyyyy/nscsl-dashboard/tree/main/frontend/src/pages/followup): `frontend/src/pages/followup`
- [Intranet files](https://github.com/aiannyyyy/nscsl-dashboard/tree/main/frontend/src/pages/intranet): `frontend/src/pages/intranet`

### API Runtime

- [Express server](https://github.com/aiannyyyy/nscsl-dashboard/blob/main/backend/server.js): `backend/server.js`
- [Job-order routes](https://github.com/aiannyyyy/nscsl-dashboard/blob/main/backend/routes/ITRoutes/itJobOrderRoutes.js): `backend/routes/ITRoutes/itJobOrderRoutes.js`
- [PDO routes](https://github.com/aiannyyyy/nscsl-dashboard/tree/main/backend/routes/PDORoutes): `backend/routes/PDORoutes`
- [Laboratory routes](https://github.com/aiannyyyy/nscsl-dashboard/tree/main/backend/routes/LaboratoryRoutes): `backend/routes/LaboratoryRoutes`
- [Follow-up routes](https://github.com/aiannyyyy/nscsl-dashboard/tree/main/backend/routes/FollowupRoutes): `backend/routes/FollowupRoutes`

### Operational Workflows

- [Job-order workflow](https://github.com/aiannyyyy/nscsl-dashboard/blob/main/backend/controllers/ITController/itJobOrderController.js): `backend/controllers/ITController/itJobOrderController.js`
- [Chat messaging](https://github.com/aiannyyyy/nscsl-dashboard/blob/main/backend/controllers/ChatController/chatController.js): `backend/controllers/ChatController/chatController.js`
- [NSF facilities](https://github.com/aiannyyyy/nscsl-dashboard/blob/main/backend/controllers/PDOController/nsfFacilitiesController.js): `backend/controllers/PDOController/nsfFacilitiesController.js`

### Data And Files

- [File management](https://github.com/aiannyyyy/nscsl-dashboard/blob/main/backend/controllers/IntranetController/fileController.js): `backend/controllers/IntranetController/fileController.js`

### Shared Services

- [Request authentication](https://github.com/aiannyyyy/nscsl-dashboard/blob/main/backend/middleware/authMiddleware.js): `backend/middleware/authMiddleware.js`
- [Database pools](https://github.com/aiannyyyy/nscsl-dashboard/blob/main/backend/config/database.js): `backend/config/database.js`
- [Authentication API client](https://github.com/aiannyyyy/nscsl-dashboard/blob/main/frontend/src/services/authService.ts): `frontend/src/services/authService.ts`

### Other components

- **Dashboard user**

## Connections

- Dashboard user → Route shell: opens dashboard
- Route shell → Auth state: provides auth (evidence: `frontend/src/App.tsx`)
- Route shell → PDO reporting: routes to (evidence: `frontend/src/App.tsx`)
- Route shell → Laboratory reporting: routes to (evidence: `frontend/src/App.tsx`)
- Route shell → Follow-up tools: routes to (evidence: `frontend/src/App.tsx`)
- Route shell → Job order manager: routes to (evidence: `frontend/src/App.tsx`)
- Auth state → Authentication API client: calls (evidence: `frontend/src/context/AuthContext.tsx`)
- Job order manager → Job order hooks: uses (evidence: `frontend/src/components/GlobalJobOrderManager.tsx`)
- Job order hooks → Job order API client: calls (evidence: `frontend/src/hooks/ITHooks/useJobOrderHooks.ts`)
- Express server → Job-order routes: mounts (evidence: `backend/server.js`)
- Job-order routes → Job-order workflow: dispatches (evidence: `backend/routes/ITRoutes/itJobOrderRoutes.js`)
- Job-order workflow → Database pools: queries (evidence: `backend/controllers/ITController/itJobOrderController.js`)
- Express server → PDO routes: mounts (evidence: `backend/server.js`)
- PDO routes → NSF facilities: dispatches (evidence: `backend/routes/PDORoutes/nsfFacilitiesRoutes.js`)
- NSF facilities → Database pools: queries (evidence: `backend/controllers/PDOController/nsfFacilitiesController.js`)
- Express server → Laboratory routes: mounts (evidence: `backend/server.js`)
- Express server → Follow-up routes: mounts (evidence: `backend/server.js`)
- Chat messaging → Database pools: queries (evidence: `backend/controllers/ChatController/chatController.js`)
- File management → Database pools: queries (evidence: `backend/controllers/IntranetController/fileController.js`)
- Request authentication → Database pools: loads user (evidence: `backend/middleware/authMiddleware.js`)
