# suhaan-cyber/medikiosk architecture

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

- Interactive diagram: https://gitdiagram.com/suhaan-cyber/medikiosk
- Repository: https://github.com/suhaan-cyber/medikiosk

## Overview

MEDIKOISK is a patient-and-doctor health platform. The main workflow is browser sign-in, role-filtered dashboard loading, then health activities such as booking appointments, paying, prescribing, and managing records; the backend persists those activities in SQLite. The README documents client-side AI and PDF/payment features, while the sampled source confirms the API bridge, authentication, data models, and database layer. Feature route details are grouped under the monolithic backend entry point; unsampled frontend behavior is represented only where documented.

Main entry points: [`Backend/main.py`](https://github.com/suhaan-cyber/medikiosk/blob/main/Backend/main.py) (FastAPI routes), [`Frontend/index.html`](https://github.com/suhaan-cyber/medikiosk/blob/main/Frontend/index.html) (Health dashboard), [`Frontend/api.js`](https://github.com/suhaan-cyber/medikiosk/blob/main/Frontend/api.js) (API bridge), [`Backend/models.py`](https://github.com/suhaan-cyber/medikiosk/blob/main/Backend/models.py) (Health records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Browser app"]
  node_spa["Health dashboard<br/>[index.html]"]
  node_client_ai["AI assistant<br/>[index.html]"]
  node_client_docs["PDF and UPI tools<br/>[index.html]"]
  node_pwa_cache[("Offline asset cache<br/>[service-worker.js]")]
end

subgraph group_identity["Identity and API"]
  node_api_bridge["API bridge<br/>[api.js]"]
  node_auth["JWT and passwords<br/>[auth.py]"]
  node_api_routes["FastAPI routes<br/>[main.py]"]
  node_validation["Auth schemas<br/>[schemas.py]"]
end

subgraph group_care["Care workflows"]
  node_appointments["Appointments<br/>[main.py]"]
  node_prescriptions["E-prescriptions<br/>[main.py]"]
  node_payments["UPI payments<br/>[main.py]"]
end

subgraph group_records["Health data"]
  node_reports["Health reports<br/>[main.py]"]
  node_vitals["Vitals tracking<br/>[main.py]"]
  node_profile_requests["Profile requests<br/>[main.py]"]
  node_health_data["Health records<br/>[models.py]"]
  node_db_session["ORM sessions<br/>[database.py]"]
  node_sqlite[("SQLite store<br/>[medikoisk.db]")]
end

node_patient_doctor(("Patient or doctor"))

node_patient_doctor -->|"uses"| node_spa
node_spa -->|"uses"| node_api_bridge
node_spa -->|"uses"| node_client_ai
node_spa -->|"generates"| node_client_docs
node_api_bridge -->|"calls"| node_api_routes
node_api_bridge -->|"sends bearer token"| node_auth
node_api_routes -->|"uses"| node_auth
node_api_routes -->|"validates auth"| node_validation
node_api_routes -->|"handles"| node_appointments
node_api_routes -->|"handles"| node_prescriptions
node_api_routes -->|"handles"| node_payments
node_api_routes -->|"handles"| node_reports
node_api_routes -->|"handles"| node_vitals
node_api_routes -->|"handles"| node_profile_requests
node_api_routes -->|"queries and updates"| node_health_data
node_health_data -->|"uses base"| node_db_session
node_db_session -->|"persists data"| node_sqlite
node_spa -->|"assets cached by"| node_pwa_cache

click node_spa "https://github.com/suhaan-cyber/medikiosk/blob/main/Frontend/index.html"
click node_client_ai "https://github.com/suhaan-cyber/medikiosk/blob/main/Frontend/index.html"
click node_client_docs "https://github.com/suhaan-cyber/medikiosk/blob/main/Frontend/index.html"
click node_pwa_cache "https://github.com/suhaan-cyber/medikiosk/blob/main/Frontend/service-worker.js"
click node_api_bridge "https://github.com/suhaan-cyber/medikiosk/blob/main/Frontend/api.js"
click node_auth "https://github.com/suhaan-cyber/medikiosk/blob/main/Backend/auth.py"
click node_api_routes "https://github.com/suhaan-cyber/medikiosk/blob/main/Backend/main.py"
click node_validation "https://github.com/suhaan-cyber/medikiosk/blob/main/Backend/schemas.py"
click node_appointments "https://github.com/suhaan-cyber/medikiosk/blob/main/Backend/main.py"
click node_prescriptions "https://github.com/suhaan-cyber/medikiosk/blob/main/Backend/main.py"
click node_payments "https://github.com/suhaan-cyber/medikiosk/blob/main/Backend/main.py"
click node_reports "https://github.com/suhaan-cyber/medikiosk/blob/main/Backend/main.py"
click node_vitals "https://github.com/suhaan-cyber/medikiosk/blob/main/Backend/main.py"
click node_profile_requests "https://github.com/suhaan-cyber/medikiosk/blob/main/Backend/main.py"
click node_health_data "https://github.com/suhaan-cyber/medikiosk/blob/main/Backend/models.py"
click node_db_session "https://github.com/suhaan-cyber/medikiosk/blob/main/Backend/database.py"
click node_sqlite "https://github.com/suhaan-cyber/medikiosk/blob/main/Backend/medikoisk.db"

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_spa,node_client_ai,node_client_docs,node_pwa_cache toneBlue
class node_api_bridge,node_auth,node_api_routes,node_validation toneAmber
class node_appointments,node_prescriptions,node_payments toneMint
class node_reports,node_vitals,node_profile_requests,node_health_data,node_db_session,node_sqlite toneRose
class node_patient_doctor toneIndigo
```

## Components

### Browser app

- [Health dashboard](https://github.com/suhaan-cyber/medikiosk/blob/main/Frontend/index.html): `Frontend/index.html`
- [AI assistant](https://github.com/suhaan-cyber/medikiosk/blob/main/Frontend/index.html): `Frontend/index.html`
- [PDF and UPI tools](https://github.com/suhaan-cyber/medikiosk/blob/main/Frontend/index.html): `Frontend/index.html`
- [Offline asset cache](https://github.com/suhaan-cyber/medikiosk/blob/main/Frontend/service-worker.js): `Frontend/service-worker.js`

### Identity and API

- [API bridge](https://github.com/suhaan-cyber/medikiosk/blob/main/Frontend/api.js): `Frontend/api.js`
- [JWT and passwords](https://github.com/suhaan-cyber/medikiosk/blob/main/Backend/auth.py): `Backend/auth.py`
- [FastAPI routes](https://github.com/suhaan-cyber/medikiosk/blob/main/Backend/main.py): `Backend/main.py`
- [Auth schemas](https://github.com/suhaan-cyber/medikiosk/blob/main/Backend/schemas.py): `Backend/schemas.py`

### Care workflows

- [Appointments](https://github.com/suhaan-cyber/medikiosk/blob/main/Backend/main.py): `Backend/main.py`
- [E-prescriptions](https://github.com/suhaan-cyber/medikiosk/blob/main/Backend/main.py): `Backend/main.py`
- [UPI payments](https://github.com/suhaan-cyber/medikiosk/blob/main/Backend/main.py): `Backend/main.py`

### Health data

- [Health reports](https://github.com/suhaan-cyber/medikiosk/blob/main/Backend/main.py): `Backend/main.py`
- [Vitals tracking](https://github.com/suhaan-cyber/medikiosk/blob/main/Backend/main.py): `Backend/main.py`
- [Profile requests](https://github.com/suhaan-cyber/medikiosk/blob/main/Backend/main.py): `Backend/main.py`
- [Health records](https://github.com/suhaan-cyber/medikiosk/blob/main/Backend/models.py): `Backend/models.py`
- [ORM sessions](https://github.com/suhaan-cyber/medikiosk/blob/main/Backend/database.py): `Backend/database.py`
- [SQLite store](https://github.com/suhaan-cyber/medikiosk/blob/main/Backend/medikoisk.db): `Backend/medikoisk.db`

### Other components

- **Patient or doctor**

## Connections

- Patient or doctor → Health dashboard: uses (evidence: `README.md`)
- Health dashboard → API bridge: uses (evidence: `README.md`)
- Health dashboard → AI assistant: uses (evidence: `README.md`)
- Health dashboard → PDF and UPI tools: generates (evidence: `README.md`)
- API bridge → FastAPI routes: calls (evidence: `README.md`)
- API bridge → JWT and passwords: sends bearer token (evidence: `Frontend/api.js`)
- FastAPI routes → JWT and passwords: uses (evidence: `Backend/main.py`)
- FastAPI routes → Auth schemas: validates auth (evidence: `Backend/main.py`)
- FastAPI routes → Appointments: handles (evidence: `README.md`)
- FastAPI routes → E-prescriptions: handles (evidence: `README.md`)
- FastAPI routes → UPI payments: handles (evidence: `README.md`)
- FastAPI routes → Health reports: handles (evidence: `README.md`)
- FastAPI routes → Vitals tracking: handles (evidence: `README.md`)
- FastAPI routes → Profile requests: handles (evidence: `README.md`)
- FastAPI routes → Health records: queries and updates (evidence: `Backend/main.py`)
- Health records → ORM sessions: uses base (evidence: `Backend/models.py`)
- ORM sessions → SQLite store: persists data (evidence: `README.md`)
- Health dashboard → Offline asset cache: assets cached by (evidence: `Frontend/service-worker.js`)
