# aiannyyyy/nscsl-modern-dashboard architecture

> Architecture diagram of the GitHub repository aiannyyyy/nscsl-modern-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-modern-dashboard
- Repository: https://github.com/aiannyyyy/nscsl-modern-dashboard

## Overview

NSCSL Modern Dashboard is an internal newborn-screening operations app spanning PDO programs, laboratory workflows, follow-up, administration, intranet files, IT job orders, and staff chat. Staff enter through the React dashboard; domain screens use hooks and services to call Express APIs, whose routes and controllers access MySQL and, for source screening data, read-only Oracle. The map emphasizes these documented request stages and major product areas. Some subsystems were not sampled at source level, so their internal links reflect README documentation rather than inspected implementations.

Main entry points: [`frontend/src/pages`](https://github.com/aiannyyyy/nscsl-modern-dashboard/tree/main/frontend/src/pages) (Domain screens), [`backend/controllers`](https://github.com/aiannyyyy/nscsl-modern-dashboard/tree/main/backend/controllers) (Domain controllers), [`frontend/src/App.tsx`](https://github.com/aiannyyyy/nscsl-modern-dashboard/blob/main/frontend/src/App.tsx) (React app), [`backend/routes`](https://github.com/aiannyyyy/nscsl-modern-dashboard/tree/main/backend/routes) (Domain routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_app["React app<br/>[App.tsx]"]
  node_auth["Authentication<br/>[AuthContext.tsx]"]
  node_client_domains["Domain screens"]
  node_client_data["Hooks and services"]
end

subgraph group_operations["Screening operations"]
  node_pdo["PDO workflows"]
  node_laboratory["Laboratory workflows"]
  node_followup["Follow-up workflows"]
  node_admin["Admin workflows"]
end

subgraph group_collaboration["Staff collaboration"]
  node_intranet["File management"]
  node_it_orders["IT job orders"]
  node_chat["Staff chat"]
end

subgraph group_api["API and domain logic"]
  node_server["Express API<br/>[server.js]"]
  node_auth_middleware["JWT middleware<br/>[authMiddleware.js]"]
  node_routes["Domain routes"]
  node_controllers["Domain controllers"]
end

subgraph group_data["Persistence"]
  node_mysql[("MySQL stores<br/>[database.js]")]
  node_oracle[("Oracle screening source<br/>[database.js]")]
end

node_staff(("Staff member"))

node_staff -->|"uses"| node_app
node_app -->|"provides auth"| node_auth
node_app -->|"routes to"| node_client_domains
node_client_domains -->|"loads data"| node_client_data
node_client_data -->|"calls API"| node_server
node_server -->|"mounts routes"| node_routes
node_routes -->|"guards requests"| node_auth_middleware
node_routes -->|"dispatches"| node_controllers
node_controllers -->|"reads and writes"| node_mysql
node_controllers -->|"reads source data"| node_oracle
node_client_domains -->|"includes"| node_pdo
node_client_domains -->|"includes"| node_laboratory
node_client_domains -->|"includes"| node_followup
node_client_domains -->|"includes"| node_admin
node_client_domains -->|"includes"| node_intranet
node_client_domains -->|"includes"| node_it_orders
node_client_domains -->|"includes"| node_chat
node_controllers -->|"broadcasts updates"| node_chat

click node_app "https://github.com/aiannyyyy/nscsl-modern-dashboard/blob/main/frontend/src/App.tsx"
click node_auth "https://github.com/aiannyyyy/nscsl-modern-dashboard/blob/main/frontend/src/context/AuthContext.tsx"
click node_client_domains "https://github.com/aiannyyyy/nscsl-modern-dashboard/tree/main/frontend/src/pages"
click node_client_data "https://github.com/aiannyyyy/nscsl-modern-dashboard/tree/main/frontend/src/hooks"
click node_pdo "https://github.com/aiannyyyy/nscsl-modern-dashboard/tree/main/frontend/src/pages/pdo"
click node_laboratory "https://github.com/aiannyyyy/nscsl-modern-dashboard/tree/main/frontend/src/pages/laboratory"
click node_followup "https://github.com/aiannyyyy/nscsl-modern-dashboard/tree/main/frontend/src/pages/followup"
click node_admin "https://github.com/aiannyyyy/nscsl-modern-dashboard/tree/main/frontend/src/pages/admin"
click node_intranet "https://github.com/aiannyyyy/nscsl-modern-dashboard/tree/main/frontend/src/pages/intranet"
click node_it_orders "https://github.com/aiannyyyy/nscsl-modern-dashboard/tree/main/frontend/src/pages/it-job-order"
click node_chat "https://github.com/aiannyyyy/nscsl-modern-dashboard/tree/main/frontend/src/pages/chat"
click node_server "https://github.com/aiannyyyy/nscsl-modern-dashboard/blob/main/backend/server.js"
click node_auth_middleware "https://github.com/aiannyyyy/nscsl-modern-dashboard/blob/main/backend/middleware/authMiddleware.js"
click node_routes "https://github.com/aiannyyyy/nscsl-modern-dashboard/tree/main/backend/routes"
click node_controllers "https://github.com/aiannyyyy/nscsl-modern-dashboard/tree/main/backend/controllers"
click node_mysql "https://github.com/aiannyyyy/nscsl-modern-dashboard/blob/main/backend/config/database.js"
click node_oracle "https://github.com/aiannyyyy/nscsl-modern-dashboard/blob/main/backend/config/database.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_auth,node_client_domains,node_client_data toneBlue
class node_pdo,node_laboratory,node_followup,node_admin toneAmber
class node_intranet,node_it_orders,node_chat toneMint
class node_server,node_auth_middleware,node_routes,node_controllers toneRose
class node_mysql,node_oracle,node_staff toneIndigo
```

## Components

### Web client

- [React app](https://github.com/aiannyyyy/nscsl-modern-dashboard/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Authentication](https://github.com/aiannyyyy/nscsl-modern-dashboard/blob/main/frontend/src/context/AuthContext.tsx): `frontend/src/context/AuthContext.tsx`
- [Domain screens](https://github.com/aiannyyyy/nscsl-modern-dashboard/tree/main/frontend/src/pages): `frontend/src/pages`
- [Hooks and services](https://github.com/aiannyyyy/nscsl-modern-dashboard/tree/main/frontend/src/hooks): `frontend/src/hooks`

### Screening operations

- [PDO workflows](https://github.com/aiannyyyy/nscsl-modern-dashboard/tree/main/frontend/src/pages/pdo): `frontend/src/pages/pdo`
- [Laboratory workflows](https://github.com/aiannyyyy/nscsl-modern-dashboard/tree/main/frontend/src/pages/laboratory): `frontend/src/pages/laboratory`
- [Follow-up workflows](https://github.com/aiannyyyy/nscsl-modern-dashboard/tree/main/frontend/src/pages/followup): `frontend/src/pages/followup`
- [Admin workflows](https://github.com/aiannyyyy/nscsl-modern-dashboard/tree/main/frontend/src/pages/admin): `frontend/src/pages/admin`

### Staff collaboration

- [File management](https://github.com/aiannyyyy/nscsl-modern-dashboard/tree/main/frontend/src/pages/intranet): `frontend/src/pages/intranet`
- [IT job orders](https://github.com/aiannyyyy/nscsl-modern-dashboard/tree/main/frontend/src/pages/it-job-order): `frontend/src/pages/it-job-order`
- [Staff chat](https://github.com/aiannyyyy/nscsl-modern-dashboard/tree/main/frontend/src/pages/chat): `frontend/src/pages/chat`

### API and domain logic

- [Express API](https://github.com/aiannyyyy/nscsl-modern-dashboard/blob/main/backend/server.js): `backend/server.js`
- [JWT middleware](https://github.com/aiannyyyy/nscsl-modern-dashboard/blob/main/backend/middleware/authMiddleware.js): `backend/middleware/authMiddleware.js`
- [Domain routes](https://github.com/aiannyyyy/nscsl-modern-dashboard/tree/main/backend/routes): `backend/routes`
- [Domain controllers](https://github.com/aiannyyyy/nscsl-modern-dashboard/tree/main/backend/controllers): `backend/controllers`

### Persistence

- [MySQL stores](https://github.com/aiannyyyy/nscsl-modern-dashboard/blob/main/backend/config/database.js): `backend/config/database.js`
- [Oracle screening source](https://github.com/aiannyyyy/nscsl-modern-dashboard/blob/main/backend/config/database.js): `backend/config/database.js`

### Other components

- **Staff member**

## Connections

- Staff member → React app: uses (evidence: `README.md`)
- React app → Authentication: provides auth (evidence: `frontend/src/App.tsx`)
- React app → Domain screens: routes to (evidence: `frontend/src/App.tsx`)
- Domain screens → Hooks and services: loads data (evidence: `README.md`)
- Hooks and services → Express API: calls API (evidence: `README.md`)
- Express API → Domain routes: mounts routes (evidence: `backend/server.js`)
- Domain routes → JWT middleware: guards requests (evidence: `backend/routes/AdminRoutes/adminInventoryRoutes.js`)
- Domain routes → Domain controllers: dispatches (evidence: `backend/routes/AdminRoutes/adminInventoryRoutes.js`)
- Domain controllers → MySQL stores: reads and writes (evidence: `backend/controllers/AdminController/adminInventoryController.js`)
- Domain controllers → Oracle screening source: reads source data (evidence: `README.md`)
- Domain screens → PDO workflows: includes (evidence: `frontend/src/App.tsx`)
- Domain screens → Laboratory workflows: includes (evidence: `frontend/src/App.tsx`)
- Domain screens → Follow-up workflows: includes (evidence: `frontend/src/App.tsx`)
- Domain screens → Admin workflows: includes (evidence: `frontend/src/App.tsx`)
- Domain screens → File management: includes (evidence: `README.md`)
- Domain screens → IT job orders: includes (evidence: `frontend/src/App.tsx`)
- Domain screens → Staff chat: includes (evidence: `README.md`)
- Domain controllers → Staff chat: broadcasts updates (evidence: `backend/controllers/ChatController/chatController.js`)
