# nadjibsalmi/qleanflow-water-quantum architecture

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

- Interactive diagram: https://gitdiagram.com/nadjibsalmi/qleanflow-water-quantum
- Repository: https://github.com/nadjibsalmi/qleanflow-water-quantum

## Overview

QleanFlow is a Ghana water-contamination risk dashboard. Users explore regional summaries, community locations, and contamination comparisons, or enter indicators into a browser-side Random Forest estimator to receive a threshold-based triage score and domain-status warning. The data service reads and aggregates the bundled CSV. Separate model and methodology pages explain validation and limitations; a quantum-kernel demo and QSVC utilities provide historical comparison, not the live inference path. Edges reflect excerpts or SOURCE INDEX references; unsampled capabilities are represented cautiously.

Main entry points: [`src/app/(dashboard)/page.tsx`](https://github.com/nadjibsalmi/qleanflow-water-quantum/blob/main/src/app/(dashboard)/page.tsx) (Overview page), [`src/app/(dashboard)/regions/page.tsx`](https://github.com/nadjibsalmi/qleanflow-water-quantum/blob/main/src/app/(dashboard)/regions/page.tsx) (Regions page), [`src/app/(dashboard)/model/page.tsx`](https://github.com/nadjibsalmi/qleanflow-water-quantum/blob/main/src/app/(dashboard)/model/page.tsx) (Model page), [`src/components/dashboard/Header.tsx`](https://github.com/nadjibsalmi/qleanflow-water-quantum/blob/main/src/components/dashboard/Header.tsx) (Page header)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_explore["Risk exploration"]
  node_overview["Overview page<br/>[page.tsx]"]
  node_regions["Regions page<br/>[page.tsx]"]
  node_data["CSV summaries"]
  node_regionchart["Regional chart"]
  node_typechart["Contamination chart"]
  node_communitymap["Community map<br/>[CommunityMap.tsx]"]
end

subgraph group_inference["Risk inference"]
  node_estimatorloader["Deferred estimator"]
  node_estimatorui["Risk estimator"]
  node_forest["Random Forest inference"]
end

subgraph group_models["Model comparison"]
  node_modelpage["Model page<br/>[page.tsx]"]
  node_methodpage["Methodology page<br/>[page.tsx]"]
  node_quantumdemo["Quantum kernel demo"]
  node_qsvcinference["QSVC utilities<br/>[qsvcEstimator.ts]"]
  node_qsvcparams["QSVC parameters<br/>[qsvcParams.ts]"]
  node_quantumsim["Quantum simulator"]
end

subgraph group_shared["Shared presentation"]
  node_header["Page header<br/>[Header.tsx]"]
  node_mobilenav["Mobile navigation<br/>[MobileNav.tsx]"]
  node_sidebar["Sidebar navigation<br/>[Sidebar.tsx]"]
  node_navitems["Navigation items<br/>[navItems.ts]"]
  node_card["Content card<br/>[Card.tsx]"]
  node_kpicard["KPI card<br/>[KpiCard.tsx]"]
end

node_visitor(("Dashboard user"))

node_visitor -->|"opens"| node_overview
node_visitor -->|"opens"| node_regions
node_visitor -->|"opens"| node_modelpage
node_overview -->|"requests summaries"| node_data
node_overview -->|"renders"| node_estimatorloader
node_overview -->|"renders"| node_regionchart
node_overview -->|"renders"| node_typechart
node_regions -->|"requests records"| node_data
node_regions -->|"renders"| node_communitymap
node_communitymap -->|"uses records"| node_data
node_regionchart -->|"uses summaries"| node_data
node_estimatorloader -->|"loads"| node_estimatorui
node_estimatorui -->|"requests estimate"| node_forest
node_modelpage -->|"reads metadata"| node_forest
node_modelpage -->|"renders"| node_quantumdemo
node_quantumdemo -->|"uses simulator"| node_quantumsim
node_qsvcinference -->|"uses simulator"| node_quantumsim
node_qsvcinference -->|"uses parameters"| node_qsvcparams
node_overview -->|"renders"| node_header
node_regions -->|"renders"| node_header
node_modelpage -->|"renders"| node_header
node_methodpage -->|"renders"| node_header
node_header -->|"renders"| node_mobilenav
node_mobilenav -->|"uses links"| node_navitems
node_sidebar -->|"uses links"| node_navitems
node_overview -->|"renders"| node_kpicard
node_overview -->|"renders"| node_card
node_regions -->|"renders"| node_card
node_modelpage -->|"renders"| node_card

click node_overview "https://github.com/nadjibsalmi/qleanflow-water-quantum/blob/main/src/app/(dashboard)/page.tsx"
click node_regions "https://github.com/nadjibsalmi/qleanflow-water-quantum/blob/main/src/app/(dashboard)/regions/page.tsx"
click node_data "https://github.com/nadjibsalmi/qleanflow-water-quantum/blob/main/src/services/waterQualityData.ts"
click node_regionchart "https://github.com/nadjibsalmi/qleanflow-water-quantum/blob/main/src/components/dashboard/RegionContaminationChart.tsx"
click node_typechart "https://github.com/nadjibsalmi/qleanflow-water-quantum/blob/main/src/components/dashboard/ContaminationTypeChart.tsx"
click node_communitymap "https://github.com/nadjibsalmi/qleanflow-water-quantum/blob/main/src/components/dashboard/CommunityMap.tsx"
click node_estimatorloader "https://github.com/nadjibsalmi/qleanflow-water-quantum/blob/main/src/components/dashboard/DeferredRandomForestRiskEstimator.tsx"
click node_estimatorui "https://github.com/nadjibsalmi/qleanflow-water-quantum/blob/main/src/components/dashboard/RandomForestRiskEstimator.tsx"
click node_forest "https://github.com/nadjibsalmi/qleanflow-water-quantum/blob/main/src/algorithms/randomForestEstimator.ts"
click node_modelpage "https://github.com/nadjibsalmi/qleanflow-water-quantum/blob/main/src/app/(dashboard)/model/page.tsx"
click node_methodpage "https://github.com/nadjibsalmi/qleanflow-water-quantum/blob/main/src/app/(dashboard)/methodology/page.tsx"
click node_quantumdemo "https://github.com/nadjibsalmi/qleanflow-water-quantum/blob/main/src/components/dashboard/QuantumKernelDemo.tsx"
click node_qsvcinference "https://github.com/nadjibsalmi/qleanflow-water-quantum/blob/main/src/algorithms/qsvcEstimator.ts"
click node_qsvcparams "https://github.com/nadjibsalmi/qleanflow-water-quantum/blob/main/src/algorithms/data/qsvcParams.ts"
click node_quantumsim "https://github.com/nadjibsalmi/qleanflow-water-quantum/blob/main/src/algorithms/quantumSimulator.ts"
click node_header "https://github.com/nadjibsalmi/qleanflow-water-quantum/blob/main/src/components/dashboard/Header.tsx"
click node_mobilenav "https://github.com/nadjibsalmi/qleanflow-water-quantum/blob/main/src/components/dashboard/MobileNav.tsx"
click node_sidebar "https://github.com/nadjibsalmi/qleanflow-water-quantum/blob/main/src/components/dashboard/Sidebar.tsx"
click node_navitems "https://github.com/nadjibsalmi/qleanflow-water-quantum/blob/main/src/components/dashboard/navItems.ts"
click node_card "https://github.com/nadjibsalmi/qleanflow-water-quantum/blob/main/src/components/ui/Card.tsx"
click node_kpicard "https://github.com/nadjibsalmi/qleanflow-water-quantum/blob/main/src/components/ui/KpiCard.tsx"

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_overview,node_regions,node_data,node_regionchart,node_typechart,node_communitymap,node_visitor toneBlue
class node_estimatorloader,node_estimatorui,node_forest toneAmber
class node_modelpage,node_methodpage,node_quantumdemo,node_qsvcinference,node_qsvcparams,node_quantumsim toneMint
class node_header,node_mobilenav,node_sidebar,node_navitems,node_card,node_kpicard toneRose
```

## Components

### Risk exploration

- [Overview page](https://github.com/nadjibsalmi/qleanflow-water-quantum/blob/main/src/app/(dashboard)/page.tsx): `src/app/(dashboard)/page.tsx`
- [Regions page](https://github.com/nadjibsalmi/qleanflow-water-quantum/blob/main/src/app/(dashboard)/regions/page.tsx): `src/app/(dashboard)/regions/page.tsx`
- [CSV summaries](https://github.com/nadjibsalmi/qleanflow-water-quantum/blob/main/src/services/waterQualityData.ts): `src/services/waterQualityData.ts`
- [Regional chart](https://github.com/nadjibsalmi/qleanflow-water-quantum/blob/main/src/components/dashboard/RegionContaminationChart.tsx): `src/components/dashboard/RegionContaminationChart.tsx`
- [Contamination chart](https://github.com/nadjibsalmi/qleanflow-water-quantum/blob/main/src/components/dashboard/ContaminationTypeChart.tsx): `src/components/dashboard/ContaminationTypeChart.tsx`
- [Community map](https://github.com/nadjibsalmi/qleanflow-water-quantum/blob/main/src/components/dashboard/CommunityMap.tsx): `src/components/dashboard/CommunityMap.tsx`

### Risk inference

- [Deferred estimator](https://github.com/nadjibsalmi/qleanflow-water-quantum/blob/main/src/components/dashboard/DeferredRandomForestRiskEstimator.tsx): `src/components/dashboard/DeferredRandomForestRiskEstimator.tsx`
- [Risk estimator](https://github.com/nadjibsalmi/qleanflow-water-quantum/blob/main/src/components/dashboard/RandomForestRiskEstimator.tsx): `src/components/dashboard/RandomForestRiskEstimator.tsx`
- [Random Forest inference](https://github.com/nadjibsalmi/qleanflow-water-quantum/blob/main/src/algorithms/randomForestEstimator.ts): `src/algorithms/randomForestEstimator.ts`

### Model comparison

- [Model page](https://github.com/nadjibsalmi/qleanflow-water-quantum/blob/main/src/app/(dashboard)/model/page.tsx): `src/app/(dashboard)/model/page.tsx`
- [Methodology page](https://github.com/nadjibsalmi/qleanflow-water-quantum/blob/main/src/app/(dashboard)/methodology/page.tsx): `src/app/(dashboard)/methodology/page.tsx`
- [Quantum kernel demo](https://github.com/nadjibsalmi/qleanflow-water-quantum/blob/main/src/components/dashboard/QuantumKernelDemo.tsx): `src/components/dashboard/QuantumKernelDemo.tsx`
- [QSVC utilities](https://github.com/nadjibsalmi/qleanflow-water-quantum/blob/main/src/algorithms/qsvcEstimator.ts): `src/algorithms/qsvcEstimator.ts`
- [QSVC parameters](https://github.com/nadjibsalmi/qleanflow-water-quantum/blob/main/src/algorithms/data/qsvcParams.ts): `src/algorithms/data/qsvcParams.ts`
- [Quantum simulator](https://github.com/nadjibsalmi/qleanflow-water-quantum/blob/main/src/algorithms/quantumSimulator.ts): `src/algorithms/quantumSimulator.ts`

### Shared presentation

- [Page header](https://github.com/nadjibsalmi/qleanflow-water-quantum/blob/main/src/components/dashboard/Header.tsx): `src/components/dashboard/Header.tsx`
- [Mobile navigation](https://github.com/nadjibsalmi/qleanflow-water-quantum/blob/main/src/components/dashboard/MobileNav.tsx): `src/components/dashboard/MobileNav.tsx`
- [Sidebar navigation](https://github.com/nadjibsalmi/qleanflow-water-quantum/blob/main/src/components/dashboard/Sidebar.tsx): `src/components/dashboard/Sidebar.tsx`
- [Navigation items](https://github.com/nadjibsalmi/qleanflow-water-quantum/blob/main/src/components/dashboard/navItems.ts): `src/components/dashboard/navItems.ts`
- [Content card](https://github.com/nadjibsalmi/qleanflow-water-quantum/blob/main/src/components/ui/Card.tsx): `src/components/ui/Card.tsx`
- [KPI card](https://github.com/nadjibsalmi/qleanflow-water-quantum/blob/main/src/components/ui/KpiCard.tsx): `src/components/ui/KpiCard.tsx`

### Other components

- **Dashboard user**

## Connections

- Dashboard user → Overview page: opens (evidence: `src/app/(dashboard)/page.tsx`)
- Dashboard user → Regions page: opens (evidence: `src/app/(dashboard)/regions/page.tsx`)
- Dashboard user → Model page: opens (evidence: `src/app/(dashboard)/model/page.tsx`)
- Overview page → CSV summaries: requests summaries (evidence: `src/app/(dashboard)/page.tsx`)
- Overview page → Deferred estimator: renders (evidence: `src/app/(dashboard)/page.tsx`)
- Overview page → Regional chart: renders (evidence: `src/app/(dashboard)/page.tsx`)
- Overview page → Contamination chart: renders (evidence: `src/app/(dashboard)/page.tsx`)
- Regions page → CSV summaries: requests records (evidence: `src/app/(dashboard)/regions/page.tsx`)
- Regions page → Community map: renders (evidence: `src/app/(dashboard)/regions/page.tsx`)
- Community map → CSV summaries: uses records (evidence: `src/components/dashboard/CommunityMap.tsx`)
- Regional chart → CSV summaries: uses summaries (evidence: `src/components/dashboard/RegionContaminationChart.tsx`)
- Deferred estimator → Risk estimator: loads (evidence: `src/components/dashboard/DeferredRandomForestRiskEstimator.tsx`)
- Risk estimator → Random Forest inference: requests estimate (evidence: `src/components/dashboard/RandomForestRiskEstimator.tsx`)
- Model page → Random Forest inference: reads metadata (evidence: `src/app/(dashboard)/model/page.tsx`)
- Model page → Quantum kernel demo: renders (evidence: `src/app/(dashboard)/model/page.tsx`)
- Quantum kernel demo → Quantum simulator: uses simulator (evidence: `src/components/dashboard/QuantumKernelDemo.tsx`)
- QSVC utilities → Quantum simulator: uses simulator (evidence: `src/algorithms/qsvcEstimator.ts`)
- QSVC utilities → QSVC parameters: uses parameters (evidence: `src/algorithms/qsvcEstimator.ts`)
- Overview page → Page header: renders (evidence: `src/app/(dashboard)/page.tsx`)
- Regions page → Page header: renders (evidence: `src/app/(dashboard)/regions/page.tsx`)
- Model page → Page header: renders (evidence: `src/app/(dashboard)/model/page.tsx`)
- Methodology page → Page header: renders (evidence: `src/app/(dashboard)/methodology/page.tsx`)
- Page header → Mobile navigation: renders (evidence: `src/components/dashboard/Header.tsx`)
- Mobile navigation → Navigation items: uses links (evidence: `src/components/dashboard/MobileNav.tsx`)
- Sidebar navigation → Navigation items: uses links (evidence: `src/components/dashboard/Sidebar.tsx`)
- Overview page → KPI card: renders (evidence: `src/app/(dashboard)/page.tsx`)
- Overview page → Content card: renders (evidence: `src/app/(dashboard)/page.tsx`)
- Regions page → Content card: renders (evidence: `src/app/(dashboard)/regions/page.tsx`)
- Model page → Content card: renders (evidence: `src/app/(dashboard)/model/page.tsx`)
