# kit2824bam017-cell/hacxlerate-challenge-1 architecture

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

- Interactive diagram: https://gitdiagram.com/kit2824bam017-cell/hacxlerate-challenge-1
- Repository: https://github.com/kit2824bam017-cell/hacxlerate-challenge-1

## Overview

Altrix’s Personal Health Copilot turns uploaded medical documents into reviewable, confirmed health records, then presents summaries, trends, medication history, and ABHA/FHIR interoperability features. The graph combines the documented product workflow with source-visible backend routing and storage relationships. Frontend-to-backend wiring and several provider internals were not sampled, so those relationships are omitted or marked unverified rather than inferred from names.

Main entry points: [`backend/app/main.py`](https://github.com/kit2824bam017-cell/hacxlerate-challenge-1/blob/main/backend/app/main.py) (FastAPI application), [`backend/app/repositories/store.py`](https://github.com/kit2824bam017-cell/hacxlerate-challenge-1/blob/main/backend/app/repositories/store.py) (Repository facade), [`frontend/src/main.tsx`](https://github.com/kit2824bam017-cell/hacxlerate-challenge-1/blob/main/frontend/src/main.tsx) (Web application), [`backend/app/api/v1/extraction.py`](https://github.com/kit2824bam017-cell/hacxlerate-challenge-1/blob/main/backend/app/api/v1/extraction.py) (Extraction endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Patient application"]
  node_frontend["Web application<br/>[main.tsx]"]
  node_doc_ui["Document manager"]
  node_review_ui["Extraction review"]
  node_health_ui["Health dashboard"]
end

subgraph group_intake["Document intelligence"]
  node_api["FastAPI application<br/>[main.py]"]
  node_document_api["Document endpoints<br/>[documents.py]"]
  node_processor["Document processor"]
  node_ocr["OCR provider<br/>[ocr.py]"]
  node_extraction_api["Extraction endpoints<br/>[extraction.py]"]
  node_extraction_schema["Candidate extraction data<br/>[extraction.py]"]
end

subgraph group_health["Health records"]
  node_store["Repository facade<br/>[store.py]"]
  node_sqlite[("SQLite persistence<br/>[sqlite_store.py]")]
  node_records_api["Records and FHIR API<br/>[records.py]"]
  node_patient_api["Patient endpoints<br/>[patient.py]"]
end

subgraph group_insights["Health insights"]
  node_summary_api["Summary endpoints<br/>[summaries.py]"]
  node_summary_service["Summary generation<br/>[summary_service.py]"]
  node_translation["Tamil translation<br/>[translation.py]"]
  node_timeline_api["Timeline endpoints<br/>[timeline.py]"]
end

subgraph group_interop["Interoperability"]
  node_abha_api["ABHA endpoints<br/>[abha.py]"]
  node_abha_provider["ABHA provider<br/>[abha.py]"]
  node_config["Runtime configuration<br/>[config.py]"]
end

node_patient(("Patient"))

node_patient -->|"uses"| node_frontend
node_frontend -.->|"calls API"| node_api
node_frontend -.->|"presents upload"| node_doc_ui
node_frontend -.->|"presents review"| node_review_ui
node_frontend -.->|"presents health data"| node_health_ui
node_frontend -->|"mounts routes"| node_api
node_api -->|"routes to"| node_document_api
node_api -->|"routes to"| node_extraction_api
node_api -->|"routes to"| node_records_api
node_api -->|"routes to"| node_patient_api
node_api -->|"routes to"| node_summary_api
node_api -->|"routes to"| node_timeline_api
node_api -->|"routes to"| node_abha_api
node_document_api -->|"invokes"| node_processor
node_processor -.->|"extracts text"| node_ocr
node_extraction_api -->|"uses processing"| node_processor
node_extraction_api -->|"accepts candidate data"| node_extraction_schema
node_document_api -->|"reads and writes"| node_store
node_extraction_api -->|"reads and writes"| node_store
node_records_api -->|"reads and writes"| node_store
node_patient_api -->|"reads and writes"| node_store
node_summary_api -->|"generates summaries"| node_summary_service
node_summary_service -->|"reads and writes"| node_store
node_summary_service -->|"translates summaries"| node_translation
node_timeline_api -->|"reads history"| node_store
node_abha_api -->|"reads and writes"| node_store
node_abha_api -->|"delegates"| node_abha_provider
node_abha_api -->|"reads settings"| node_config
node_api -->|"configures service"| node_config
node_store -->|"uses persistence"| node_sqlite
node_records_api -->|"exports FHIR bundle"| node_patient

click node_frontend "https://github.com/kit2824bam017-cell/hacxlerate-challenge-1/blob/main/frontend/src/main.tsx"
click node_doc_ui "https://github.com/kit2824bam017-cell/hacxlerate-challenge-1/blob/main/frontend/src/features/dashboard/components/document-manager.tsx"
click node_review_ui "https://github.com/kit2824bam017-cell/hacxlerate-challenge-1/blob/main/frontend/src/features/dashboard/components/extraction-review.tsx"
click node_health_ui "https://github.com/kit2824bam017-cell/hacxlerate-challenge-1/blob/main/frontend/src/features/dashboard/components/health-overview.tsx"
click node_api "https://github.com/kit2824bam017-cell/hacxlerate-challenge-1/blob/main/backend/app/main.py"
click node_document_api "https://github.com/kit2824bam017-cell/hacxlerate-challenge-1/blob/main/backend/app/api/v1/documents.py"
click node_processor "https://github.com/kit2824bam017-cell/hacxlerate-challenge-1/blob/main/backend/app/services/document_processor.py"
click node_ocr "https://github.com/kit2824bam017-cell/hacxlerate-challenge-1/blob/main/backend/app/providers/ocr.py"
click node_extraction_api "https://github.com/kit2824bam017-cell/hacxlerate-challenge-1/blob/main/backend/app/api/v1/extraction.py"
click node_extraction_schema "https://github.com/kit2824bam017-cell/hacxlerate-challenge-1/blob/main/backend/app/schemas/extraction.py"
click node_store "https://github.com/kit2824bam017-cell/hacxlerate-challenge-1/blob/main/backend/app/repositories/store.py"
click node_sqlite "https://github.com/kit2824bam017-cell/hacxlerate-challenge-1/blob/main/backend/app/repositories/sqlite_store.py"
click node_records_api "https://github.com/kit2824bam017-cell/hacxlerate-challenge-1/blob/main/backend/app/api/v1/records.py"
click node_patient_api "https://github.com/kit2824bam017-cell/hacxlerate-challenge-1/blob/main/backend/app/api/v1/patient.py"
click node_summary_api "https://github.com/kit2824bam017-cell/hacxlerate-challenge-1/blob/main/backend/app/api/v1/summaries.py"
click node_summary_service "https://github.com/kit2824bam017-cell/hacxlerate-challenge-1/blob/main/backend/app/services/summary_service.py"
click node_translation "https://github.com/kit2824bam017-cell/hacxlerate-challenge-1/blob/main/backend/app/providers/translation.py"
click node_timeline_api "https://github.com/kit2824bam017-cell/hacxlerate-challenge-1/blob/main/backend/app/api/v1/timeline.py"
click node_abha_api "https://github.com/kit2824bam017-cell/hacxlerate-challenge-1/blob/main/backend/app/api/v1/abha.py"
click node_abha_provider "https://github.com/kit2824bam017-cell/hacxlerate-challenge-1/blob/main/backend/app/providers/abha.py"
click node_config "https://github.com/kit2824bam017-cell/hacxlerate-challenge-1/blob/main/backend/app/core/config.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_frontend,node_doc_ui,node_review_ui,node_health_ui toneBlue
class node_api,node_document_api,node_processor,node_ocr,node_extraction_api,node_extraction_schema toneAmber
class node_store,node_sqlite,node_records_api,node_patient_api toneMint
class node_summary_api,node_summary_service,node_translation,node_timeline_api toneRose
class node_abha_api,node_abha_provider,node_config,node_patient toneIndigo
```

## Components

### Patient application

- [Web application](https://github.com/kit2824bam017-cell/hacxlerate-challenge-1/blob/main/frontend/src/main.tsx): `frontend/src/main.tsx`
- [Document manager](https://github.com/kit2824bam017-cell/hacxlerate-challenge-1/blob/main/frontend/src/features/dashboard/components/document-manager.tsx): `frontend/src/features/dashboard/components/document-manager.tsx`
- [Extraction review](https://github.com/kit2824bam017-cell/hacxlerate-challenge-1/blob/main/frontend/src/features/dashboard/components/extraction-review.tsx): `frontend/src/features/dashboard/components/extraction-review.tsx`
- [Health dashboard](https://github.com/kit2824bam017-cell/hacxlerate-challenge-1/blob/main/frontend/src/features/dashboard/components/health-overview.tsx): `frontend/src/features/dashboard/components/health-overview.tsx`

### Document intelligence

- [FastAPI application](https://github.com/kit2824bam017-cell/hacxlerate-challenge-1/blob/main/backend/app/main.py): `backend/app/main.py`
- [Document endpoints](https://github.com/kit2824bam017-cell/hacxlerate-challenge-1/blob/main/backend/app/api/v1/documents.py): `backend/app/api/v1/documents.py`
- [Document processor](https://github.com/kit2824bam017-cell/hacxlerate-challenge-1/blob/main/backend/app/services/document_processor.py): `backend/app/services/document_processor.py`
- [OCR provider](https://github.com/kit2824bam017-cell/hacxlerate-challenge-1/blob/main/backend/app/providers/ocr.py): `backend/app/providers/ocr.py`
- [Extraction endpoints](https://github.com/kit2824bam017-cell/hacxlerate-challenge-1/blob/main/backend/app/api/v1/extraction.py): `backend/app/api/v1/extraction.py`
- [Candidate extraction data](https://github.com/kit2824bam017-cell/hacxlerate-challenge-1/blob/main/backend/app/schemas/extraction.py): `backend/app/schemas/extraction.py`

### Health records

- [Repository facade](https://github.com/kit2824bam017-cell/hacxlerate-challenge-1/blob/main/backend/app/repositories/store.py): `backend/app/repositories/store.py`
- [SQLite persistence](https://github.com/kit2824bam017-cell/hacxlerate-challenge-1/blob/main/backend/app/repositories/sqlite_store.py): `backend/app/repositories/sqlite_store.py`
- [Records and FHIR API](https://github.com/kit2824bam017-cell/hacxlerate-challenge-1/blob/main/backend/app/api/v1/records.py): `backend/app/api/v1/records.py`
- [Patient endpoints](https://github.com/kit2824bam017-cell/hacxlerate-challenge-1/blob/main/backend/app/api/v1/patient.py): `backend/app/api/v1/patient.py`

### Health insights

- [Summary endpoints](https://github.com/kit2824bam017-cell/hacxlerate-challenge-1/blob/main/backend/app/api/v1/summaries.py): `backend/app/api/v1/summaries.py`
- [Summary generation](https://github.com/kit2824bam017-cell/hacxlerate-challenge-1/blob/main/backend/app/services/summary_service.py): `backend/app/services/summary_service.py`
- [Tamil translation](https://github.com/kit2824bam017-cell/hacxlerate-challenge-1/blob/main/backend/app/providers/translation.py): `backend/app/providers/translation.py`
- [Timeline endpoints](https://github.com/kit2824bam017-cell/hacxlerate-challenge-1/blob/main/backend/app/api/v1/timeline.py): `backend/app/api/v1/timeline.py`

### Interoperability

- [ABHA endpoints](https://github.com/kit2824bam017-cell/hacxlerate-challenge-1/blob/main/backend/app/api/v1/abha.py): `backend/app/api/v1/abha.py`
- [ABHA provider](https://github.com/kit2824bam017-cell/hacxlerate-challenge-1/blob/main/backend/app/providers/abha.py): `backend/app/providers/abha.py`
- [Runtime configuration](https://github.com/kit2824bam017-cell/hacxlerate-challenge-1/blob/main/backend/app/core/config.py): `backend/app/core/config.py`

### Other components

- **Patient**

## Connections

- Patient → Web application: uses (evidence: `README.md`)
- Web application → FastAPI application: calls API
- Web application → Document manager: presents upload
- Web application → Extraction review: presents review
- Web application → Health dashboard: presents health data
- Web application → FastAPI application: mounts routes (evidence: `backend/app/main.py`)
- FastAPI application → Document endpoints: routes to (evidence: `backend/app/main.py`)
- FastAPI application → Extraction endpoints: routes to (evidence: `backend/app/main.py`)
- FastAPI application → Records and FHIR API: routes to (evidence: `backend/app/main.py`)
- FastAPI application → Patient endpoints: routes to (evidence: `backend/app/main.py`)
- FastAPI application → Summary endpoints: routes to (evidence: `backend/app/main.py`)
- FastAPI application → Timeline endpoints: routes to (evidence: `backend/app/main.py`)
- FastAPI application → ABHA endpoints: routes to (evidence: `backend/app/main.py`)
- Document endpoints → Document processor: invokes (evidence: `backend/app/api/v1/documents.py`)
- Document processor → OCR provider: extracts text
- Extraction endpoints → Document processor: uses processing (evidence: `backend/app/api/v1/extraction.py`)
- Extraction endpoints → Candidate extraction data: accepts candidate data (evidence: `backend/app/api/v1/extraction.py`)
- Document endpoints → Repository facade: reads and writes (evidence: `backend/app/api/v1/documents.py`)
- Extraction endpoints → Repository facade: reads and writes (evidence: `backend/app/api/v1/extraction.py`)
- Records and FHIR API → Repository facade: reads and writes (evidence: `backend/app/api/v1/records.py`)
- Patient endpoints → Repository facade: reads and writes (evidence: `backend/app/api/v1/patient.py`)
- Summary endpoints → Summary generation: generates summaries (evidence: `backend/app/api/v1/summaries.py`)
- Summary generation → Repository facade: reads and writes (evidence: `backend/app/services/summary_service.py`)
- Summary generation → Tamil translation: translates summaries (evidence: `backend/app/services/summary_service.py`)
- Timeline endpoints → Repository facade: reads history (evidence: `backend/app/api/v1/timeline.py`)
- ABHA endpoints → Repository facade: reads and writes (evidence: `backend/app/api/v1/abha.py`)
- ABHA endpoints → ABHA provider: delegates (evidence: `backend/app/api/v1/abha.py`)
- ABHA endpoints → Runtime configuration: reads settings (evidence: `backend/app/api/v1/abha.py`)
- FastAPI application → Runtime configuration: configures service (evidence: `backend/app/main.py`)
- Repository facade → SQLite persistence: uses persistence (evidence: `backend/app/repositories/store.py`)
- Records and FHIR API → Patient: exports FHIR bundle (evidence: `backend/app/api/v1/records.py`)
