# arpita-jain840/medikiosk architecture

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

- Interactive diagram: https://gitdiagram.com/arpita-jain840/medikiosk
- Repository: https://github.com/arpita-jain840/medikiosk

## Overview

MediKiosk is a healthcare kiosk and doctor-cockpit application. Patients use the patient app for intake, appointments, records, and AI assistance; clinicians use a separate workflow for patient records, consultations, reports, and prescriptions. The server provides authentication, clinical APIs, AI-backed intake and synthesis, notifications, and live queue updates. Connections reflect excerpts and SOURCE INDEX references; some frontend-to-endpoint wiring is not shown, so those links are omitted rather than inferred.

Main entry points: [`server/main.py`](https://github.com/arpita-jain840/medikiosk/blob/main/server/main.py) (FastAPI application), [`server/routers/clinical_routes.py`](https://github.com/arpita-jain840/medikiosk/blob/main/server/routers/clinical_routes.py) (Clinical endpoints), [`client/src/user/PatientApp.tsx`](https://github.com/arpita-jain840/medikiosk/blob/main/client/src/user/PatientApp.tsx) (Patient app), [`client/src/doctor/pages`](https://github.com/arpita-jain840/medikiosk/tree/main/client/src/doctor/pages) (Doctor workflows)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_patient["Patient experience"]
  node_patient_app["Patient app<br/>[PatientApp.tsx]"]
  node_patient_screens["Patient screens"]
  node_health_report["Health report"]
end

subgraph group_doctor["Doctor cockpit"]
  node_doctor_pages["Doctor workflows"]
  node_prescriptions["Prescription workflow"]
end

subgraph group_server["Server API"]
  node_server_app["FastAPI application<br/>[main.py]"]
  node_auth["Authentication<br/>[auth_routes.py]"]
  node_ingest["Intake endpoints<br/>[ingest_routes.py]"]
  node_clinical_routes["Clinical endpoints<br/>[clinical_routes.py]"]
  node_access["Doctor access<br/>[Accestodoc.py]"]
  node_bhashini["Language routes<br/>[bhashini_routes.py]"]
  node_notifications["Notifications"]
  node_websocket["Live queue"]
end

subgraph group_clinical["Clinical services"]
  node_ai["AI services<br/>[ai_service.py]"]
  node_storage["Document storage<br/>[storage_service.py]"]
  node_fhir["FHIR integration<br/>[fhir_service.py]"]
  node_notification_service["Notification service"]
end

subgraph group_data["Persistence"]
  node_models["Clinical models<br/>[models.py]"]
  node_database[("Database sessions<br/>[database.py]")]
  node_seed["Database initialization<br/>[init_db.py]"]
end

node_patient_actor(("Patient"))
node_doctor_actor(("Doctor"))
node_app["Role routing<br/>[App.tsx]"]
node_api_config["API configuration<br/>[api.ts]"]

node_patient_actor -->|"opens app"| node_app
node_doctor_actor -->|"opens app"| node_app
node_app -->|"routes patient"| node_patient_app
node_app -->|"routes clinician"| node_doctor_pages
node_patient_app -->|"renders screens"| node_patient_screens
node_patient_app -->|"renders report"| node_health_report
node_doctor_pages -->|"uses report"| node_health_report
node_doctor_pages -->|"routes prescriptions"| node_prescriptions
node_patient_app -->|"uses API config"| node_api_config
node_doctor_pages -->|"uses API config"| node_api_config
node_server_app -->|"registers route"| node_auth
node_server_app -->|"registers route"| node_ingest
node_server_app -->|"registers route"| node_clinical_routes
node_server_app -->|"registers route"| node_access
node_server_app -->|"registers route"| node_bhashini
node_server_app -->|"registers route"| node_notifications
node_server_app -->|"registers route"| node_websocket
node_server_app -->|"initializes database"| node_seed
node_ingest -->|"calls processing"| node_ai
node_clinical_routes -->|"calls synthesis"| node_ai
node_clinical_routes -->|"saves uploads"| node_storage
node_clinical_routes -->|"uses integration"| node_fhir
node_notifications -->|"calls service"| node_notification_service
node_auth -->|"queries sessions"| node_database
node_auth -->|"queries users"| node_models
node_clinical_routes -->|"uses sessions"| node_database
node_clinical_routes -->|"queries records"| node_models
node_models -->|"uses ORM base"| node_database
node_seed -->|"creates tables"| node_database
node_seed -->|"seeds records"| node_models

click node_app "https://github.com/arpita-jain840/medikiosk/blob/main/client/src/App.tsx"
click node_patient_app "https://github.com/arpita-jain840/medikiosk/blob/main/client/src/user/PatientApp.tsx"
click node_patient_screens "https://github.com/arpita-jain840/medikiosk/tree/main/client/src/user/screens"
click node_health_report "https://github.com/arpita-jain840/medikiosk/blob/main/client/src/components/PatientHealthReport.tsx"
click node_doctor_pages "https://github.com/arpita-jain840/medikiosk/tree/main/client/src/doctor/pages"
click node_prescriptions "https://github.com/arpita-jain840/medikiosk/blob/main/client/src/doctor/pages/PrescriptionPage.tsx"
click node_api_config "https://github.com/arpita-jain840/medikiosk/blob/main/client/src/config/api.ts"
click node_server_app "https://github.com/arpita-jain840/medikiosk/blob/main/server/main.py"
click node_auth "https://github.com/arpita-jain840/medikiosk/blob/main/server/routers/auth_routes.py"
click node_ingest "https://github.com/arpita-jain840/medikiosk/blob/main/server/routers/ingest_routes.py"
click node_clinical_routes "https://github.com/arpita-jain840/medikiosk/blob/main/server/routers/clinical_routes.py"
click node_access "https://github.com/arpita-jain840/medikiosk/blob/main/server/routers/Accestodoc.py"
click node_bhashini "https://github.com/arpita-jain840/medikiosk/blob/main/server/routers/bhashini_routes.py"
click node_notifications "https://github.com/arpita-jain840/medikiosk/blob/main/server/routers/notification_routes.py"
click node_websocket "https://github.com/arpita-jain840/medikiosk/blob/main/server/routers/websocket_routes.py"
click node_ai "https://github.com/arpita-jain840/medikiosk/blob/main/server/services/ai_service.py"
click node_storage "https://github.com/arpita-jain840/medikiosk/blob/main/server/services/storage_service.py"
click node_fhir "https://github.com/arpita-jain840/medikiosk/blob/main/server/services/fhir_service.py"
click node_notification_service "https://github.com/arpita-jain840/medikiosk/blob/main/server/services/notification_service.py"
click node_models "https://github.com/arpita-jain840/medikiosk/blob/main/server/models.py"
click node_database "https://github.com/arpita-jain840/medikiosk/blob/main/server/database.py"
click node_seed "https://github.com/arpita-jain840/medikiosk/blob/main/server/init_db.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_patient_app,node_patient_screens,node_health_report toneBlue
class node_doctor_pages,node_prescriptions toneAmber
class node_server_app,node_auth,node_ingest,node_clinical_routes,node_access,node_bhashini,node_notifications,node_websocket,node_api_config toneMint
class node_ai,node_storage,node_fhir,node_notification_service toneRose
class node_models,node_database,node_seed,node_patient_actor,node_doctor_actor toneIndigo
class node_app toneTeal
```

## Components

### Patient experience

- [Patient app](https://github.com/arpita-jain840/medikiosk/blob/main/client/src/user/PatientApp.tsx): `client/src/user/PatientApp.tsx`
- [Patient screens](https://github.com/arpita-jain840/medikiosk/tree/main/client/src/user/screens): `client/src/user/screens`
- [Health report](https://github.com/arpita-jain840/medikiosk/blob/main/client/src/components/PatientHealthReport.tsx): `client/src/components/PatientHealthReport.tsx`

### Doctor cockpit

- [Doctor workflows](https://github.com/arpita-jain840/medikiosk/tree/main/client/src/doctor/pages): `client/src/doctor/pages`
- [Prescription workflow](https://github.com/arpita-jain840/medikiosk/blob/main/client/src/doctor/pages/PrescriptionPage.tsx): `client/src/doctor/pages/PrescriptionPage.tsx`

### Server API

- [FastAPI application](https://github.com/arpita-jain840/medikiosk/blob/main/server/main.py): `server/main.py`
- [Authentication](https://github.com/arpita-jain840/medikiosk/blob/main/server/routers/auth_routes.py): `server/routers/auth_routes.py`
- [Intake endpoints](https://github.com/arpita-jain840/medikiosk/blob/main/server/routers/ingest_routes.py): `server/routers/ingest_routes.py`
- [Clinical endpoints](https://github.com/arpita-jain840/medikiosk/blob/main/server/routers/clinical_routes.py): `server/routers/clinical_routes.py`
- [Doctor access](https://github.com/arpita-jain840/medikiosk/blob/main/server/routers/Accestodoc.py): `server/routers/Accestodoc.py`
- [Language routes](https://github.com/arpita-jain840/medikiosk/blob/main/server/routers/bhashini_routes.py): `server/routers/bhashini_routes.py`
- [Notifications](https://github.com/arpita-jain840/medikiosk/blob/main/server/routers/notification_routes.py): `server/routers/notification_routes.py`
- [Live queue](https://github.com/arpita-jain840/medikiosk/blob/main/server/routers/websocket_routes.py): `server/routers/websocket_routes.py`

### Clinical services

- [AI services](https://github.com/arpita-jain840/medikiosk/blob/main/server/services/ai_service.py): `server/services/ai_service.py`
- [Document storage](https://github.com/arpita-jain840/medikiosk/blob/main/server/services/storage_service.py): `server/services/storage_service.py`
- [FHIR integration](https://github.com/arpita-jain840/medikiosk/blob/main/server/services/fhir_service.py): `server/services/fhir_service.py`
- [Notification service](https://github.com/arpita-jain840/medikiosk/blob/main/server/services/notification_service.py): `server/services/notification_service.py`

### Persistence

- [Clinical models](https://github.com/arpita-jain840/medikiosk/blob/main/server/models.py): `server/models.py`
- [Database sessions](https://github.com/arpita-jain840/medikiosk/blob/main/server/database.py): `server/database.py`
- [Database initialization](https://github.com/arpita-jain840/medikiosk/blob/main/server/init_db.py): `server/init_db.py`

### Other components

- **Patient**
- **Doctor**
- [Role routing](https://github.com/arpita-jain840/medikiosk/blob/main/client/src/App.tsx): `client/src/App.tsx`
- [API configuration](https://github.com/arpita-jain840/medikiosk/blob/main/client/src/config/api.ts): `client/src/config/api.ts`

## Connections

- Patient → Role routing: opens app (evidence: `client/src/App.tsx`)
- Doctor → Role routing: opens app (evidence: `client/src/App.tsx`)
- Role routing → Patient app: routes patient (evidence: `client/src/App.tsx`)
- Role routing → Doctor workflows: routes clinician (evidence: `client/src/App.tsx`)
- Patient app → Patient screens: renders screens (evidence: `client/src/user/PatientApp.tsx`)
- Patient app → Health report: renders report (evidence: `client/src/user/PatientApp.tsx`)
- Doctor workflows → Health report: uses report (evidence: `client/src/doctor/pages/DoctorDashboard.tsx`)
- Doctor workflows → Prescription workflow: routes prescriptions (evidence: `client/src/App.tsx`)
- Patient app → API configuration: uses API config (evidence: `client/src/user/PatientApp.tsx`)
- Doctor workflows → API configuration: uses API config (evidence: `client/src/doctor/pages/PatientDetail.tsx`)
- FastAPI application → Authentication: registers route (evidence: `server/main.py`)
- FastAPI application → Intake endpoints: registers route (evidence: `server/main.py`)
- FastAPI application → Clinical endpoints: registers route (evidence: `server/main.py`)
- FastAPI application → Doctor access: registers route (evidence: `server/main.py`)
- FastAPI application → Language routes: registers route (evidence: `server/main.py`)
- FastAPI application → Notifications: registers route (evidence: `server/main.py`)
- FastAPI application → Live queue: registers route (evidence: `server/main.py`)
- FastAPI application → Database initialization: initializes database (evidence: `server/main.py`)
- Intake endpoints → AI services: calls processing (evidence: `server/routers/ingest_routes.py`)
- Clinical endpoints → AI services: calls synthesis (evidence: `server/routers/clinical_routes.py`)
- Clinical endpoints → Document storage: saves uploads (evidence: `server/routers/clinical_routes.py`)
- Clinical endpoints → FHIR integration: uses integration (evidence: `server/routers/clinical_routes.py`)
- Notifications → Notification service: calls service (evidence: `server/routers/notification_routes.py`)
- Authentication → Database sessions: queries sessions (evidence: `server/routers/auth_routes.py`)
- Authentication → Clinical models: queries users (evidence: `server/routers/auth_routes.py`)
- Clinical endpoints → Database sessions: uses sessions (evidence: `server/routers/clinical_routes.py`)
- Clinical endpoints → Clinical models: queries records (evidence: `server/routers/clinical_routes.py`)
- Clinical models → Database sessions: uses ORM base (evidence: `server/models.py`)
- Database initialization → Database sessions: creates tables (evidence: `server/init_db.py`)
- Database initialization → Clinical models: seeds records (evidence: `server/init_db.py`)
