# yosssef9/qnh_taskhub architecture

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

- Interactive diagram: https://gitdiagram.com/yosssef9/qnh_taskhub
- Repository: https://github.com/yosssef9/qnh_taskhub

## Overview

TaskHub is a browser-based work-management and procurement application backed by an Express API. Users enter through the client shell and work across tasks, meetings, calendar, procurement, contracts, and administration. The graph preserves those distinct product areas and shows sampled task/list and authentication paths. Most page-to-feature and client-to-server wiring was not shown, so those relationships are omitted or marked unverified rather than treated as inspected.

Main entry points: [`client/src/App.tsx`](https://github.com/yosssef9/qnh_taskhub/blob/main/client/src/App.tsx) (App shell), [`server/src/modules/collaboration/collaboration.routes.ts`](https://github.com/yosssef9/qnh_taskhub/blob/main/server/src/modules/collaboration/collaboration.routes.ts) (Task collaboration), [`client/src/features/lists/components/ListsManagerDialog.tsx`](https://github.com/yosssef9/qnh_taskhub/blob/main/client/src/features/lists/components/ListsManagerDialog.tsx) (Personal lists), [`client/src/features/tasks/components`](https://github.com/yosssef9/qnh_taskhub/tree/main/client/src/features/tasks/components) (Task workspace)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client application"]
  node_shell["App shell<br/>[App.tsx]"]
end

subgraph group_work["Work coordination"]
  node_tasks["Task workspace"]
  node_taskhooks["Task data hooks<br/>[use-tasks.ts]"]
  node_taskapi["Task API client<br/>[tasks.api.ts]"]
  node_lists["Personal lists"]
  node_listhooks["List data hooks<br/>[use-lists.ts]"]
  node_meetings["Meeting workflows"]
  node_calendar["Calendar"]
end

subgraph group_procurement["Procurement"]
  node_contracts["Contracts"]
  node_items["Items and pricing"]
  node_suppliers["Supplier intelligence"]
  node_procurement["Procurement imports"]
end

subgraph group_server["API services"]
  node_taskroutes["Task endpoints"]
  node_taskservice["Task services<br/>[tasks.service.ts]"]
  node_collaboration["Task collaboration"]
  node_database[("SQL database<br/>[sql.ts]")]
end

subgraph group_identity["Identity and access"]
  node_authmiddleware["Portal authentication"]
  node_accessmiddleware["Access resolution"]
  node_authservice["Auth service<br/>[auth.service.ts]"]
  node_authrepo["Auth repository<br/>[auth.repository.ts]"]
end

node_user(("User"))

node_user -.->|"uses"| node_shell
node_shell -.->|"opens"| node_tasks
node_shell -.->|"opens"| node_lists
node_shell -.->|"opens"| node_meetings
node_shell -.->|"opens"| node_calendar
node_shell -.->|"opens"| node_contracts
node_shell -.->|"opens"| node_items
node_shell -.->|"opens"| node_suppliers
node_shell -.->|"opens"| node_procurement
node_tasks -.->|"loads data"| node_taskhooks
node_taskhooks -->|"calls"| node_taskapi
node_lists -->|"manages lists"| node_listhooks
node_listhooks -->|"uses types"| node_lists
node_taskapi -.->|"requests"| node_taskroutes
node_taskroutes -->|"calls"| node_taskservice
node_collaboration -->|"verifies token"| node_authmiddleware
node_collaboration -->|"resolves access"| node_accessmiddleware
node_collaboration -.->|"coordinates tasks"| node_taskservice
node_accessmiddleware -->|"resolves user"| node_authservice
node_authservice -.->|"loads identity"| node_authrepo
node_authrepo -->|"queries"| node_database

click node_shell "https://github.com/yosssef9/qnh_taskhub/blob/main/client/src/App.tsx"
click node_tasks "https://github.com/yosssef9/qnh_taskhub/tree/main/client/src/features/tasks/components"
click node_taskhooks "https://github.com/yosssef9/qnh_taskhub/blob/main/client/src/features/tasks/hooks/use-tasks.ts"
click node_taskapi "https://github.com/yosssef9/qnh_taskhub/blob/main/client/src/features/tasks/api/tasks.api.ts"
click node_lists "https://github.com/yosssef9/qnh_taskhub/blob/main/client/src/features/lists/components/ListsManagerDialog.tsx"
click node_listhooks "https://github.com/yosssef9/qnh_taskhub/blob/main/client/src/features/lists/hooks/use-lists.ts"
click node_meetings "https://github.com/yosssef9/qnh_taskhub/tree/main/client/src/features/meetings"
click node_calendar "https://github.com/yosssef9/qnh_taskhub/tree/main/client/src/features/calendar"
click node_contracts "https://github.com/yosssef9/qnh_taskhub/tree/main/client/src/features/contracts"
click node_items "https://github.com/yosssef9/qnh_taskhub/tree/main/client/src/features/items"
click node_suppliers "https://github.com/yosssef9/qnh_taskhub/tree/main/client/src/features/suppliers"
click node_procurement "https://github.com/yosssef9/qnh_taskhub/tree/main/client/src/features/procurement-imports"
click node_taskroutes "https://github.com/yosssef9/qnh_taskhub/blob/main/server/src/modules/tasks/tasks.controller.ts"
click node_taskservice "https://github.com/yosssef9/qnh_taskhub/blob/main/server/src/modules/tasks/tasks.service.ts"
click node_collaboration "https://github.com/yosssef9/qnh_taskhub/blob/main/server/src/modules/collaboration/collaboration.routes.ts"
click node_authmiddleware "https://github.com/yosssef9/qnh_taskhub/blob/main/server/src/middleware/verifyPortalJwt.middleware.ts"
click node_accessmiddleware "https://github.com/yosssef9/qnh_taskhub/blob/main/server/src/middleware/resolveTaskHubAccess.middleware.ts"
click node_authservice "https://github.com/yosssef9/qnh_taskhub/blob/main/server/src/modules/auth/auth.service.ts"
click node_authrepo "https://github.com/yosssef9/qnh_taskhub/blob/main/server/src/modules/auth/auth.repository.ts"
click node_database "https://github.com/yosssef9/qnh_taskhub/blob/main/server/src/database/sql.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_shell,node_user toneBlue
class node_tasks,node_taskhooks,node_taskapi,node_lists,node_listhooks,node_meetings,node_calendar toneAmber
class node_contracts,node_items,node_suppliers,node_procurement toneMint
class node_taskroutes,node_taskservice,node_collaboration,node_database toneRose
class node_authmiddleware,node_accessmiddleware,node_authservice,node_authrepo toneIndigo
```

## Components

### Client application

- [App shell](https://github.com/yosssef9/qnh_taskhub/blob/main/client/src/App.tsx): `client/src/App.tsx`

### Work coordination

- [Task workspace](https://github.com/yosssef9/qnh_taskhub/tree/main/client/src/features/tasks/components): `client/src/features/tasks/components`
- [Task data hooks](https://github.com/yosssef9/qnh_taskhub/blob/main/client/src/features/tasks/hooks/use-tasks.ts): `client/src/features/tasks/hooks/use-tasks.ts`
- [Task API client](https://github.com/yosssef9/qnh_taskhub/blob/main/client/src/features/tasks/api/tasks.api.ts): `client/src/features/tasks/api/tasks.api.ts`
- [Personal lists](https://github.com/yosssef9/qnh_taskhub/blob/main/client/src/features/lists/components/ListsManagerDialog.tsx): `client/src/features/lists/components/ListsManagerDialog.tsx`
- [List data hooks](https://github.com/yosssef9/qnh_taskhub/blob/main/client/src/features/lists/hooks/use-lists.ts): `client/src/features/lists/hooks/use-lists.ts`
- [Meeting workflows](https://github.com/yosssef9/qnh_taskhub/tree/main/client/src/features/meetings): `client/src/features/meetings`
- [Calendar](https://github.com/yosssef9/qnh_taskhub/tree/main/client/src/features/calendar): `client/src/features/calendar`

### Procurement

- [Contracts](https://github.com/yosssef9/qnh_taskhub/tree/main/client/src/features/contracts): `client/src/features/contracts`
- [Items and pricing](https://github.com/yosssef9/qnh_taskhub/tree/main/client/src/features/items): `client/src/features/items`
- [Supplier intelligence](https://github.com/yosssef9/qnh_taskhub/tree/main/client/src/features/suppliers): `client/src/features/suppliers`
- [Procurement imports](https://github.com/yosssef9/qnh_taskhub/tree/main/client/src/features/procurement-imports): `client/src/features/procurement-imports`

### API services

- [Task endpoints](https://github.com/yosssef9/qnh_taskhub/blob/main/server/src/modules/tasks/tasks.controller.ts): `server/src/modules/tasks/tasks.controller.ts`
- [Task services](https://github.com/yosssef9/qnh_taskhub/blob/main/server/src/modules/tasks/tasks.service.ts): `server/src/modules/tasks/tasks.service.ts`
- [Task collaboration](https://github.com/yosssef9/qnh_taskhub/blob/main/server/src/modules/collaboration/collaboration.routes.ts): `server/src/modules/collaboration/collaboration.routes.ts`
- [SQL database](https://github.com/yosssef9/qnh_taskhub/blob/main/server/src/database/sql.ts): `server/src/database/sql.ts`

### Identity and access

- [Portal authentication](https://github.com/yosssef9/qnh_taskhub/blob/main/server/src/middleware/verifyPortalJwt.middleware.ts): `server/src/middleware/verifyPortalJwt.middleware.ts`
- [Access resolution](https://github.com/yosssef9/qnh_taskhub/blob/main/server/src/middleware/resolveTaskHubAccess.middleware.ts): `server/src/middleware/resolveTaskHubAccess.middleware.ts`
- [Auth service](https://github.com/yosssef9/qnh_taskhub/blob/main/server/src/modules/auth/auth.service.ts): `server/src/modules/auth/auth.service.ts`
- [Auth repository](https://github.com/yosssef9/qnh_taskhub/blob/main/server/src/modules/auth/auth.repository.ts): `server/src/modules/auth/auth.repository.ts`

### Other components

- **User**

## Connections

- User → App shell: uses
- App shell → Task workspace: opens
- App shell → Personal lists: opens
- App shell → Meeting workflows: opens
- App shell → Calendar: opens
- App shell → Contracts: opens
- App shell → Items and pricing: opens
- App shell → Supplier intelligence: opens
- App shell → Procurement imports: opens
- Task workspace → Task data hooks: loads data
- Task data hooks → Task API client: calls (evidence: `client/src/features/tasks/hooks/use-tasks.ts`)
- Personal lists → List data hooks: manages lists (evidence: `client/src/features/lists/components/ListsManagerDialog.tsx`)
- List data hooks → Personal lists: uses types (evidence: `client/src/features/lists/hooks/use-lists.ts`)
- Task API client → Task endpoints: requests
- Task endpoints → Task services: calls (evidence: `server/src/modules/tasks/tasks.controller.ts`)
- Task collaboration → Portal authentication: verifies token (evidence: `server/src/modules/collaboration/collaboration.routes.ts`)
- Task collaboration → Access resolution: resolves access (evidence: `server/src/modules/collaboration/collaboration.routes.ts`)
- Task collaboration → Task services: coordinates tasks
- Access resolution → Auth service: resolves user (evidence: `server/src/middleware/resolveTaskHubAccess.middleware.ts`)
- Auth service → Auth repository: loads identity
- Auth repository → SQL database: queries (evidence: `server/src/modules/auth/auth.repository.ts`)
