# harshvardhanpandit447-ux/real-time-bed-availablity-managment-system- architecture

> Architecture diagram of the GitHub repository harshvardhanpandit447-ux/real-time-bed-availablity-managment-system-, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/harshvardhanpandit447-ux/real-time-bed-availablity-managment-system-
- Repository: https://github.com/harshvardhanpandit447-ux/real-time-bed-availablity-managment-system-

## Overview

Mediloc is a hospital-discovery and bed-management application with a citizen portal and a hospital-staff portal. Citizens browse and search facilities, inspect availability and location, and can register or sign in; staff sign in to manage beds through admission, discharge, and cleaning, with QR workflows and operational records. The main runtime is concentrated in `frontend/app.js` and `app.py`; the backend also owns authentication, hospital-scoped authorization, and persistence. The README documents additional capabilities whose implementation details are not shown in the excerpts, so links to those are limited to documented relationships.

Main entry points: [`frontend/app.js`](https://github.com/harshvardhanpandit447-ux/real-time-bed-availablity-managment-system-/blob/main/frontend/app.js) (Portal interactions), [`app.py`](https://github.com/harshvardhanpandit447-ux/real-time-bed-availablity-managment-system-/blob/main/app.py) (Application database), [`frontend/index.html`](https://github.com/harshvardhanpandit447-ux/real-time-bed-availablity-managment-system-/blob/main/frontend/index.html) (Web interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web experience"]
  node_web["Web interface<br/>[index.html]"]
  node_frontend["Portal interactions<br/>[app.js]"]
end

subgraph group_identity["Identity and access"]
  node_auth["Portal authentication<br/>[app.py]"]
  node_access["Role and hospital access<br/>[app.py]"]
end

subgraph group_discovery["Hospital discovery"]
  node_hospital_search["Hospital search<br/>[app.py]"]
  node_hospital_details["Hospital details<br/>[app.py]"]
  node_bed_directory["Public bed availability<br/>[app.py]"]
  node_location_map["Map and locality<br/>[app.js]"]
end

subgraph group_operations["Bed operations"]
  node_bed_management["Bed lifecycle<br/>[app.py]"]
  node_cleaning_queue["Cleaning queue<br/>[app.py]"]
  node_qr_workflow["Bed QR workflow<br/>[app.py]"]
  node_audit_records["Audit records<br/>[app.py]"]
  node_staff_dashboard["Staff dashboard<br/>[app.js]"]
  node_database[("Application database<br/>[app.py]")]
end

node_citizen(("Citizen"))
node_staff(("Hospital staff"))
node_leaflet["Leaflet mapping"]

node_citizen -->|"opens portal"| node_web
node_staff -->|"opens portal"| node_web
node_web -->|"loads interface"| node_frontend
node_frontend -->|"submits credentials"| node_auth
node_auth -->|"checks session"| node_access
node_frontend -->|"requests hospitals"| node_hospital_search
node_frontend -->|"requests details"| node_hospital_details
node_frontend -->|"requests beds"| node_bed_directory
node_frontend -->|"renders locations"| node_location_map
node_location_map -.->|"uses mapping"| node_leaflet
node_frontend -->|"loads dashboard"| node_staff_dashboard
node_staff_dashboard -->|"requests bed actions"| node_bed_management
node_staff_dashboard -.->|"loads queue"| node_cleaning_queue
node_staff_dashboard -->|"requests QR"| node_qr_workflow
node_bed_management -->|"checks facility access"| node_access
node_bed_management -->|"queues discharged beds"| node_cleaning_queue
node_bed_management -->|"records changes"| node_audit_records
node_auth -->|"reads accounts"| node_database
node_hospital_search -.->|"reads hospitals"| node_database
node_hospital_details -->|"reads facility data"| node_database
node_bed_directory -->|"reads beds"| node_database
node_bed_management -->|"persists bed state"| node_database
node_cleaning_queue -->|"reads records"| node_database
node_audit_records -->|"persists logs"| node_database

click node_web "https://github.com/harshvardhanpandit447-ux/real-time-bed-availablity-managment-system-/blob/main/frontend/index.html"
click node_frontend "https://github.com/harshvardhanpandit447-ux/real-time-bed-availablity-managment-system-/blob/main/frontend/app.js"
click node_auth "https://github.com/harshvardhanpandit447-ux/real-time-bed-availablity-managment-system-/blob/main/app.py"
click node_access "https://github.com/harshvardhanpandit447-ux/real-time-bed-availablity-managment-system-/blob/main/app.py"
click node_hospital_search "https://github.com/harshvardhanpandit447-ux/real-time-bed-availablity-managment-system-/blob/main/app.py"
click node_hospital_details "https://github.com/harshvardhanpandit447-ux/real-time-bed-availablity-managment-system-/blob/main/app.py"
click node_bed_directory "https://github.com/harshvardhanpandit447-ux/real-time-bed-availablity-managment-system-/blob/main/app.py"
click node_location_map "https://github.com/harshvardhanpandit447-ux/real-time-bed-availablity-managment-system-/blob/main/frontend/app.js"
click node_bed_management "https://github.com/harshvardhanpandit447-ux/real-time-bed-availablity-managment-system-/blob/main/app.py"
click node_cleaning_queue "https://github.com/harshvardhanpandit447-ux/real-time-bed-availablity-managment-system-/blob/main/app.py"
click node_qr_workflow "https://github.com/harshvardhanpandit447-ux/real-time-bed-availablity-managment-system-/blob/main/app.py"
click node_audit_records "https://github.com/harshvardhanpandit447-ux/real-time-bed-availablity-managment-system-/blob/main/app.py"
click node_staff_dashboard "https://github.com/harshvardhanpandit447-ux/real-time-bed-availablity-managment-system-/blob/main/frontend/app.js"
click node_database "https://github.com/harshvardhanpandit447-ux/real-time-bed-availablity-managment-system-/blob/main/app.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_web,node_frontend toneBlue
class node_auth,node_access toneAmber
class node_hospital_search,node_hospital_details,node_bed_directory,node_location_map toneMint
class node_bed_management,node_cleaning_queue,node_qr_workflow,node_audit_records,node_staff_dashboard,node_database toneRose
class node_citizen,node_staff,node_leaflet toneIndigo
```

## Components

### Web experience

- [Web interface](https://github.com/harshvardhanpandit447-ux/real-time-bed-availablity-managment-system-/blob/main/frontend/index.html): `frontend/index.html`
- [Portal interactions](https://github.com/harshvardhanpandit447-ux/real-time-bed-availablity-managment-system-/blob/main/frontend/app.js): `frontend/app.js`

### Identity and access

- [Portal authentication](https://github.com/harshvardhanpandit447-ux/real-time-bed-availablity-managment-system-/blob/main/app.py): `app.py`
- [Role and hospital access](https://github.com/harshvardhanpandit447-ux/real-time-bed-availablity-managment-system-/blob/main/app.py): `app.py`

### Hospital discovery

- [Hospital search](https://github.com/harshvardhanpandit447-ux/real-time-bed-availablity-managment-system-/blob/main/app.py): `app.py`
- [Hospital details](https://github.com/harshvardhanpandit447-ux/real-time-bed-availablity-managment-system-/blob/main/app.py): `app.py`
- [Public bed availability](https://github.com/harshvardhanpandit447-ux/real-time-bed-availablity-managment-system-/blob/main/app.py): `app.py`
- [Map and locality](https://github.com/harshvardhanpandit447-ux/real-time-bed-availablity-managment-system-/blob/main/frontend/app.js): `frontend/app.js`

### Bed operations

- [Bed lifecycle](https://github.com/harshvardhanpandit447-ux/real-time-bed-availablity-managment-system-/blob/main/app.py): `app.py`
- [Cleaning queue](https://github.com/harshvardhanpandit447-ux/real-time-bed-availablity-managment-system-/blob/main/app.py): `app.py`
- [Bed QR workflow](https://github.com/harshvardhanpandit447-ux/real-time-bed-availablity-managment-system-/blob/main/app.py): `app.py`
- [Audit records](https://github.com/harshvardhanpandit447-ux/real-time-bed-availablity-managment-system-/blob/main/app.py): `app.py`
- [Staff dashboard](https://github.com/harshvardhanpandit447-ux/real-time-bed-availablity-managment-system-/blob/main/frontend/app.js): `frontend/app.js`
- [Application database](https://github.com/harshvardhanpandit447-ux/real-time-bed-availablity-managment-system-/blob/main/app.py): `app.py`

### Other components

- **Citizen**
- **Hospital staff**
- **Leaflet mapping**

## Connections

- Citizen → Web interface: opens portal (evidence: `README.md`)
- Hospital staff → Web interface: opens portal (evidence: `README.md`)
- Web interface → Portal interactions: loads interface (evidence: `frontend/app.js`)
- Portal interactions → Portal authentication: submits credentials (evidence: `frontend/app.js`)
- Portal authentication → Role and hospital access: checks session (evidence: `app.py`)
- Portal interactions → Hospital search: requests hospitals (evidence: `frontend/app.js`)
- Portal interactions → Hospital details: requests details (evidence: `frontend/app.js`)
- Portal interactions → Public bed availability: requests beds (evidence: `README.md`)
- Portal interactions → Map and locality: renders locations (evidence: `frontend/app.js`)
- Map and locality → Leaflet mapping: uses mapping (evidence: `README.md`)
- Portal interactions → Staff dashboard: loads dashboard (evidence: `frontend/app.js`)
- Staff dashboard → Bed lifecycle: requests bed actions (evidence: `frontend/app.js`)
- Staff dashboard → Cleaning queue: loads queue (evidence: `README.md`)
- Staff dashboard → Bed QR workflow: requests QR (evidence: `frontend/app.js`)
- Bed lifecycle → Role and hospital access: checks facility access (evidence: `README.md`)
- Bed lifecycle → Cleaning queue: queues discharged beds (evidence: `README.md`)
- Bed lifecycle → Audit records: records changes (evidence: `app.py`)
- Portal authentication → Application database: reads accounts (evidence: `app.py`)
- Hospital search → Application database: reads hospitals (evidence: `app.py`)
- Hospital details → Application database: reads facility data (evidence: `app.py`)
- Public bed availability → Application database: reads beds (evidence: `app.py`)
- Bed lifecycle → Application database: persists bed state (evidence: `app.py`)
- Cleaning queue → Application database: reads records (evidence: `app.py`)
- Audit records → Application database: persists logs (evidence: `app.py`)
