# bit9-a/care_fe architecture

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

- Interactive diagram: https://gitdiagram.com/bit9-a/care_fe
- Repository: https://github.com/bit9-a/care_fe

## Overview

CARE is a healthcare operations frontend for facility and patient workflows. Users authenticate, enter role-aware routes, and work with patient encounters, questionnaires, scheduling, files, and billing; requests are sent to the configured CARE backend. The graph includes the shared request layer and plugin runtime as internal capabilities. Evidence is limited to the README and indexed excerpts, so unsampled feature relationships are omitted where they cannot be verified.

Main entry points: [`src/Utils/request/query.ts`](https://github.com/bit9-a/care_fe/blob/develop/src/Utils/request/query.ts) (API request layer), [`src/App.tsx`](https://github.com/bit9-a/care_fe/blob/develop/src/App.tsx) (Application shell), [`src/Routers/AppRouter.tsx`](https://github.com/bit9-a/care_fe/blob/develop/src/Routers/AppRouter.tsx) (Application routing), [`src/Routers/routes/ConsultationRoutes.tsx`](https://github.com/bit9-a/care_fe/blob/develop/src/Routers/routes/ConsultationRoutes.tsx) (Encounter routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application Shell"]
  node_app["Application shell<br/>[App.tsx]"]
  node_auth["Authentication state"]
  node_router["Application routing<br/>[AppRouter.tsx]"]
  node_consult_routes["Encounter routes"]
  node_facility_routes["Facility routes<br/>[FacilityRoutes.tsx]"]
end

subgraph group_clinical["Clinical Workflows"]
  node_encounter["Encounter workflow"]
  node_encounter_progress["Encounter completion"]
  node_questionnaires["Questionnaires"]
  node_patient["Patient records"]
end

subgraph group_operations["Facility Operations"]
  node_appointments["Appointments"]
  node_facility["Facility operations"]
  node_billing["Billing"]
  node_files["File management<br/>[useFileManager.tsx]"]
end

subgraph group_platform["Shared Platform"]
  node_request["API request layer<br/>[query.ts]"]
  node_mutations["Mutation adapter<br/>[mutate.ts]"]
end

subgraph group_extensions["Extensions"]
  node_plugins["Plugin runtime<br/>[PluginEngine.tsx]"]
end

node_user(("Healthcare user"))
node_backend[("CARE backend")]
node_plugin_service["Plugin federation"]

node_user -->|"opens"| node_app
node_app -->|"provides"| node_auth
node_app -->|"renders"| node_router
node_router -->|"routes"| node_consult_routes
node_router -->|"routes"| node_facility_routes
node_consult_routes -->|"routes to"| node_encounter
node_consult_routes -->|"routes to"| node_questionnaires
node_facility_routes -->|"routes to"| node_facility
node_facility_routes -->|"routes to"| node_billing
node_encounter_progress -->|"batches calls"| node_request
node_encounter_progress -->|"updates"| node_encounter
node_files -->|"queries"| node_request
node_request -->|"sends HTTP"| node_backend
node_mutations -->|"calls API"| node_request
node_plugins -->|"loads config"| node_request
node_plugins -->|"loads remotes"| node_plugin_service

click node_app "https://github.com/bit9-a/care_fe/blob/develop/src/App.tsx"
click node_auth "https://github.com/bit9-a/care_fe/blob/develop/src/Providers/AuthUserProvider.tsx"
click node_router "https://github.com/bit9-a/care_fe/blob/develop/src/Routers/AppRouter.tsx"
click node_consult_routes "https://github.com/bit9-a/care_fe/blob/develop/src/Routers/routes/ConsultationRoutes.tsx"
click node_facility_routes "https://github.com/bit9-a/care_fe/blob/develop/src/Routers/routes/FacilityRoutes.tsx"
click node_encounter "https://github.com/bit9-a/care_fe/tree/develop/src/pages/Encounters"
click node_encounter_progress "https://github.com/bit9-a/care_fe/blob/develop/src/pages/Encounters/utils/useEncounterProgressController.ts"
click node_questionnaires "https://github.com/bit9-a/care_fe/tree/develop/src/components/Questionnaire"
click node_patient "https://github.com/bit9-a/care_fe/tree/develop/src/components/Patient"
click node_appointments "https://github.com/bit9-a/care_fe/tree/develop/src/pages/Appointments"
click node_facility "https://github.com/bit9-a/care_fe/tree/develop/src/pages/Facility"
click node_billing "https://github.com/bit9-a/care_fe/tree/develop/src/components/Billing"
click node_files "https://github.com/bit9-a/care_fe/blob/develop/src/hooks/useFileManager.tsx"
click node_request "https://github.com/bit9-a/care_fe/blob/develop/src/Utils/request/query.ts"
click node_mutations "https://github.com/bit9-a/care_fe/blob/develop/src/Utils/request/mutate.ts"
click node_plugins "https://github.com/bit9-a/care_fe/blob/develop/src/PluginEngine.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_auth,node_router,node_consult_routes,node_facility_routes,node_user toneBlue
class node_encounter,node_encounter_progress,node_questionnaires,node_patient,node_backend toneAmber
class node_appointments,node_facility,node_billing,node_files toneMint
class node_request,node_mutations toneRose
class node_plugins,node_plugin_service toneIndigo
```

## Components

### Application Shell

- [Application shell](https://github.com/bit9-a/care_fe/blob/develop/src/App.tsx): `src/App.tsx`
- [Authentication state](https://github.com/bit9-a/care_fe/blob/develop/src/Providers/AuthUserProvider.tsx): `src/Providers/AuthUserProvider.tsx`
- [Application routing](https://github.com/bit9-a/care_fe/blob/develop/src/Routers/AppRouter.tsx): `src/Routers/AppRouter.tsx`
- [Encounter routes](https://github.com/bit9-a/care_fe/blob/develop/src/Routers/routes/ConsultationRoutes.tsx): `src/Routers/routes/ConsultationRoutes.tsx`
- [Facility routes](https://github.com/bit9-a/care_fe/blob/develop/src/Routers/routes/FacilityRoutes.tsx): `src/Routers/routes/FacilityRoutes.tsx`

### Clinical Workflows

- [Encounter workflow](https://github.com/bit9-a/care_fe/tree/develop/src/pages/Encounters): `src/pages/Encounters`
- [Encounter completion](https://github.com/bit9-a/care_fe/blob/develop/src/pages/Encounters/utils/useEncounterProgressController.ts): `src/pages/Encounters/utils/useEncounterProgressController.ts`
- [Questionnaires](https://github.com/bit9-a/care_fe/tree/develop/src/components/Questionnaire): `src/components/Questionnaire`
- [Patient records](https://github.com/bit9-a/care_fe/tree/develop/src/components/Patient): `src/components/Patient`

### Facility Operations

- [Appointments](https://github.com/bit9-a/care_fe/tree/develop/src/pages/Appointments): `src/pages/Appointments`
- [Facility operations](https://github.com/bit9-a/care_fe/tree/develop/src/pages/Facility): `src/pages/Facility`
- [Billing](https://github.com/bit9-a/care_fe/tree/develop/src/components/Billing): `src/components/Billing`
- [File management](https://github.com/bit9-a/care_fe/blob/develop/src/hooks/useFileManager.tsx): `src/hooks/useFileManager.tsx`

### Shared Platform

- [API request layer](https://github.com/bit9-a/care_fe/blob/develop/src/Utils/request/query.ts): `src/Utils/request/query.ts`
- [Mutation adapter](https://github.com/bit9-a/care_fe/blob/develop/src/Utils/request/mutate.ts): `src/Utils/request/mutate.ts`

### Extensions

- [Plugin runtime](https://github.com/bit9-a/care_fe/blob/develop/src/PluginEngine.tsx): `src/PluginEngine.tsx`

### Other components

- **Healthcare user**
- **CARE backend**
- **Plugin federation**

## Connections

- Healthcare user → Application shell: opens (evidence: `README.md`)
- Application shell → Authentication state: provides (evidence: `src/App.tsx`)
- Application shell → Application routing: renders (evidence: `src/App.tsx`)
- Application routing → Encounter routes: routes (evidence: `src/Routers/AppRouter.tsx`)
- Application routing → Facility routes: routes (evidence: `src/Routers/AppRouter.tsx`)
- Encounter routes → Encounter workflow: routes to (evidence: `src/Routers/routes/ConsultationRoutes.tsx`)
- Encounter routes → Questionnaires: routes to (evidence: `src/Routers/routes/ConsultationRoutes.tsx`)
- Facility routes → Facility operations: routes to (evidence: `src/Routers/routes/FacilityRoutes.tsx`)
- Facility routes → Billing: routes to (evidence: `src/Routers/routes/FacilityRoutes.tsx`)
- Encounter completion → API request layer: batches calls (evidence: `src/pages/Encounters/utils/useEncounterProgressController.ts`)
- Encounter completion → Encounter workflow: updates (evidence: `src/pages/Encounters/utils/useEncounterProgressController.ts`)
- File management → API request layer: queries (evidence: `src/hooks/useFileManager.tsx`)
- API request layer → CARE backend: sends HTTP (evidence: `README.md`)
- Mutation adapter → API request layer: calls API (evidence: `src/Utils/request/mutate.ts`)
- Plugin runtime → API request layer: loads config (evidence: `src/PluginEngine.tsx`)
- Plugin runtime → Plugin federation: loads remotes (evidence: `src/PluginEngine.tsx`)
