# khan4marketing/smarthospital-asp.net-mvc architecture

> Architecture diagram of the GitHub repository khan4marketing/smarthospital-asp.net-mvc, 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/khan4marketing/smarthospital-asp.net-mvc
- Repository: https://github.com/khan4marketing/smarthospital-asp.net-mvc

## Overview

Smart Hospital is an ASP.NET Core MVC application for patient monitoring and bed allocation. The main workflow records patient vitals, evaluates critical status, and persists patient records; staff use the dashboard to review monitoring and sanitation alerts and allocate or release beds under safety rules. Separate workflows manage bed sanitation and occupancy, user registration and sign-in, and image uploads. The README documents these capabilities; the sampled source shows the controller, service, repository, and in-memory EF store wiring. Other documented routes are represented by their existing controller directories where source was not sampled.

Main entry points: [`Program.cs`](https://github.com/khan4marketing/smarthospital-asp.net-mvc/blob/main/Program.cs) (Application startup), [`Controllers/DashboardController.cs`](https://github.com/khan4marketing/smarthospital-asp.net-mvc/blob/main/Controllers/DashboardController.cs) (Monitoring dashboard), [`Data/PatientRepository.cs`](https://github.com/khan4marketing/smarthospital-asp.net-mvc/blob/main/Data/PatientRepository.cs) (Patient repository), [`Data/ApplicationDbContext.cs`](https://github.com/khan4marketing/smarthospital-asp.net-mvc/blob/main/Data/ApplicationDbContext.cs) (EF Core context)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_care["Patient care"]
  node_patientsui["Patient management"]
  node_patientrepo["Patient repository"]
  node_vitals["Vitals evaluation<br/>[VitalsService.cs]"]
  node_dashboard["Monitoring dashboard"]
  node_notifications["Notifications"]
  node_notifycontroller["Notification routes"]
end

subgraph group_beds["Bed operations"]
  node_bedsui["Bed management<br/>[BedsController.cs]"]
  node_bedrepo["Bed repository<br/>[BedRepository.cs]"]
  node_allocation["Allocation rules"]
end

subgraph group_identity["Identity"]
  node_auth["Identity authentication"]
  node_identitystore[("Identity store")]
end

subgraph group_platform["Application data"]
  node_beddata["Bed records<br/>[Bed.cs]"]
  node_patientdata["Patient records<br/>[Patient.cs]"]
  node_dbcontext[("EF Core context")]
  node_upload["Image uploads"]
  node_uploadpaths["Upload paths<br/>[UploadPaths.cs]"]
  node_uploadfiles[("Uploaded images")]
  node_otherfeatures["Public and home pages"]
  node_app["Application startup<br/>[Program.cs]"]
end

node_staff(("Hospital staff"))
node_patientuser(("Patient user"))

node_staff -->|"manage patients"| node_patientsui
node_patientsui -->|"evaluate vitals"| node_vitals
node_patientsui -->|"read and write"| node_patientrepo
node_patientrepo -->|"query and save"| node_dbcontext
node_dbcontext -->|"stores"| node_patientdata
node_staff -->|"monitor care"| node_dashboard
node_dashboard -->|"read patients"| node_patientrepo
node_dashboard -->|"read beds"| node_bedrepo
node_dashboard -->|"build alerts"| node_vitals
node_dashboard -->|"allocation actions"| node_allocation
node_dashboard -->|"publish and read"| node_notifications
node_notifycontroller -->|"manage notices"| node_notifications
node_patientuser -->|"register or sign in"| node_auth
node_auth -->|"manage identity"| node_identitystore
node_auth -->|"link patient record"| node_patientrepo
node_staff -->|"manage beds"| node_bedsui
node_bedsui -->|"read and write"| node_bedrepo
node_bedrepo -->|"query and save"| node_dbcontext
node_dbcontext -->|"stores"| node_beddata
node_allocation -->|"read and update"| node_patientrepo
node_allocation -->|"validate and occupy"| node_bedrepo
node_staff -->|"upload image"| node_upload
node_upload -->|"resolve storage"| node_uploadpaths
node_upload -->|"write and list"| node_uploadfiles
node_patientuser -->|"browse pages"| node_otherfeatures
node_app -->|"configure store"| node_dbcontext
node_app -->|"configure identity"| node_identitystore
node_app -->|"register repository"| node_patientrepo
node_app -->|"register repository"| node_bedrepo
node_app -->|"register service"| node_allocation
node_app -->|"register service"| node_notifications

click node_patientsui "https://github.com/khan4marketing/smarthospital-asp.net-mvc/blob/main/Controllers/PatientsController.cs"
click node_patientrepo "https://github.com/khan4marketing/smarthospital-asp.net-mvc/blob/main/Data/PatientRepository.cs"
click node_vitals "https://github.com/khan4marketing/smarthospital-asp.net-mvc/blob/main/Services/VitalsService.cs"
click node_dashboard "https://github.com/khan4marketing/smarthospital-asp.net-mvc/blob/main/Controllers/DashboardController.cs"
click node_notifications "https://github.com/khan4marketing/smarthospital-asp.net-mvc/blob/main/Services/NotificationService.cs"
click node_notifycontroller "https://github.com/khan4marketing/smarthospital-asp.net-mvc/blob/main/Controllers/NotificationsController.cs"
click node_bedsui "https://github.com/khan4marketing/smarthospital-asp.net-mvc/blob/main/Controllers/BedsController.cs"
click node_bedrepo "https://github.com/khan4marketing/smarthospital-asp.net-mvc/blob/main/Data/BedRepository.cs"
click node_allocation "https://github.com/khan4marketing/smarthospital-asp.net-mvc/blob/main/Services/AllocationService.cs"
click node_beddata "https://github.com/khan4marketing/smarthospital-asp.net-mvc/blob/main/Models/Bed.cs"
click node_patientdata "https://github.com/khan4marketing/smarthospital-asp.net-mvc/blob/main/Models/Patient.cs"
click node_dbcontext "https://github.com/khan4marketing/smarthospital-asp.net-mvc/blob/main/Data/ApplicationDbContext.cs"
click node_auth "https://github.com/khan4marketing/smarthospital-asp.net-mvc/blob/main/Controllers/AccountController.cs"
click node_identitystore "https://github.com/khan4marketing/smarthospital-asp.net-mvc/blob/main/Data/ApplicationDbContext.cs"
click node_upload "https://github.com/khan4marketing/smarthospital-asp.net-mvc/blob/main/Controllers/UploadController.cs"
click node_uploadpaths "https://github.com/khan4marketing/smarthospital-asp.net-mvc/blob/main/Services/UploadPaths.cs"
click node_uploadfiles "https://github.com/khan4marketing/smarthospital-asp.net-mvc/tree/main/wwwroot/uploads"
click node_otherfeatures "https://github.com/khan4marketing/smarthospital-asp.net-mvc/blob/main/Controllers/PublicController.cs"
click node_app "https://github.com/khan4marketing/smarthospital-asp.net-mvc/blob/main/Program.cs"

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_patientsui,node_patientrepo,node_vitals,node_dashboard,node_notifications,node_notifycontroller,node_patientuser toneBlue
class node_bedsui,node_bedrepo,node_allocation toneAmber
class node_auth,node_identitystore toneMint
class node_beddata,node_patientdata,node_dbcontext,node_upload,node_uploadpaths,node_uploadfiles,node_otherfeatures,node_app toneRose
class node_staff toneIndigo
```

## Components

### Patient care

- [Patient management](https://github.com/khan4marketing/smarthospital-asp.net-mvc/blob/main/Controllers/PatientsController.cs): `Controllers/PatientsController.cs`
- [Patient repository](https://github.com/khan4marketing/smarthospital-asp.net-mvc/blob/main/Data/PatientRepository.cs): `Data/PatientRepository.cs`
- [Vitals evaluation](https://github.com/khan4marketing/smarthospital-asp.net-mvc/blob/main/Services/VitalsService.cs): `Services/VitalsService.cs`
- [Monitoring dashboard](https://github.com/khan4marketing/smarthospital-asp.net-mvc/blob/main/Controllers/DashboardController.cs): `Controllers/DashboardController.cs`
- [Notifications](https://github.com/khan4marketing/smarthospital-asp.net-mvc/blob/main/Services/NotificationService.cs): `Services/NotificationService.cs`
- [Notification routes](https://github.com/khan4marketing/smarthospital-asp.net-mvc/blob/main/Controllers/NotificationsController.cs): `Controllers/NotificationsController.cs`

### Bed operations

- [Bed management](https://github.com/khan4marketing/smarthospital-asp.net-mvc/blob/main/Controllers/BedsController.cs): `Controllers/BedsController.cs`
- [Bed repository](https://github.com/khan4marketing/smarthospital-asp.net-mvc/blob/main/Data/BedRepository.cs): `Data/BedRepository.cs`
- [Allocation rules](https://github.com/khan4marketing/smarthospital-asp.net-mvc/blob/main/Services/AllocationService.cs): `Services/AllocationService.cs`

### Identity

- [Identity authentication](https://github.com/khan4marketing/smarthospital-asp.net-mvc/blob/main/Controllers/AccountController.cs): `Controllers/AccountController.cs`
- [Identity store](https://github.com/khan4marketing/smarthospital-asp.net-mvc/blob/main/Data/ApplicationDbContext.cs): `Data/ApplicationDbContext.cs`

### Application data

- [Bed records](https://github.com/khan4marketing/smarthospital-asp.net-mvc/blob/main/Models/Bed.cs): `Models/Bed.cs`
- [Patient records](https://github.com/khan4marketing/smarthospital-asp.net-mvc/blob/main/Models/Patient.cs): `Models/Patient.cs`
- [EF Core context](https://github.com/khan4marketing/smarthospital-asp.net-mvc/blob/main/Data/ApplicationDbContext.cs): `Data/ApplicationDbContext.cs`
- [Image uploads](https://github.com/khan4marketing/smarthospital-asp.net-mvc/blob/main/Controllers/UploadController.cs): `Controllers/UploadController.cs`
- [Upload paths](https://github.com/khan4marketing/smarthospital-asp.net-mvc/blob/main/Services/UploadPaths.cs): `Services/UploadPaths.cs`
- [Uploaded images](https://github.com/khan4marketing/smarthospital-asp.net-mvc/tree/main/wwwroot/uploads): `wwwroot/uploads`
- [Public and home pages](https://github.com/khan4marketing/smarthospital-asp.net-mvc/blob/main/Controllers/PublicController.cs): `Controllers/PublicController.cs`
- [Application startup](https://github.com/khan4marketing/smarthospital-asp.net-mvc/blob/main/Program.cs): `Program.cs`

### Other components

- **Hospital staff**
- **Patient user**

## Connections

- Hospital staff → Patient management: manage patients
- Patient management → Vitals evaluation: evaluate vitals
- Patient management → Patient repository: read and write
- Patient repository → EF Core context: query and save
- EF Core context → Patient records: stores
- Hospital staff → Monitoring dashboard: monitor care
- Monitoring dashboard → Patient repository: read patients
- Monitoring dashboard → Bed repository: read beds
- Monitoring dashboard → Vitals evaluation: build alerts
- Monitoring dashboard → Allocation rules: allocation actions
- Monitoring dashboard → Notifications: publish and read
- Notification routes → Notifications: manage notices
- Patient user → Identity authentication: register or sign in
- Identity authentication → Identity store: manage identity
- Identity authentication → Patient repository: link patient record
- Hospital staff → Bed management: manage beds
- Bed management → Bed repository: read and write
- Bed repository → EF Core context: query and save
- EF Core context → Bed records: stores
- Allocation rules → Patient repository: read and update
- Allocation rules → Bed repository: validate and occupy
- Hospital staff → Image uploads: upload image
- Image uploads → Upload paths: resolve storage
- Image uploads → Uploaded images: write and list
- Patient user → Public and home pages: browse pages
- Application startup → EF Core context: configure store
- Application startup → Identity store: configure identity
- Application startup → Patient repository: register repository
- Application startup → Bed repository: register repository
- Application startup → Allocation rules: register service
- Application startup → Notifications: register service
