# sunnyinspired/cms-frontend architecture

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

- Interactive diagram: https://gitdiagram.com/sunnyinspired/cms-frontend
- Repository: https://github.com/sunnyinspired/cms-frontend

## Overview

This is an HIV case-management dashboard for authenticated users to review program activity and manage case-manager and team performance. The principal workflow is viewing dashboard summaries, filtering or drilling into case-manager/CMT records, then examining detailed performance or exporting reports. The sampled code shows dashboard, detail, performance and report requests through the SPEED API client, plus performance tables and modal rendering. Team-directory pages are retained as documented-by-tree product areas, but their request wiring was not sampled; the README provides no product-specific capability details.

Main entry points: [`app/cma/performance/page.tsx`](https://github.com/sunnyinspired/cms-frontend/blob/main/app/cma/performance/page.tsx) (Performance views), [`app/cma/dashboard/page.tsx`](https://github.com/sunnyinspired/cms-frontend/blob/main/app/cma/dashboard/page.tsx) (Dashboard), [`app/api/interceptors/SPEEDInterceptor.tsx`](https://github.com/sunnyinspired/cms-frontend/blob/main/app/api/interceptors/SPEEDInterceptor.tsx) (SPEED API client), [`app/components/performance/PerformanceModal.tsx`](https://github.com/sunnyinspired/cms-frontend/blob/main/app/components/performance/PerformanceModal.tsx) (Metric detail modal)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access"]
  node_auth["NextAuth endpoint<br/>[route.ts]"]
  node_navigation["CMA navigation<br/>[Navbar.tsx]"]
  node_cma_layout["CMA shell<br/>[layout.tsx]"]
  node_speed_client["SPEED API client"]
end

subgraph group_overview["Program overview"]
  node_dashboard["Dashboard<br/>[page.tsx]"]
  node_filters["Cohort filters<br/>[Filters.tsx]"]
end

subgraph group_directories["People and teams"]
  node_case_managers["Case-manager directory<br/>[page.tsx]"]
  node_manager_detail["Case-manager detail<br/>[page.tsx]"]
  node_teams["CMT directory<br/>[page.tsx]"]
  node_team_detail["CMT detail<br/>[page.tsx]"]
end

subgraph group_analytics["Performance and reporting"]
  node_performance["Performance views<br/>[page.tsx]"]
  node_manager_table["Manager table"]
  node_cmt_table["CMT table<br/>[CMTTable.tsx]"]
  node_performance_modal["Metric detail modal"]
  node_reports["Reports and exports<br/>[page.tsx]"]
  node_manager_types["Manager metrics types<br/>[case_manager.ts]"]
  node_cmt_types["CMT metrics types<br/>[cmt.ts]"]
end

node_user(("Dashboard user"))
node_speed_api{{"SPEED service"}}

node_user -.->|"signs in"| node_auth
node_user -.->|"views"| node_dashboard
node_cma_layout -->|"renders"| node_navigation
node_dashboard -->|"uses"| node_filters
node_dashboard -->|"requests through"| node_speed_client
node_dashboard -->|"fetches summaries"| node_speed_api
node_manager_detail -->|"requests through"| node_speed_client
node_manager_detail -->|"fetches detail"| node_speed_api
node_performance -->|"requests through"| node_speed_client
node_performance -->|"fetches metrics"| node_speed_api
node_performance -->|"renders"| node_manager_table
node_performance -->|"renders"| node_cmt_table
node_performance -->|"renders"| node_performance_modal
node_manager_table -->|"uses types"| node_manager_types
node_cmt_table -->|"uses types"| node_cmt_types
node_performance_modal -->|"uses types"| node_manager_types
node_performance_modal -->|"uses types"| node_cmt_types
node_reports -->|"requests through"| node_speed_client
node_reports -->|"fetches metrics"| node_speed_api

click node_auth "https://github.com/sunnyinspired/cms-frontend/blob/main/app/api/auth/%5B...nextauth%5D/route.ts"
click node_navigation "https://github.com/sunnyinspired/cms-frontend/blob/main/app/components/Navbar.tsx"
click node_cma_layout "https://github.com/sunnyinspired/cms-frontend/blob/main/app/cma/layout.tsx"
click node_dashboard "https://github.com/sunnyinspired/cms-frontend/blob/main/app/cma/dashboard/page.tsx"
click node_filters "https://github.com/sunnyinspired/cms-frontend/blob/main/app/components/Filters.tsx"
click node_case_managers "https://github.com/sunnyinspired/cms-frontend/blob/main/app/cma/case-managers/page.tsx"
click node_manager_detail "https://github.com/sunnyinspired/cms-frontend/blob/main/app/cma/case-managers/%5Bid%5D/page.tsx"
click node_teams "https://github.com/sunnyinspired/cms-frontend/blob/main/app/cma/case-management-teams/page.tsx"
click node_team_detail "https://github.com/sunnyinspired/cms-frontend/blob/main/app/cma/case-management-teams/%5Bid%5D/page.tsx"
click node_performance "https://github.com/sunnyinspired/cms-frontend/blob/main/app/cma/performance/page.tsx"
click node_manager_table "https://github.com/sunnyinspired/cms-frontend/blob/main/app/components/performance/CaseManagerTable.tsx"
click node_cmt_table "https://github.com/sunnyinspired/cms-frontend/blob/main/app/components/performance/CMTTable.tsx"
click node_performance_modal "https://github.com/sunnyinspired/cms-frontend/blob/main/app/components/performance/PerformanceModal.tsx"
click node_reports "https://github.com/sunnyinspired/cms-frontend/blob/main/app/cma/reports/page.tsx"
click node_speed_client "https://github.com/sunnyinspired/cms-frontend/blob/main/app/api/interceptors/SPEEDInterceptor.tsx"
click node_manager_types "https://github.com/sunnyinspired/cms-frontend/blob/main/app/types/case_manager.ts"
click node_cmt_types "https://github.com/sunnyinspired/cms-frontend/blob/main/app/types/cmt.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_auth,node_navigation,node_cma_layout,node_speed_client,node_user toneBlue
class node_dashboard,node_filters toneAmber
class node_case_managers,node_manager_detail,node_teams,node_team_detail toneMint
class node_performance,node_manager_table,node_cmt_table,node_performance_modal,node_reports,node_manager_types,node_cmt_types toneRose
class node_speed_api toneIndigo
```

## Components

### Access

- [NextAuth endpoint](https://github.com/sunnyinspired/cms-frontend/blob/main/app/api/auth/%5B...nextauth%5D/route.ts): `app/api/auth/[...nextauth]/route.ts`
- [CMA navigation](https://github.com/sunnyinspired/cms-frontend/blob/main/app/components/Navbar.tsx): `app/components/Navbar.tsx`
- [CMA shell](https://github.com/sunnyinspired/cms-frontend/blob/main/app/cma/layout.tsx): `app/cma/layout.tsx`
- [SPEED API client](https://github.com/sunnyinspired/cms-frontend/blob/main/app/api/interceptors/SPEEDInterceptor.tsx): `app/api/interceptors/SPEEDInterceptor.tsx`

### Program overview

- [Dashboard](https://github.com/sunnyinspired/cms-frontend/blob/main/app/cma/dashboard/page.tsx): `app/cma/dashboard/page.tsx`
- [Cohort filters](https://github.com/sunnyinspired/cms-frontend/blob/main/app/components/Filters.tsx): `app/components/Filters.tsx`

### People and teams

- [Case-manager directory](https://github.com/sunnyinspired/cms-frontend/blob/main/app/cma/case-managers/page.tsx): `app/cma/case-managers/page.tsx`
- [Case-manager detail](https://github.com/sunnyinspired/cms-frontend/blob/main/app/cma/case-managers/%5Bid%5D/page.tsx): `app/cma/case-managers/[id]/page.tsx`
- [CMT directory](https://github.com/sunnyinspired/cms-frontend/blob/main/app/cma/case-management-teams/page.tsx): `app/cma/case-management-teams/page.tsx`
- [CMT detail](https://github.com/sunnyinspired/cms-frontend/blob/main/app/cma/case-management-teams/%5Bid%5D/page.tsx): `app/cma/case-management-teams/[id]/page.tsx`

### Performance and reporting

- [Performance views](https://github.com/sunnyinspired/cms-frontend/blob/main/app/cma/performance/page.tsx): `app/cma/performance/page.tsx`
- [Manager table](https://github.com/sunnyinspired/cms-frontend/blob/main/app/components/performance/CaseManagerTable.tsx): `app/components/performance/CaseManagerTable.tsx`
- [CMT table](https://github.com/sunnyinspired/cms-frontend/blob/main/app/components/performance/CMTTable.tsx): `app/components/performance/CMTTable.tsx`
- [Metric detail modal](https://github.com/sunnyinspired/cms-frontend/blob/main/app/components/performance/PerformanceModal.tsx): `app/components/performance/PerformanceModal.tsx`
- [Reports and exports](https://github.com/sunnyinspired/cms-frontend/blob/main/app/cma/reports/page.tsx): `app/cma/reports/page.tsx`
- [Manager metrics types](https://github.com/sunnyinspired/cms-frontend/blob/main/app/types/case_manager.ts): `app/types/case_manager.ts`
- [CMT metrics types](https://github.com/sunnyinspired/cms-frontend/blob/main/app/types/cmt.ts): `app/types/cmt.ts`

### Other components

- **Dashboard user**
- **SPEED service**

## Connections

- Dashboard user → NextAuth endpoint: signs in
- Dashboard user → Dashboard: views
- CMA shell → CMA navigation: renders (evidence: `app/cma/layout.tsx`)
- Dashboard → Cohort filters: uses (evidence: `app/cma/dashboard/page.tsx`)
- Dashboard → SPEED API client: requests through (evidence: `app/cma/dashboard/page.tsx`)
- Dashboard → SPEED service: fetches summaries (evidence: `app/cma/dashboard/page.tsx`)
- Case-manager detail → SPEED API client: requests through (evidence: `app/cma/case-managers/[id]/page.tsx`)
- Case-manager detail → SPEED service: fetches detail (evidence: `app/cma/case-managers/[id]/page.tsx`)
- Performance views → SPEED API client: requests through (evidence: `app/cma/performance/page.tsx`)
- Performance views → SPEED service: fetches metrics (evidence: `app/cma/performance/page.tsx`)
- Performance views → Manager table: renders (evidence: `app/cma/performance/page.tsx`)
- Performance views → CMT table: renders (evidence: `app/cma/performance/page.tsx`)
- Performance views → Metric detail modal: renders (evidence: `app/cma/performance/page.tsx`)
- Manager table → Manager metrics types: uses types (evidence: `app/components/performance/CaseManagerTable.tsx`)
- CMT table → CMT metrics types: uses types (evidence: `app/components/performance/CMTTable.tsx`)
- Metric detail modal → Manager metrics types: uses types (evidence: `app/components/performance/PerformanceModal.tsx`)
- Metric detail modal → CMT metrics types: uses types (evidence: `app/components/performance/PerformanceModal.tsx`)
- Reports and exports → SPEED API client: requests through (evidence: `app/cma/reports/page.tsx`)
- Reports and exports → SPEED service: fetches metrics (evidence: `app/cma/reports/page.tsx`)
