# padyalahemakrishnasai-del/care-bridge architecture

> Architecture diagram of the GitHub repository padyalahemakrishnasai-del/care-bridge, 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/padyalahemakrishnasai-del/care-bridge
- Repository: https://github.com/padyalahemakrishnasai-del/care-bridge

## Overview

CareBridge is a healthcare access and family-care web application. The main journey starts at the routed web app, where people can authenticate or use the zero-login emergency screen, then reach care-finding and patient-support modules. The README documents additional modules whose source was not sampled; these are represented at their listed page paths. Sampled state is React context with local-storage persistence and demo data, while authentication also uses Supabase. Edges are limited to routing documented in the README or references shown in sampled source/index entries.

Main entry points: [`src/App.tsx`](https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/App.tsx) (Route application), [`src/context/AppContext.tsx`](https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/context/AppContext.tsx) (Application state), [`src/pages/FacilitiesPage.tsx`](https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/pages/FacilitiesPage.tsx) (Facility discovery), [`src/pages/FacilityDetailsPage.tsx`](https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/pages/FacilityDetailsPage.tsx) (Facility details)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application entry"]
  node_app["Route application<br/>[App.tsx]"]
  node_layout["Main navigation<br/>[MainLayout.tsx]"]
  node_landing["Landing page<br/>[LandingPage.tsx]"]
  node_help["Help and legal information<br/>[HelpInfoPages.tsx]"]
end

subgraph group_care["Care access"]
  node_emergency["Emergency fast lane<br/>[EmergencyPage.tsx]"]
  node_facilities["Facility discovery<br/>[FacilitiesPage.tsx]"]
  node_facilitydetails["Facility details"]
  node_cost["Cost comparison"]
  node_rural["Rural care finder<br/>[RuralCarePage.tsx]"]
  node_trustbadge["Trust indicators<br/>[TrustBadge.tsx]"]
end

subgraph group_patient["Patient support"]
  node_medications["Medication reminders"]
  node_appointments["Appointments"]
  node_records["Medical records vault"]
  node_healthlibrary["Health awareness"]
  node_mental["Mental well-being"]
  node_notifications["Notifications and preferences"]
  node_profile["Profile and privacy<br/>[ProfilePage.tsx]"]
  node_dashboard["Care dashboard<br/>[DashboardPage.tsx]"]
  node_remindertile["Dose action tile<br/>[ReminderTile.tsx]"]
  node_documentcard["Document preview card<br/>[DocumentCard.tsx]"]
end

subgraph group_community["Family and community"]
  node_family["Family coordination"]
  node_donors["Blood donor coordination"]
  node_admin["Administration and verification"]
  node_confirmation["Confirmation dialog"]
end

subgraph group_platform["State and identity"]
  node_authpages["Sign-in and enrollment<br/>[SignUpPage.tsx]"]
  node_authcontext["Authentication state<br/>[AuthContext.tsx]"]
  node_supabase["Supabase client<br/>[supabase.ts]"]
  node_appcontext["Application state<br/>[AppContext.tsx]"]
  node_initialdata["Demo data<br/>[initialData.ts]"]
end

node_user(("Patient or caregiver"))

