# kartik-nighania/dhs-2026-session-demo architecture

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

- Interactive diagram: https://gitdiagram.com/kartik-nighania/dhs-2026-session-demo
- Repository: https://github.com/kartik-nighania/dhs-2026-session-demo

## Overview

reports-service is a small FastAPI application. A client requests either report rows as JSON or a CSV export; the matching handler checks the in-memory report mapping and returns the result. The two routes are separate outputs over shared data, not sequential stages. The export implementation derives columns from the first row, so the README’s export capability is present, but empty reports are not handled successfully. The graph reflects the sampled route and data code; no persistent store or external integration is shown.

Main entry points: [`app/main.py`](https://github.com/kartik-nighania/dhs-2026-session-demo/blob/main/app/main.py) (JSON report route), [`app/data.py`](https://github.com/kartik-nighania/dhs-2026-session-demo/blob/main/app/data.py) (In-memory reports)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_client(("Client"))
node_report_route["JSON report route<br/>[main.py]"]
node_export_route["CSV export route<br/>[main.py]"]
node_report_data[("In-memory reports<br/>[data.py]")]

node_client -->|"requests JSON"| node_report_route
node_client -->|"requests CSV"| node_export_route
node_report_route -->|"reads reports"| node_report_data
node_export_route -->|"reads reports"| node_report_data

click node_report_route "https://github.com/kartik-nighania/dhs-2026-session-demo/blob/main/app/main.py"
click node_export_route "https://github.com/kartik-nighania/dhs-2026-session-demo/blob/main/app/main.py"
click node_report_data "https://github.com/kartik-nighania/dhs-2026-session-demo/blob/main/app/data.py"

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_client toneBlue
class node_report_route,node_export_route toneMint
class node_report_data toneAmber
```

## Components

### Other components

- **Client**
- [JSON report route](https://github.com/kartik-nighania/dhs-2026-session-demo/blob/main/app/main.py): `app/main.py`
- [CSV export route](https://github.com/kartik-nighania/dhs-2026-session-demo/blob/main/app/main.py): `app/main.py`
- [In-memory reports](https://github.com/kartik-nighania/dhs-2026-session-demo/blob/main/app/data.py): `app/data.py`

## Connections

- Client → JSON report route: requests JSON (evidence: `README.md`)
- Client → CSV export route: requests CSV (evidence: `README.md`)
- JSON report route → In-memory reports: reads reports (evidence: `app/main.py`)
- CSV export route → In-memory reports: reads reports (evidence: `app/main.py`)
