# sunnyshin8/zentro-x-dawki architecture

> Architecture diagram of the GitHub repository sunnyshin8/zentro-x-dawki, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sunnyshin8/zentro-x-dawki
- Repository: https://github.com/sunnyshin8/zentro-x-dawki

## Overview

Zentro is a patient and clinical-operations platform; Dawki supplies governed care-navigation workflows. The main journey authenticates a patient, gathers consent and structured fever information, applies deterministic safety rules, and routes the result toward appointments, clinician review, or emergency guidance. Separate branches cover the governed support assistant, documents and caregiver access, connected-care interfaces, and operational monitoring. Sampled source confirms several route-to-service calls; other capability links below are supported by the README, not inspected implementation.

Main entry points: [`src/app/api/dawki/fever/route.ts`](https://github.com/sunnyshin8/zentro-x-dawki/blob/main/src/app/api/dawki/fever/route.ts) (Fever intake route), [`src/app`](https://github.com/sunnyshin8/zentro-x-dawki/tree/main/src/app) (Patient journeys), [`src/app/api/chat/route.ts`](https://github.com/sunnyshin8/zentro-x-dawki/blob/main/src/app/api/chat/route.ts) (Assistant route), [`java-service/src/main/java/com/zentro/scheduling/appointments/AppointmentService.java`](https://github.com/sunnyshin8/zentro-x-dawki/blob/main/java-service/src/main/java/com/zentro/scheduling/appointments/AppointmentService.java) (Scheduling service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Patient experience"]
  node_patient_ui["Patient journeys"]
  node_chat_api["Assistant route<br/>[route.ts]"]
  node_chat_safety["Chat safety<br/>[chatSafety.ts]"]
end

subgraph group_dawki["Dawki workflows"]
  node_fever_api["Fever intake route<br/>[route.ts]"]
  node_dawki_client["Dawki client<br/>[dawkiService.ts]"]
  node_dawki_service["Dawki workflow API<br/>[app.py]"]
  node_fever_engine["Fever rules<br/>[engine.py]"]
  node_ml_service["Research ML<br/>[inference.py]"]
  node_journey_state["Journey state"]
end

subgraph group_care["Clinical operations"]
  node_appointments["Scheduling service"]
  node_reviews["Clinical review"]
  node_telehealth["Telehealth verification"]
  node_documents["Health documents"]
  node_delegation["Caregiver access<br/>[delegationStore.ts]"]
end

subgraph group_platform["Trust and operations"]
  node_auth["Session identity<br/>[currentUser.ts]"]
  node_auth_store[("Account storage<br/>[authStore.ts]")]
  node_consent[("Consent records<br/>[consentStore.ts]")]
  node_java_gateway["Java service client"]
  node_audit[("Audit service<br/>[AuditService.java]")]
  node_operations["Operations intelligence"]
  node_events[("Operational events")]
end

subgraph group_connected["Connected care"]
  node_fhir["FHIR interfaces<br/>[fhirR4.ts]"]
  node_partners["Partner gateway<br/>[partnerGateway.ts]"]
end

node_patient(("Patient"))
node_clinician(("Clinician"))

node_patient -->|"uses"| node_patient_ui
node_patient_ui -.->|"sends chat"| node_chat_api
node_chat_api -->|"screens messages"| node_chat_safety
node_chat_api -->|"checks identity"| node_auth
node_chat_api -->|"requests assistant"| node_dawki_client
node_chat_api -.->|"books selected slot"| node_appointments
node_patient_ui -.->|"submits intake"| node_fever_api
node_fever_api -->|"checks identity"| node_auth
node_fever_api -->|"records consent"| node_consent
node_fever_api -->|"evaluates intake"| node_dawki_client
node_dawki_client -->|"calls workflow API"| node_dawki_service
node_dawki_service -->|"evaluates rules"| node_fever_engine
node_fever_engine -.->|"may consult shadow signal"| node_ml_service
node_fever_api -->|"persists journey"| node_journey_state
node_fever_api -.->|"routes escalation"| node_reviews
node_fever_api -.->|"routes routine care"| node_appointments
node_clinician -->|"resolves reviews"| node_reviews
node_clinician -->|"updates verification"| node_telehealth
node_patient_ui -.->|"uploads records"| node_documents
node_patient_ui -.->|"manages invitations"| node_delegation
node_auth -->|"loads account"| node_auth_store
node_fever_api -.->|"requests workflow actions"| node_java_gateway
node_java_gateway -->|"calls scheduling API"| node_appointments
node_java_gateway -.->|"calls audit API"| node_audit
node_reviews -->|"records review events"| node_audit
node_appointments -->|"records appointment events"| node_audit
node_fever_api -->|"records operational events"| node_events
node_operations -.->|"analyzes events"| node_events
node_patient_ui -.->|"uses care interfaces"| node_fhir
node_fhir -.->|"adapts partner exchange"| node_partners

click node_patient_ui "https://github.com/sunnyshin8/zentro-x-dawki/tree/main/src/app"
click node_chat_api "https://github.com/sunnyshin8/zentro-x-dawki/blob/main/src/app/api/chat/route.ts"
click node_chat_safety "https://github.com/sunnyshin8/zentro-x-dawki/blob/main/src/services/chatSafety.ts"
click node_fever_api "https://github.com/sunnyshin8/zentro-x-dawki/blob/main/src/app/api/dawki/fever/route.ts"
click node_dawki_client "https://github.com/sunnyshin8/zentro-x-dawki/blob/main/src/services/dawkiService.ts"
click node_dawki_service "https://github.com/sunnyshin8/zentro-x-dawki/blob/main/dawki-service/src/dawki/app.py"
click node_fever_engine "https://github.com/sunnyshin8/zentro-x-dawki/blob/main/dawki-service/src/dawki/engine.py"
click node_ml_service "https://github.com/sunnyshin8/zentro-x-dawki/blob/main/dawki-ml-service/src/dawki_ml/inference.py"
click node_journey_state "https://github.com/sunnyshin8/zentro-x-dawki/blob/main/src/services/dawkiJourneyStore.ts"
click node_appointments "https://github.com/sunnyshin8/zentro-x-dawki/blob/main/java-service/src/main/java/com/zentro/scheduling/appointments/AppointmentService.java"
click node_reviews "https://github.com/sunnyshin8/zentro-x-dawki/blob/main/java-service/src/main/java/com/zentro/scheduling/review/ClinicalReviewService.java"
click node_telehealth "https://github.com/sunnyshin8/zentro-x-dawki/blob/main/java-service/src/main/java/com/zentro/scheduling/verification/TelehealthVerificationService.java"
click node_documents "https://github.com/sunnyshin8/zentro-x-dawki/blob/main/src/services/healthDocuments/healthDocumentStore.ts"
click node_delegation "https://github.com/sunnyshin8/zentro-x-dawki/blob/main/src/services/delegation/delegationStore.ts"
click node_auth "https://github.com/sunnyshin8/zentro-x-dawki/blob/main/src/services/auth/currentUser.ts"
click node_auth_store "https://github.com/sunnyshin8/zentro-x-dawki/blob/main/src/services/auth/authStore.ts"
click node_consent "https://github.com/sunnyshin8/zentro-x-dawki/blob/main/src/services/consent/consentStore.ts"
click node_java_gateway "https://github.com/sunnyshin8/zentro-x-dawki/blob/main/src/services/javaMicroservice.ts"
click node_audit "https://github.com/sunnyshin8/zentro-x-dawki/blob/main/java-service/src/main/java/com/zentro/scheduling/audit/AuditService.java"
click node_operations "https://github.com/sunnyshin8/zentro-x-dawki/blob/main/src/services/operations/operationalIntelligence.ts"
click node_events "https://github.com/sunnyshin8/zentro-x-dawki/blob/main/src/services/operations/operationalEventStore.ts"
click node_fhir "https://github.com/sunnyshin8/zentro-x-dawki/blob/main/src/services/integrations/fhirR4.ts"
click node_partners "https://github.com/sunnyshin8/zentro-x-dawki/blob/main/src/services/integrations/partnerGateway.ts"

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_patient_ui,node_chat_api,node_chat_safety toneBlue
class node_fever_api,node_dawki_client,node_dawki_service,node_fever_engine,node_ml_service,node_journey_state toneAmber
class node_appointments,node_reviews,node_telehealth,node_documents,node_delegation toneMint
class node_auth,node_auth_store,node_consent,node_java_gateway,node_audit,node_operations,node_events toneRose
class node_fhir,node_partners,node_patient,node_clinician toneIndigo
```

## Components

### Patient experience

- [Patient journeys](https://github.com/sunnyshin8/zentro-x-dawki/tree/main/src/app): `src/app`
- [Assistant route](https://github.com/sunnyshin8/zentro-x-dawki/blob/main/src/app/api/chat/route.ts): `src/app/api/chat/route.ts`
- [Chat safety](https://github.com/sunnyshin8/zentro-x-dawki/blob/main/src/services/chatSafety.ts): `src/services/chatSafety.ts`

### Dawki workflows

- [Fever intake route](https://github.com/sunnyshin8/zentro-x-dawki/blob/main/src/app/api/dawki/fever/route.ts): `src/app/api/dawki/fever/route.ts`
- [Dawki client](https://github.com/sunnyshin8/zentro-x-dawki/blob/main/src/services/dawkiService.ts): `src/services/dawkiService.ts`
- [Dawki workflow API](https://github.com/sunnyshin8/zentro-x-dawki/blob/main/dawki-service/src/dawki/app.py): `dawki-service/src/dawki/app.py`
- [Fever rules](https://github.com/sunnyshin8/zentro-x-dawki/blob/main/dawki-service/src/dawki/engine.py): `dawki-service/src/dawki/engine.py`
- [Research ML](https://github.com/sunnyshin8/zentro-x-dawki/blob/main/dawki-ml-service/src/dawki_ml/inference.py): `dawki-ml-service/src/dawki_ml/inference.py`
- [Journey state](https://github.com/sunnyshin8/zentro-x-dawki/blob/main/src/services/dawkiJourneyStore.ts): `src/services/dawkiJourneyStore.ts`

### Clinical operations

- [Scheduling service](https://github.com/sunnyshin8/zentro-x-dawki/blob/main/java-service/src/main/java/com/zentro/scheduling/appointments/AppointmentService.java): `java-service/src/main/java/com/zentro/scheduling/appointments/AppointmentService.java`
- [Clinical review](https://github.com/sunnyshin8/zentro-x-dawki/blob/main/java-service/src/main/java/com/zentro/scheduling/review/ClinicalReviewService.java): `java-service/src/main/java/com/zentro/scheduling/review/ClinicalReviewService.java`
- [Telehealth verification](https://github.com/sunnyshin8/zentro-x-dawki/blob/main/java-service/src/main/java/com/zentro/scheduling/verification/TelehealthVerificationService.java): `java-service/src/main/java/com/zentro/scheduling/verification/TelehealthVerificationService.java`
- [Health documents](https://github.com/sunnyshin8/zentro-x-dawki/blob/main/src/services/healthDocuments/healthDocumentStore.ts): `src/services/healthDocuments/healthDocumentStore.ts`
- [Caregiver access](https://github.com/sunnyshin8/zentro-x-dawki/blob/main/src/services/delegation/delegationStore.ts): `src/services/delegation/delegationStore.ts`

### Trust and operations

- [Session identity](https://github.com/sunnyshin8/zentro-x-dawki/blob/main/src/services/auth/currentUser.ts): `src/services/auth/currentUser.ts`
- [Account storage](https://github.com/sunnyshin8/zentro-x-dawki/blob/main/src/services/auth/authStore.ts): `src/services/auth/authStore.ts`
- [Consent records](https://github.com/sunnyshin8/zentro-x-dawki/blob/main/src/services/consent/consentStore.ts): `src/services/consent/consentStore.ts`
- [Java service client](https://github.com/sunnyshin8/zentro-x-dawki/blob/main/src/services/javaMicroservice.ts): `src/services/javaMicroservice.ts`
- [Audit service](https://github.com/sunnyshin8/zentro-x-dawki/blob/main/java-service/src/main/java/com/zentro/scheduling/audit/AuditService.java): `java-service/src/main/java/com/zentro/scheduling/audit/AuditService.java`
- [Operations intelligence](https://github.com/sunnyshin8/zentro-x-dawki/blob/main/src/services/operations/operationalIntelligence.ts): `src/services/operations/operationalIntelligence.ts`
- [Operational events](https://github.com/sunnyshin8/zentro-x-dawki/blob/main/src/services/operations/operationalEventStore.ts): `src/services/operations/operationalEventStore.ts`

### Connected care

- [FHIR interfaces](https://github.com/sunnyshin8/zentro-x-dawki/blob/main/src/services/integrations/fhirR4.ts): `src/services/integrations/fhirR4.ts`
- [Partner gateway](https://github.com/sunnyshin8/zentro-x-dawki/blob/main/src/services/integrations/partnerGateway.ts): `src/services/integrations/partnerGateway.ts`

### Other components

- **Patient**
- **Clinician**

## Connections

- Patient → Patient journeys: uses
- Patient journeys → Assistant route: sends chat
- Assistant route → Chat safety: screens messages (evidence: `src/app/api/chat/route.ts`)
- Assistant route → Session identity: checks identity (evidence: `src/app/api/chat/route.ts`)
- Assistant route → Dawki client: requests assistant (evidence: `src/app/api/chat/route.ts`)
- Assistant route → Scheduling service: books selected slot
- Patient journeys → Fever intake route: submits intake
- Fever intake route → Session identity: checks identity (evidence: `src/app/api/dawki/fever/route.ts`)
- Fever intake route → Consent records: records consent (evidence: `src/app/api/dawki/fever/route.ts`)
- Fever intake route → Dawki client: evaluates intake (evidence: `src/app/api/dawki/fever/route.ts`)
- Dawki client → Dawki workflow API: calls workflow API (evidence: `src/services/dawkiService.ts`)
- Dawki workflow API → Fever rules: evaluates rules (evidence: `dawki-service/src/dawki/app.py`)
- Fever rules → Research ML: may consult shadow signal
- Fever intake route → Journey state: persists journey (evidence: `src/app/api/dawki/fever/route.ts`)
- Fever intake route → Clinical review: routes escalation
- Fever intake route → Scheduling service: routes routine care
- Clinician → Clinical review: resolves reviews
- Clinician → Telehealth verification: updates verification
- Patient journeys → Health documents: uploads records (evidence: `src/app/api/health-records/route.ts`)
- Patient journeys → Caregiver access: manages invitations (evidence: `src/app/api/guardians/route.ts`)
- Session identity → Account storage: loads account (evidence: `src/services/auth/currentUser.ts`)
- Fever intake route → Java service client: requests workflow actions (evidence: `src/app/api/dawki/fever/route.ts`)
- Java service client → Scheduling service: calls scheduling API (evidence: `src/services/javaMicroservice.ts`)
- Java service client → Audit service: calls audit API
- Clinical review → Audit service: records review events (evidence: `java-service/src/main/java/com/zentro/scheduling/review/ClinicalReviewService.java`)
- Scheduling service → Audit service: records appointment events (evidence: `java-service/src/main/java/com/zentro/scheduling/appointments/AppointmentService.java`)
- Fever intake route → Operational events: records operational events (evidence: `src/app/api/dawki/fever/route.ts`)
- Operations intelligence → Operational events: analyzes events
- Patient journeys → FHIR interfaces: uses care interfaces
- FHIR interfaces → Partner gateway: adapts partner exchange