node_user -->|"opens app"| node_app
node_app -->|"provides auth"| node_authcontext
node_app -->|"provides state"| node_appcontext
node_app -->|"routes directly"| node_emergency
node_app -->|"wraps app pages"| node_layout
node_app -->|"routes signup"| node_authpages
node_app -->|"routes home"| node_landing
node_app -->|"routes finder"| node_facilities
node_app -->|"routes details"| node_facilitydetails
node_app -->|"routes comparison"| node_cost
node_app -->|"routes doses"| node_medications
node_app -->|"routes visits"| node_appointments
node_app -->|"routes records"| node_records
node_app -->|"routes rural care"| node_rural
node_app -->|"routes donors"| node_donors
node_app -->|"routes support"| node_mental
node_app -->|"routes library"| node_healthlibrary
node_app -->|"routes family care"| node_family
node_app -->|"routes preferences"| node_notifications
node_app -->|"routes profile"| node_profile
node_app -->|"routes verification"| node_admin
node_app -->|"routes legal pages"| node_help
node_authpages -->|"uses auth"| node_authcontext
node_authcontext -->|"calls auth API"| node_supabase
node_appcontext -->|"loads defaults"| node_initialdata
node_facilities -->|"reads care data"| node_appcontext
node_facilitydetails -->|"reads care data"| node_appcontext
node_cost -->|"reads care data"| node_appcontext
node_rural -->|"reads care data"| node_appcontext
node_emergency -->|"uses app state"| node_appcontext
node_medications -->|"updates doses"| node_appcontext
node_appointments -->|"uses app state"| node_appcontext
node_records -->|"uses app state"| node_appcontext
node_healthlibrary -->|"uses app state"| node_appcontext
node_mental -->|"uses app state"| node_appcontext
node_family -->|"updates care tasks"| node_appcontext
node_donors -->|"uses app state"| node_appcontext
node_admin -->|"uses app state"| node_appcontext
node_notifications -->|"updates preferences"| node_appcontext
node_profile -->|"uses app state"| node_appcontext
node_dashboard -->|"reads care state"| node_appcontext
node_dashboard -->|"renders doses"| node_remindertile
node_medications -->|"renders dose actions"| node_remindertile
node_records -->|"renders documents"| node_documentcard
node_family -->|"uses confirmations"| node_confirmation
node_facilities -->|"shows trust status"| node_trustbadge
node_facilitydetails -->|"shows trust status"| node_trustbadge
node_rural -->|"shows trust status"| node_trustbadge

