# arusssh/carebridge-a.i architecture

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

- Interactive diagram: https://gitdiagram.com/arusssh/carebridge-a.i
- Repository: https://github.com/arusssh/carebridge-a.i

## Overview

CareBridge AI turns provider documents or sample vignettes into source-cited care plans, flags clinical ambiguities for human review, and presents actionable summaries, recovery timelines, and adherence tracking. The main user flow runs from the React app through its API client to FastAPI extraction and safety review, then into care-plan views and task updates. Caregiver coordination, notifications, and benchmark reporting are additional capabilities. Some backend routes and integrations are only documented or indexed, so uncertain connections are omitted.

Main entry points: [`frontend/src/App.tsx`](https://github.com/arusssh/carebridge-a.i/blob/main/frontend/src/App.tsx) (Application shell), [`backend/app/main.py`](https://github.com/arusssh/carebridge-a.i/blob/main/backend/app/main.py) (FastAPI routes), [`frontend/src/api/client.ts`](https://github.com/arusssh/carebridge-a.i/blob/main/frontend/src/api/client.ts) (REST client), [`backend/app/services/benchmark_runner.py`](https://github.com/arusssh/carebridge-a.i/blob/main/backend/app/services/benchmark_runner.py) (Benchmark runner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Patient Experience"]
  node_app["Application shell<br/>[App.tsx]"]
  node_ingest_ui["Document intake<br/>[IngestionHub.tsx]"]
  node_scanner["Document scanner"]
  node_review_ui["Human review"]
  node_plan_ui["Care plan view<br/>[CarePlanView.tsx]"]
  node_timeline_ui["Recovery timeline<br/>[TimelineView.tsx]"]
  node_tasks_ui["Task tracker<br/>[TaskTracker.tsx]"]
  node_questions_ui["Visit questions"]
  node_caregiver_ui["Caregiver portal"]
  node_notifications_ui["Notification center"]
  node_benchmark_ui["Benchmark dashboard"]
  node_api_client["REST client<br/>[client.ts]"]
end

subgraph group_ingestion["Clinical Ingestion"]
  node_resilient["Local fallback engine<br/>[resilientEngine.ts]"]
  node_api["FastAPI routes<br/>[main.py]"]
  node_parser["Document parsing<br/>[document_parser.py]"]
  node_extractor["Care plan extraction<br/>[ai_extractor.py]"]
end

subgraph group_planning["Care Plan Services"]
  node_care_models["Care plan schemas<br/>[care_plan.py]"]
  node_timeline["Timeline sequencing"]
  node_task_service["Task adherence<br/>[task_service.py]"]
end

subgraph group_coordination["Care Coordination"]
  node_caregiver_service["Caregiver coordination"]
  node_notification_service["Notification delivery"]
end

subgraph group_quality["Safety and Evaluation"]
  node_safety["Safety audit<br/>[safety_auditor.py]"]
  node_safety_models["Safety results<br/>[safety.py]"]
  node_benchmark["Benchmark runner"]
  node_evaluation_models["Evaluation results<br/>[evaluation.py]"]
end

node_patient(("Patient / caregiver"))

node_patient -->|"uses"| node_app
node_app -->|"renders"| node_ingest_ui
node_app -->|"renders"| node_scanner
node_app -->|"renders"| node_review_ui
node_app -->|"renders"| node_plan_ui
node_app -->|"renders"| node_timeline_ui
node_app -->|"renders"| node_tasks_ui
node_app -->|"renders"| node_questions_ui
node_app -->|"renders"| node_caregiver_ui
node_app -->|"renders"| node_notifications_ui
node_app -->|"renders"| node_benchmark_ui
node_app -->|"calls"| node_api_client
node_api_client -->|"falls back"| node_resilient
node_ingest_ui -->|"loads presets"| node_api_client
node_api_client -->|"requests routes"| node_api
node_api -->|"parses uploads"| node_parser
node_api -->|"extracts plan"| node_extractor
node_extractor -->|"builds"| node_care_models
node_api -->|"audits plan"| node_safety
node_safety -->|"returns findings"| node_safety_models
node_api -->|"generates timeline"| node_timeline
node_timeline -->|"reads plan"| node_care_models
node_api -->|"updates tasks"| node_task_service
node_task_service -->|"updates status"| node_care_models
node_api -->|"coordinates circle"| node_caregiver_service
node_api -->|"manages notifications"| node_notification_service
node_api_client -->|"requests benchmark"| node_benchmark
node_benchmark -->|"evaluates extraction"| node_extractor
node_benchmark -->|"evaluates safety"| node_safety
node_benchmark -->|"reports metrics"| node_evaluation_models

click node_app "https://github.com/arusssh/carebridge-a.i/blob/main/frontend/src/App.tsx"
click node_ingest_ui "https://github.com/arusssh/carebridge-a.i/blob/main/frontend/src/components/IngestionHub.tsx"
click node_scanner "https://github.com/arusssh/carebridge-a.i/blob/main/frontend/src/components/DocumentScanner.tsx"
click node_review_ui "https://github.com/arusssh/carebridge-a.i/blob/main/frontend/src/components/ValidationReview.tsx"
click node_plan_ui "https://github.com/arusssh/carebridge-a.i/blob/main/frontend/src/components/CarePlanView.tsx"
click node_timeline_ui "https://github.com/arusssh/carebridge-a.i/blob/main/frontend/src/components/TimelineView.tsx"
click node_tasks_ui "https://github.com/arusssh/carebridge-a.i/blob/main/frontend/src/components/TaskTracker.tsx"
click node_questions_ui "https://github.com/arusssh/carebridge-a.i/blob/main/frontend/src/components/ClarificationModal.tsx"
click node_caregiver_ui "https://github.com/arusssh/carebridge-a.i/blob/main/frontend/src/components/CaregiverPortal.tsx"
click node_notifications_ui "https://github.com/arusssh/carebridge-a.i/blob/main/frontend/src/components/NotificationCenter.tsx"
click node_benchmark_ui "https://github.com/arusssh/carebridge-a.i/blob/main/frontend/src/components/BenchmarkDashboard.tsx"
click node_api_client "https://github.com/arusssh/carebridge-a.i/blob/main/frontend/src/api/client.ts"
click node_resilient "https://github.com/arusssh/carebridge-a.i/blob/main/frontend/src/api/resilientEngine.ts"
click node_api "https://github.com/arusssh/carebridge-a.i/blob/main/backend/app/main.py"
click node_parser "https://github.com/arusssh/carebridge-a.i/blob/main/backend/app/services/document_parser.py"
click node_extractor "https://github.com/arusssh/carebridge-a.i/blob/main/backend/app/services/ai_extractor.py"
click node_care_models "https://github.com/arusssh/carebridge-a.i/blob/main/backend/app/models/care_plan.py"
click node_timeline "https://github.com/arusssh/carebridge-a.i/blob/main/backend/app/services/timeline_service.py"
click node_task_service "https://github.com/arusssh/carebridge-a.i/blob/main/backend/app/services/task_service.py"
click node_caregiver_service "https://github.com/arusssh/carebridge-a.i/blob/main/backend/app/services/caregiver_service.py"
click node_notification_service "https://github.com/arusssh/carebridge-a.i/blob/main/backend/app/services/notification_service.py"
click node_safety "https://github.com/arusssh/carebridge-a.i/blob/main/backend/app/services/safety_auditor.py"
click node_safety_models "https://github.com/arusssh/carebridge-a.i/blob/main/backend/app/models/safety.py"
click node_benchmark "https://github.com/arusssh/carebridge-a.i/blob/main/backend/app/services/benchmark_runner.py"
click node_evaluation_models "https://github.com/arusssh/carebridge-a.i/blob/main/backend/app/models/evaluation.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_app,node_ingest_ui,node_scanner,node_review_ui,node_plan_ui,node_timeline_ui,node_tasks_ui,node_questions_ui,node_caregiver_ui,node_notifications_ui,node_benchmark_ui,node_api_client toneBlue
class node_resilient,node_api,node_parser,node_extractor toneAmber
class node_care_models,node_timeline,node_task_service toneMint
class node_caregiver_service,node_notification_service toneRose
class node_safety,node_safety_models,node_benchmark,node_evaluation_models,node_patient toneIndigo
```

## Components

### Patient Experience

- [Application shell](https://github.com/arusssh/carebridge-a.i/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Document intake](https://github.com/arusssh/carebridge-a.i/blob/main/frontend/src/components/IngestionHub.tsx): `frontend/src/components/IngestionHub.tsx`
- [Document scanner](https://github.com/arusssh/carebridge-a.i/blob/main/frontend/src/components/DocumentScanner.tsx): `frontend/src/components/DocumentScanner.tsx`
- [Human review](https://github.com/arusssh/carebridge-a.i/blob/main/frontend/src/components/ValidationReview.tsx): `frontend/src/components/ValidationReview.tsx`
- [Care plan view](https://github.com/arusssh/carebridge-a.i/blob/main/frontend/src/components/CarePlanView.tsx): `frontend/src/components/CarePlanView.tsx`
- [Recovery timeline](https://github.com/arusssh/carebridge-a.i/blob/main/frontend/src/components/TimelineView.tsx): `frontend/src/components/TimelineView.tsx`
- [Task tracker](https://github.com/arusssh/carebridge-a.i/blob/main/frontend/src/components/TaskTracker.tsx): `frontend/src/components/TaskTracker.tsx`
- [Visit questions](https://github.com/arusssh/carebridge-a.i/blob/main/frontend/src/components/ClarificationModal.tsx): `frontend/src/components/ClarificationModal.tsx`
- [Caregiver portal](https://github.com/arusssh/carebridge-a.i/blob/main/frontend/src/components/CaregiverPortal.tsx): `frontend/src/components/CaregiverPortal.tsx`
- [Notification center](https://github.com/arusssh/carebridge-a.i/blob/main/frontend/src/components/NotificationCenter.tsx): `frontend/src/components/NotificationCenter.tsx`
- [Benchmark dashboard](https://github.com/arusssh/carebridge-a.i/blob/main/frontend/src/components/BenchmarkDashboard.tsx): `frontend/src/components/BenchmarkDashboard.tsx`
- [REST client](https://github.com/arusssh/carebridge-a.i/blob/main/frontend/src/api/client.ts): `frontend/src/api/client.ts`

### Clinical Ingestion

- [Local fallback engine](https://github.com/arusssh/carebridge-a.i/blob/main/frontend/src/api/resilientEngine.ts): `frontend/src/api/resilientEngine.ts`
- [FastAPI routes](https://github.com/arusssh/carebridge-a.i/blob/main/backend/app/main.py): `backend/app/main.py`
- [Document parsing](https://github.com/arusssh/carebridge-a.i/blob/main/backend/app/services/document_parser.py): `backend/app/services/document_parser.py`
- [Care plan extraction](https://github.com/arusssh/carebridge-a.i/blob/main/backend/app/services/ai_extractor.py): `backend/app/services/ai_extractor.py`

### Care Plan Services

- [Care plan schemas](https://github.com/arusssh/carebridge-a.i/blob/main/backend/app/models/care_plan.py): `backend/app/models/care_plan.py`
- [Timeline sequencing](https://github.com/arusssh/carebridge-a.i/blob/main/backend/app/services/timeline_service.py): `backend/app/services/timeline_service.py`
- [Task adherence](https://github.com/arusssh/carebridge-a.i/blob/main/backend/app/services/task_service.py): `backend/app/services/task_service.py`

### Care Coordination

- [Caregiver coordination](https://github.com/arusssh/carebridge-a.i/blob/main/backend/app/services/caregiver_service.py): `backend/app/services/caregiver_service.py`
- [Notification delivery](https://github.com/arusssh/carebridge-a.i/blob/main/backend/app/services/notification_service.py): `backend/app/services/notification_service.py`

### Safety and Evaluation

- [Safety audit](https://github.com/arusssh/carebridge-a.i/blob/main/backend/app/services/safety_auditor.py): `backend/app/services/safety_auditor.py`
- [Safety results](https://github.com/arusssh/carebridge-a.i/blob/main/backend/app/models/safety.py): `backend/app/models/safety.py`
- [Benchmark runner](https://github.com/arusssh/carebridge-a.i/blob/main/backend/app/services/benchmark_runner.py): `backend/app/services/benchmark_runner.py`
- [Evaluation results](https://github.com/arusssh/carebridge-a.i/blob/main/backend/app/models/evaluation.py): `backend/app/models/evaluation.py`

### Other components

- **Patient / caregiver**

## Connections

- Patient / caregiver → Application shell: uses (evidence: `README.md`)
- Application shell → Document intake: renders (evidence: `frontend/src/App.tsx`)
- Application shell → Document scanner: renders (evidence: `frontend/src/App.tsx`)
- Application shell → Human review: renders (evidence: `frontend/src/App.tsx`)
- Application shell → Care plan view: renders (evidence: `frontend/src/App.tsx`)
- Application shell → Recovery timeline: renders (evidence: `frontend/src/App.tsx`)
- Application shell → Task tracker: renders (evidence: `frontend/src/App.tsx`)
- Application shell → Visit questions: renders (evidence: `frontend/src/App.tsx`)
- Application shell → Caregiver portal: renders (evidence: `frontend/src/App.tsx`)
- Application shell → Notification center: renders (evidence: `frontend/src/App.tsx`)
- Application shell → Benchmark dashboard: renders (evidence: `frontend/src/App.tsx`)
- Application shell → REST client: calls (evidence: `frontend/src/App.tsx`)
- REST client → Local fallback engine: falls back (evidence: `frontend/src/api/client.ts`)
- Document intake → REST client: loads presets (evidence: `frontend/src/components/IngestionHub.tsx`)
- REST client → FastAPI routes: requests routes (evidence: `README.md`)
- FastAPI routes → Document parsing: parses uploads (evidence: `backend/app/main.py`)
- FastAPI routes → Care plan extraction: extracts plan (evidence: `backend/app/main.py`)
- Care plan extraction → Care plan schemas: builds (evidence: `backend/app/services/ai_extractor.py`)
- FastAPI routes → Safety audit: audits plan (evidence: `backend/app/main.py`)
- Safety audit → Safety results: returns findings (evidence: `backend/app/services/safety_auditor.py`)
- FastAPI routes → Timeline sequencing: generates timeline (evidence: `backend/app/main.py`)
- Timeline sequencing → Care plan schemas: reads plan (evidence: `backend/app/services/timeline_service.py`)
- FastAPI routes → Task adherence: updates tasks (evidence: `backend/app/main.py`)
- Task adherence → Care plan schemas: updates status (evidence: `backend/app/services/task_service.py`)
- FastAPI routes → Caregiver coordination: coordinates circle (evidence: `backend/app/main.py`)
- FastAPI routes → Notification delivery: manages notifications (evidence: `backend/app/main.py`)
- REST client → Benchmark runner: requests benchmark (evidence: `README.md`)
- Benchmark runner → Care plan extraction: evaluates extraction (evidence: `backend/app/services/benchmark_runner.py`)
- Benchmark runner → Safety audit: evaluates safety (evidence: `backend/app/services/benchmark_runner.py`)
- Benchmark runner → Evaluation results: reports metrics (evidence: `backend/app/services/benchmark_runner.py`)
