# shashwat-009/medisetu architecture

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

- Interactive diagram: https://gitdiagram.com/shashwat-009/medisetu
- Repository: https://github.com/shashwat-009/medisetu

## Overview

MediKiosk is a clinical-intake kiosk paired with a physician review interface. Patients identify themselves, consent, complete an adaptive interview and submit medical documents; the backend processes consultation data into a clinical summary for physician review and editing. The tree and excerpts establish the application entry points, session handling, OCR and summary responsibilities, but do not expose every API handler’s internal wiring, so some subsystem links are intentionally omitted.

Main entry points: [`backend/app/main.py`](https://github.com/shashwat-009/medisetu/blob/main/backend/app/main.py) (API application), [`backend/app/services/summary_service.py`](https://github.com/shashwat-009/medisetu/blob/main/backend/app/services/summary_service.py) (Clinical summary), [`frontend/src/App.jsx`](https://github.com/shashwat-009/medisetu/blob/main/frontend/src/App.jsx) (Kiosk app), [`frontend/src/pages/patient`](https://github.com/shashwat-009/medisetu/tree/main/frontend/src/pages/patient) (Patient workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_patient["Patient kiosk"]
  node_kiosk["Kiosk app<br/>[App.jsx]"]
  node_patient_flow["Patient workflow"]
  node_kiosk_ui["Kiosk interface"]
  node_patient_services["Patient services"]
end

subgraph group_backend["Backend application"]
  node_api["API application<br/>[main.py]"]
  node_patient_api["Patient and session APIs<br/>[sessions.py]"]
  node_conversation_api["Conversation APIs<br/>[conversations.py]"]
  node_document_api["Document APIs<br/>[documents.py]"]
  node_summary_api["Summary APIs<br/>[summary.py]"]
  node_doctor_api["Doctor APIs<br/>[doctors.py]"]
  node_database[("Application database<br/>[database.py]")]
  node_storage_service["Document storage service<br/>[storage_service.py]"]
end

subgraph group_clinical["Clinical processing"]
  node_conversation["Adaptive interview"]
  node_asr["Speech recognition"]
  node_ocr["Document OCR pipeline<br/>[pipeline.py]"]
  node_ocr_service["OCR service<br/>[ocr_service.py]"]
  node_timeline["Medical timeline"]
  node_summary_service["Clinical summary<br/>[summary_service.py]"]
  node_summary_ai["Summary generation"]
  node_tts["Speech synthesis"]
end

subgraph group_doctor["Physician review"]
  node_doctor_ui["Doctor portal"]
end

node_patient(("Patient"))
node_doctor_user(("Doctor"))
node_supabase[("Supabase storage")]

node_patient -->|"uses"| node_kiosk
node_kiosk -->|"routes to"| node_patient_flow
node_kiosk -->|"renders"| node_kiosk_ui
node_patient_flow -->|"requests"| node_patient_services
node_patient_services -->|"calls"| node_patient_api
node_doctor_user -->|"uses"| node_doctor_ui
node_doctor_ui -->|"reviews"| node_doctor_api
node_doctor_ui -->|"updates"| node_summary_api
node_api -->|"registers"| node_patient_api
node_api -->|"registers"| node_conversation_api
node_api -->|"registers"| node_document_api
node_api -->|"registers"| node_summary_api
node_api -->|"registers"| node_doctor_api
node_patient_api -->|"persists"| node_database
node_conversation_api -->|"coordinates"| node_conversation
node_conversation_api -->|"uses"| node_asr
node_document_api -->|"processes documents"| node_ocr_service
node_ocr_service -->|"runs"| node_ocr
node_document_api -->|"stores files"| node_storage_service
node_storage_service -->|"uploads and downloads"| node_supabase
node_summary_api -->|"builds summary"| node_summary_service
node_summary_service -->|"reads records"| node_database
node_summary_service -->|"uses events"| node_timeline
node_summary_service -->|"merges sources"| node_summary_ai
node_patient_flow -->|"requests speech"| node_tts

click node_kiosk "https://github.com/shashwat-009/medisetu/blob/main/frontend/src/App.jsx"
click node_patient_flow "https://github.com/shashwat-009/medisetu/tree/main/frontend/src/pages/patient"
click node_kiosk_ui "https://github.com/shashwat-009/medisetu/tree/main/frontend/src/components/kiosk"
click node_patient_services "https://github.com/shashwat-009/medisetu/tree/main/frontend/src/services"
click node_doctor_ui "https://github.com/shashwat-009/medisetu/tree/main/frontend/src/pages/doctor"
click node_api "https://github.com/shashwat-009/medisetu/blob/main/backend/app/main.py"
click node_patient_api "https://github.com/shashwat-009/medisetu/blob/main/backend/app/api/sessions.py"
click node_conversation_api "https://github.com/shashwat-009/medisetu/blob/main/backend/app/api/conversations.py"
click node_document_api "https://github.com/shashwat-009/medisetu/blob/main/backend/app/api/documents.py"
click node_summary_api "https://github.com/shashwat-009/medisetu/blob/main/backend/app/api/summary.py"
click node_doctor_api "https://github.com/shashwat-009/medisetu/blob/main/backend/app/api/doctors.py"
click node_database "https://github.com/shashwat-009/medisetu/blob/main/backend/app/db/database.py"
click node_storage_service "https://github.com/shashwat-009/medisetu/blob/main/backend/app/services/storage_service.py"
click node_conversation "https://github.com/shashwat-009/medisetu/blob/main/backend/ai/conversation/dialogue_manager.py"
click node_asr "https://github.com/shashwat-009/medisetu/tree/main/backend/ai/asr"
click node_ocr "https://github.com/shashwat-009/medisetu/blob/main/backend/ai/ocr/pipeline.py"
click node_ocr_service "https://github.com/shashwat-009/medisetu/blob/main/backend/app/services/ocr_service.py"
click node_timeline "https://github.com/shashwat-009/medisetu/blob/main/backend/app/services/timeline_service.py"
click node_summary_service "https://github.com/shashwat-009/medisetu/blob/main/backend/app/services/summary_service.py"
click node_summary_ai "https://github.com/shashwat-009/medisetu/tree/main/backend/ai/summary"
click node_tts "https://github.com/shashwat-009/medisetu/tree/main/backend/ai/tts"

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_kiosk,node_patient_flow,node_kiosk_ui,node_patient_services toneBlue
class node_api,node_patient_api,node_conversation_api,node_document_api,node_summary_api,node_doctor_api,node_database,node_storage_service,node_supabase toneAmber
class node_conversation,node_asr,node_ocr,node_ocr_service,node_timeline,node_summary_service,node_summary_ai,node_tts toneMint
class node_doctor_ui toneRose
class node_patient,node_doctor_user toneIndigo
```

## Components

### Patient kiosk

- [Kiosk app](https://github.com/shashwat-009/medisetu/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Patient workflow](https://github.com/shashwat-009/medisetu/tree/main/frontend/src/pages/patient): `frontend/src/pages/patient`
- [Kiosk interface](https://github.com/shashwat-009/medisetu/tree/main/frontend/src/components/kiosk): `frontend/src/components/kiosk`
- [Patient services](https://github.com/shashwat-009/medisetu/tree/main/frontend/src/services): `frontend/src/services`

### Backend application

- [API application](https://github.com/shashwat-009/medisetu/blob/main/backend/app/main.py): `backend/app/main.py`
- [Patient and session APIs](https://github.com/shashwat-009/medisetu/blob/main/backend/app/api/sessions.py): `backend/app/api/sessions.py`
- [Conversation APIs](https://github.com/shashwat-009/medisetu/blob/main/backend/app/api/conversations.py): `backend/app/api/conversations.py`
- [Document APIs](https://github.com/shashwat-009/medisetu/blob/main/backend/app/api/documents.py): `backend/app/api/documents.py`
- [Summary APIs](https://github.com/shashwat-009/medisetu/blob/main/backend/app/api/summary.py): `backend/app/api/summary.py`
- [Doctor APIs](https://github.com/shashwat-009/medisetu/blob/main/backend/app/api/doctors.py): `backend/app/api/doctors.py`
- [Application database](https://github.com/shashwat-009/medisetu/blob/main/backend/app/db/database.py): `backend/app/db/database.py`
- [Document storage service](https://github.com/shashwat-009/medisetu/blob/main/backend/app/services/storage_service.py): `backend/app/services/storage_service.py`

### Clinical processing

- [Adaptive interview](https://github.com/shashwat-009/medisetu/blob/main/backend/ai/conversation/dialogue_manager.py): `backend/ai/conversation/dialogue_manager.py`
- [Speech recognition](https://github.com/shashwat-009/medisetu/tree/main/backend/ai/asr): `backend/ai/asr`
- [Document OCR pipeline](https://github.com/shashwat-009/medisetu/blob/main/backend/ai/ocr/pipeline.py): `backend/ai/ocr/pipeline.py`
- [OCR service](https://github.com/shashwat-009/medisetu/blob/main/backend/app/services/ocr_service.py): `backend/app/services/ocr_service.py`
- [Medical timeline](https://github.com/shashwat-009/medisetu/blob/main/backend/app/services/timeline_service.py): `backend/app/services/timeline_service.py`
- [Clinical summary](https://github.com/shashwat-009/medisetu/blob/main/backend/app/services/summary_service.py): `backend/app/services/summary_service.py`
- [Summary generation](https://github.com/shashwat-009/medisetu/tree/main/backend/ai/summary): `backend/ai/summary`
- [Speech synthesis](https://github.com/shashwat-009/medisetu/tree/main/backend/ai/tts): `backend/ai/tts`

### Physician review

- [Doctor portal](https://github.com/shashwat-009/medisetu/tree/main/frontend/src/pages/doctor): `frontend/src/pages/doctor`

### Other components

- **Patient**
- **Doctor**
- **Supabase storage**

## Connections

- Patient → Kiosk app: uses
- Kiosk app → Patient workflow: routes to
- Kiosk app → Kiosk interface: renders
- Patient workflow → Patient services: requests
- Patient services → Patient and session APIs: calls
- Doctor → Doctor portal: uses
- Doctor portal → Doctor APIs: reviews
- Doctor portal → Summary APIs: updates
- API application → Patient and session APIs: registers
- API application → Conversation APIs: registers
- API application → Document APIs: registers
- API application → Summary APIs: registers
- API application → Doctor APIs: registers
- Patient and session APIs → Application database: persists
- Conversation APIs → Adaptive interview: coordinates
- Conversation APIs → Speech recognition: uses
- Document APIs → OCR service: processes documents
- OCR service → Document OCR pipeline: runs
- Document APIs → Document storage service: stores files
- Document storage service → Supabase storage: uploads and downloads
- Summary APIs → Clinical summary: builds summary
- Clinical summary → Application database: reads records
- Clinical summary → Medical timeline: uses events
- Clinical summary → Summary generation: merges sources
- Patient workflow → Speech synthesis: requests speech