click node_app "https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/App.tsx"
click node_layout "https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/components/layout/MainLayout.tsx"
click node_authpages "https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/pages/SignUpPage.tsx"
click node_authcontext "https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/context/AuthContext.tsx"
click node_supabase "https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/lib/supabase.ts"
click node_appcontext "https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/context/AppContext.tsx"
click node_initialdata "https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/data/initialData.ts"
click node_landing "https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/pages/LandingPage.tsx"
click node_emergency "https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/pages/EmergencyPage.tsx"
click node_facilities "https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/pages/FacilitiesPage.tsx"
click node_facilitydetails "https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/pages/FacilityDetailsPage.tsx"
click node_cost "https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/pages/CostComparisonPage.tsx"
click node_rural "https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/pages/RuralCarePage.tsx"
click node_medications "https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/pages/MedicationsPage.tsx"
click node_appointments "https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/pages/AppointmentsPage.tsx"
click node_records "https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/pages/MedicalRecordsPage.tsx"
click node_healthlibrary "https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/pages/HealthLibraryPage.tsx"
click node_mental "https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/pages/MentalHealthPage.tsx"
click node_family "https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/pages/FamilyCoordinationPage.tsx"
click node_donors "https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/pages/BloodDonorsPage.tsx"
click node_admin "https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/pages/VerificationModerationPage.tsx"
click node_notifications "https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/pages/NotificationsPage.tsx"
click node_profile "https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/pages/ProfilePage.tsx"
click node_help "https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/pages/HelpInfoPages.tsx"
click node_dashboard "https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/pages/DashboardPage.tsx"
click node_remindertile "https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/components/ui/ReminderTile.tsx"
click node_trustbadge "https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/components/ui/TrustBadge.tsx"
click node_documentcard "https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/components/ui/DocumentCard.tsx"
click node_confirmation "https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/components/ui/ConfirmationDialog.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_app,node_layout,node_landing,node_help toneBlue
class node_emergency,node_facilities,node_facilitydetails,node_cost,node_rural,node_trustbadge toneAmber
class node_medications,node_appointments,node_records,node_healthlibrary,node_mental,node_notifications,node_profile,node_dashboard,node_remindertile,node_documentcard toneMint
class node_family,node_donors,node_admin,node_confirmation toneRose
class node_authpages,node_authcontext,node_supabase,node_appcontext,node_initialdata,node_user toneIndigo
```

## Components

### Application entry

- [Route application](https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/App.tsx): `src/App.tsx`
- [Main navigation](https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/components/layout/MainLayout.tsx): `src/components/layout/MainLayout.tsx`
- [Landing page](https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/pages/LandingPage.tsx): `src/pages/LandingPage.tsx`
- [Help and legal information](https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/pages/HelpInfoPages.tsx): `src/pages/HelpInfoPages.tsx`

### Care access

- [Emergency fast lane](https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/pages/EmergencyPage.tsx): `src/pages/EmergencyPage.tsx`
- [Facility discovery](https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/pages/FacilitiesPage.tsx): `src/pages/FacilitiesPage.tsx`
- [Facility details](https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/pages/FacilityDetailsPage.tsx): `src/pages/FacilityDetailsPage.tsx`
- [Cost comparison](https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/pages/CostComparisonPage.tsx): `src/pages/CostComparisonPage.tsx`
- [Rural care finder](https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/pages/RuralCarePage.tsx): `src/pages/RuralCarePage.tsx`
- [Trust indicators](https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/components/ui/TrustBadge.tsx): `src/components/ui/TrustBadge.tsx`

### Patient support

- [Medication reminders](https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/pages/MedicationsPage.tsx): `src/pages/MedicationsPage.tsx`
- [Appointments](https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/pages/AppointmentsPage.tsx): `src/pages/AppointmentsPage.tsx`
- [Medical records vault](https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/pages/MedicalRecordsPage.tsx): `src/pages/MedicalRecordsPage.tsx`
- [Health awareness](https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/pages/HealthLibraryPage.tsx): `src/pages/HealthLibraryPage.tsx`
- [Mental well-being](https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/pages/MentalHealthPage.tsx): `src/pages/MentalHealthPage.tsx`
- [Notifications and preferences](https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/pages/NotificationsPage.tsx): `src/pages/NotificationsPage.tsx`
- [Profile and privacy](https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/pages/ProfilePage.tsx): `src/pages/ProfilePage.tsx`
- [Care dashboard](https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/pages/DashboardPage.tsx): `src/pages/DashboardPage.tsx`
- [Dose action tile](https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/components/ui/ReminderTile.tsx): `src/components/ui/ReminderTile.tsx`
- [Document preview card](https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/components/ui/DocumentCard.tsx): `src/components/ui/DocumentCard.tsx`

### Family and community

- [Family coordination](https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/pages/FamilyCoordinationPage.tsx): `src/pages/FamilyCoordinationPage.tsx`
- [Blood donor coordination](https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/pages/BloodDonorsPage.tsx): `src/pages/BloodDonorsPage.tsx`
- [Administration and verification](https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/pages/VerificationModerationPage.tsx): `src/pages/VerificationModerationPage.tsx`
- [Confirmation dialog](https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/components/ui/ConfirmationDialog.tsx): `src/components/ui/ConfirmationDialog.tsx`

### State and identity

- [Sign-in and enrollment](https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/pages/SignUpPage.tsx): `src/pages/SignUpPage.tsx`
- [Authentication state](https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/context/AuthContext.tsx): `src/context/AuthContext.tsx`
- [Supabase client](https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`
- [Application state](https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/context/AppContext.tsx): `src/context/AppContext.tsx`
- [Demo data](https://github.com/padyalahemakrishnasai-del/care-bridge/blob/main/src/data/initialData.ts): `src/data/initialData.ts`

### Other components

- **Patient or caregiver**

## Connections

- Patient or caregiver → Route application: opens app (evidence: `README.md`)
- Route application → Authentication state: provides auth (evidence: `src/App.tsx`)
- Route application → Application state: provides state (evidence: `src/App.tsx`)
- Route application → Emergency fast lane: routes directly (evidence: `src/App.tsx`)
- Route application → Main navigation: wraps app pages (evidence: `src/App.tsx`)
- Route application → Sign-in and enrollment: routes signup (evidence: `src/App.tsx`)
- Route application → Landing page: routes home (evidence: `README.md`)
- Route application → Facility discovery: routes finder (evidence: `README.md`)
- Route application → Facility details: routes details (evidence: `src/App.tsx`)
- Route application → Cost comparison: routes comparison (evidence: `src/App.tsx`)
- Route application → Medication reminders: routes doses (evidence: `src/App.tsx`)
- Route application → Appointments: routes visits (evidence: `src/App.tsx`)
- Route application → Medical records vault: routes records (evidence: `src/App.tsx`)
- Route application → Rural care finder: routes rural care (evidence: `README.md`)
- Route application → Blood donor coordination: routes donors (evidence: `README.md`)
- Route application → Mental well-being: routes support (evidence: `README.md`)
- Route application → Health awareness: routes library (evidence: `README.md`)
- Route application → Family coordination: routes family care (evidence: `README.md`)
- Route application → Notifications and preferences: routes preferences (evidence: `README.md`)
- Route application → Profile and privacy: routes profile (evidence: `README.md`)
- Route application → Administration and verification: routes verification (evidence: `src/App.tsx`)
- Route application → Help and legal information: routes legal pages (evidence: `src/App.tsx`)
- Sign-in and enrollment → Authentication state: uses auth (evidence: `src/pages/SignUpPage.tsx`)
- Authentication state → Supabase client: calls auth API (evidence: `src/context/AuthContext.tsx`)
- Application state → Demo data: loads defaults (evidence: `src/context/AppContext.tsx`)
- Facility discovery → Application state: reads care data (evidence: `src/pages/FacilitiesPage.tsx`)
- Facility details → Application state: reads care data (evidence: `src/pages/FacilityDetailsPage.tsx`)
- Cost comparison → Application state: reads care data (evidence: `src/pages/CostComparisonPage.tsx`)
- Rural care finder → Application state: reads care data (evidence: `src/pages/RuralCarePage.tsx`)
- Emergency fast lane → Application state: uses app state (evidence: `src/pages/EmergencyPage.tsx`)
- Medication reminders → Application state: updates doses (evidence: `src/pages/MedicationsPage.tsx`)
- Appointments → Application state: uses app state (evidence: `src/pages/AppointmentsPage.tsx`)
- Medical records vault → Application state: uses app state (evidence: `src/pages/MedicalRecordsPage.tsx`)
- Health awareness → Application state: uses app state (evidence: `src/pages/HealthLibraryPage.tsx`)
- Mental well-being → Application state: uses app state (evidence: `src/pages/MentalHealthPage.tsx`)
- Family coordination → Application state: updates care tasks (evidence: `src/pages/FamilyCoordinationPage.tsx`)
- Blood donor coordination → Application state: uses app state (evidence: `src/pages/BloodDonorsPage.tsx`)
- Administration and verification → Application state: uses app state (evidence: `src/pages/VerificationModerationPage.tsx`)
- Notifications and preferences → Application state: updates preferences (evidence: `src/pages/NotificationsPage.tsx`)
- Profile and privacy → Application state: uses app state (evidence: `src/pages/ProfilePage.tsx`)
- Care dashboard → Application state: reads care state (evidence: `src/pages/DashboardPage.tsx`)
- Care dashboard → Dose action tile: renders doses (evidence: `src/pages/DashboardPage.tsx`)
- Medication reminders → Dose action tile: renders dose actions (evidence: `src/pages/MedicationsPage.tsx`)
- Medical records vault → Document preview card: renders documents (evidence: `src/pages/MedicalRecordsPage.tsx`)
- Family coordination → Confirmation dialog: uses confirmations (evidence: `src/pages/FamilyCoordinationPage.tsx`)
- Facility discovery → Trust indicators: shows trust status
- Facility details → Trust indicators: shows trust status (evidence: `src/pages/FacilityDetailsPage.tsx`)
- Rural care finder → Trust indicators: shows trust status (evidence: `src/pages/RuralCarePage.tsx`)
