# marslanakram/healthdesksystem architecture

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

- Interactive diagram: https://gitdiagram.com/marslanakram/healthdesksystem
- Repository: https://github.com/marslanakram/healthdesksystem

## Overview

HealthDesk is an ASP.NET MVC application for healthcare administration and clinical workflows. Users browse or manage patients, doctors, departments, appointments, and prescriptions; appointment and prescription controllers call application services, which map domain data into DTOs. Administrators also manage users, roles, permissions, and audit history. The graph shows the principal MVC-to-service flow, the documented doctor-service/unit-of-work relationship, and database and identity setup. Other service-to-repository links are omitted where the sampled source did not establish their wiring.

Main entry points: [`HealthDesk.Web/Controllers/PrescriptionController.cs`](https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Web/Controllers/PrescriptionController.cs) (Prescription workflows), [`HealthDesk.Web/Controllers/AppointmentController.cs`](https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Web/Controllers/AppointmentController.cs) (Appointment workflows), [`HealthDesk.Application/Services/DoctorService.cs`](https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Application/Services/DoctorService.cs) (Doctor service), [`HealthDesk.Infrastructure/Data/AppDbContext.cs`](https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Infrastructure/Data/AppDbContext.cs) (Application database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_appointment_web["Appointment workflows"]
  node_prescription_web["Prescription workflows"]
  node_doctor_web["Doctor management"]
  node_dashboard_web["Dashboard"]
  node_patient_web["Patient management"]
  node_department_web["Department management"]
  node_admin_audit["Audit history"]
  node_admin_roles["Role permissions"]
  node_admin_users["User management"]
  node_mvc_startup["Application startup<br/>[Program.cs]"]
end

subgraph group_application["Application services"]
  node_appointment_service["Appointment service"]
  node_prescription_service["Prescription service"]
  node_doctor_service["Doctor service<br/>[DoctorService.cs]"]
  node_patient_service["Patient service<br/>[PatientService.cs]"]
  node_department_service["Department service"]
  node_dashboard_service["Dashboard service"]
  node_audit_service["Audit service<br/>[AuditService.cs]"]
  node_mapping["DTO mapping<br/>[MappingProfile.cs]"]
  node_unit_of_work["Unit of work<br/>[UnitOfWork.cs]"]
end

subgraph group_domain["Domain model"]
  node_domain_records["Clinical records<br/>[Entities]"]
end

subgraph group_infrastructure["Persistence"]
  node_appointment_repo["Appointment queries"]
  node_repository_set["Domain repositories<br/>[Repositories]"]
  node_db[("Application database<br/>[AppDbContext.cs]")]
end

subgraph group_identity["Identity and access"]
  node_permission_policy["Permission policies"]
  node_permission_handler["Permission checks"]
  node_seeding["Role and admin seeds<br/>[DatabaseSeeder.cs]"]
  node_identity_store[("Identity store<br/>[AppDbContext.cs]")]
end

node_staff(("Staff and patients"))

node_staff -->|"uses"| node_appointment_web
node_staff -->|"uses"| node_prescription_web
node_staff -->|"uses"| node_doctor_web
node_staff -->|"uses"| node_patient_web
node_staff -->|"uses"| node_department_web
node_staff -->|"views"| node_dashboard_web
node_appointment_web -->|"calls"| node_appointment_service
node_appointment_web -->|"loads patients"| node_patient_service
node_appointment_web -->|"loads doctors"| node_doctor_service
node_prescription_web -->|"calls"| node_prescription_service
node_prescription_web -->|"checks appointment"| node_appointment_service
node_prescription_web -->|"resolves doctor"| node_doctor_service
node_prescription_web -->|"resolves patient"| node_patient_service
node_doctor_web -->|"calls"| node_doctor_service
node_doctor_web -->|"loads departments"| node_department_service
node_patient_web -->|"calls"| node_patient_service
node_department_web -->|"calls"| node_department_service
node_dashboard_web -->|"calls"| node_dashboard_service
node_admin_audit -->|"calls"| node_audit_service
node_admin_roles -->|"records changes"| node_audit_service
node_doctor_service -->|"uses"| node_unit_of_work
node_unit_of_work -->|"coordinates"| node_repository_set
node_appointment_repo -->|"queries"| node_db
node_repository_set -->|"persists records"| node_db
node_db -->|"stores"| node_domain_records
node_mvc_startup -->|"configures"| node_db
node_mvc_startup -->|"runs on startup"| node_seeding
node_seeding -->|"seeds roles and users"| node_identity_store
node_admin_users -->|"manages accounts"| node_identity_store
node_admin_roles -->|"manages claims"| node_identity_store
node_permission_policy -->|"resolves requirements"| node_permission_handler

click node_appointment_web "https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Web/Controllers/AppointmentController.cs"
click node_prescription_web "https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Web/Controllers/PrescriptionController.cs"
click node_doctor_web "https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Web/Controllers/DoctorController.cs"
click node_dashboard_web "https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Web/Controllers/DashboardController.cs"
click node_patient_web "https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Web/Controllers/PatientController.cs"
click node_department_web "https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Web/Controllers/DepartmentController.cs"
click node_admin_audit "https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Web/Areas/Admin/Controllers/AuditLogController.cs"
click node_admin_roles "https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Web/Areas/Admin/Controllers/RoleManagementController.cs"
click node_admin_users "https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Web/Areas/Admin/Controllers/UserManagementController.cs"
click node_appointment_service "https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Application/Services/AppointmentService.cs"
click node_prescription_service "https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Application/Services/PrescriptionService.cs"
click node_doctor_service "https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Application/Services/DoctorService.cs"
click node_patient_service "https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Application/Services/PatientService.cs"
click node_department_service "https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Application/Services/DepartmentService.cs"
click node_dashboard_service "https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Application/Services/DashboardService.cs"
click node_audit_service "https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Application/Services/AuditService.cs"
click node_mapping "https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Application/Mappings/MappingProfile.cs"
click node_unit_of_work "https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Infrastructure/Repositories/UnitOfWork.cs"
click node_appointment_repo "https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Infrastructure/Repositories/AppointmentRepository.cs"
click node_repository_set "https://github.com/marslanakram/healthdesksystem/tree/master/HealthDesk.Infrastructure/Repositories"
click node_db "https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Infrastructure/Data/AppDbContext.cs"
click node_domain_records "https://github.com/marslanakram/healthdesksystem/tree/master/HealthDesk.Domain/Entities"
click node_mvc_startup "https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Web/Program.cs"
click node_permission_policy "https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Infrastructure/Authorization/PermissionPolicyProvider.cs"
click node_permission_handler "https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Infrastructure/Authorization/PermissionAuthorizationHandler.cs"
click node_seeding "https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Infrastructure/Seeds/DatabaseSeeder.cs"
click node_identity_store "https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Infrastructure/Data/AppDbContext.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_appointment_web,node_prescription_web,node_doctor_web,node_dashboard_web,node_patient_web,node_department_web,node_admin_audit,node_admin_roles,node_admin_users,node_mvc_startup toneBlue
class node_appointment_service,node_prescription_service,node_doctor_service,node_patient_service,node_department_service,node_dashboard_service,node_audit_service,node_mapping,node_unit_of_work toneAmber
class node_domain_records toneMint
class node_appointment_repo,node_repository_set,node_db toneRose
class node_permission_policy,node_permission_handler,node_seeding,node_identity_store,node_staff toneIndigo
```

## Components

### Web application

- [Appointment workflows](https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Web/Controllers/AppointmentController.cs): `HealthDesk.Web/Controllers/AppointmentController.cs`
- [Prescription workflows](https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Web/Controllers/PrescriptionController.cs): `HealthDesk.Web/Controllers/PrescriptionController.cs`
- [Doctor management](https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Web/Controllers/DoctorController.cs): `HealthDesk.Web/Controllers/DoctorController.cs`
- [Dashboard](https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Web/Controllers/DashboardController.cs): `HealthDesk.Web/Controllers/DashboardController.cs`
- [Patient management](https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Web/Controllers/PatientController.cs): `HealthDesk.Web/Controllers/PatientController.cs`
- [Department management](https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Web/Controllers/DepartmentController.cs): `HealthDesk.Web/Controllers/DepartmentController.cs`
- [Audit history](https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Web/Areas/Admin/Controllers/AuditLogController.cs): `HealthDesk.Web/Areas/Admin/Controllers/AuditLogController.cs`
- [Role permissions](https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Web/Areas/Admin/Controllers/RoleManagementController.cs): `HealthDesk.Web/Areas/Admin/Controllers/RoleManagementController.cs`
- [User management](https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Web/Areas/Admin/Controllers/UserManagementController.cs): `HealthDesk.Web/Areas/Admin/Controllers/UserManagementController.cs`
- [Application startup](https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Web/Program.cs): `HealthDesk.Web/Program.cs`

### Application services

- [Appointment service](https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Application/Services/AppointmentService.cs): `HealthDesk.Application/Services/AppointmentService.cs`
- [Prescription service](https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Application/Services/PrescriptionService.cs): `HealthDesk.Application/Services/PrescriptionService.cs`
- [Doctor service](https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Application/Services/DoctorService.cs): `HealthDesk.Application/Services/DoctorService.cs`
- [Patient service](https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Application/Services/PatientService.cs): `HealthDesk.Application/Services/PatientService.cs`
- [Department service](https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Application/Services/DepartmentService.cs): `HealthDesk.Application/Services/DepartmentService.cs`
- [Dashboard service](https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Application/Services/DashboardService.cs): `HealthDesk.Application/Services/DashboardService.cs`
- [Audit service](https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Application/Services/AuditService.cs): `HealthDesk.Application/Services/AuditService.cs`
- [DTO mapping](https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Application/Mappings/MappingProfile.cs): `HealthDesk.Application/Mappings/MappingProfile.cs`
- [Unit of work](https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Infrastructure/Repositories/UnitOfWork.cs): `HealthDesk.Infrastructure/Repositories/UnitOfWork.cs`

### Domain model

- [Clinical records](https://github.com/marslanakram/healthdesksystem/tree/master/HealthDesk.Domain/Entities): `HealthDesk.Domain/Entities`

### Persistence

- [Appointment queries](https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Infrastructure/Repositories/AppointmentRepository.cs): `HealthDesk.Infrastructure/Repositories/AppointmentRepository.cs`
- [Domain repositories](https://github.com/marslanakram/healthdesksystem/tree/master/HealthDesk.Infrastructure/Repositories): `HealthDesk.Infrastructure/Repositories`
- [Application database](https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Infrastructure/Data/AppDbContext.cs): `HealthDesk.Infrastructure/Data/AppDbContext.cs`

### Identity and access

- [Permission policies](https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Infrastructure/Authorization/PermissionPolicyProvider.cs): `HealthDesk.Infrastructure/Authorization/PermissionPolicyProvider.cs`
- [Permission checks](https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Infrastructure/Authorization/PermissionAuthorizationHandler.cs): `HealthDesk.Infrastructure/Authorization/PermissionAuthorizationHandler.cs`
- [Role and admin seeds](https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Infrastructure/Seeds/DatabaseSeeder.cs): `HealthDesk.Infrastructure/Seeds/DatabaseSeeder.cs`
- [Identity store](https://github.com/marslanakram/healthdesksystem/blob/master/HealthDesk.Infrastructure/Data/AppDbContext.cs): `HealthDesk.Infrastructure/Data/AppDbContext.cs`

### Other components

- **Staff and patients**

## Connections

- Staff and patients → Appointment workflows: uses
- Staff and patients → Prescription workflows: uses
- Staff and patients → Doctor management: uses
- Staff and patients → Patient management: uses
- Staff and patients → Department management: uses
- Staff and patients → Dashboard: views
- Appointment workflows → Appointment service: calls
- Appointment workflows → Patient service: loads patients
- Appointment workflows → Doctor service: loads doctors
- Prescription workflows → Prescription service: calls
- Prescription workflows → Appointment service: checks appointment
- Prescription workflows → Doctor service: resolves doctor
- Prescription workflows → Patient service: resolves patient
- Doctor management → Doctor service: calls
- Doctor management → Department service: loads departments
- Patient management → Patient service: calls
- Department management → Department service: calls
- Dashboard → Dashboard service: calls
- Audit history → Audit service: calls
- Role permissions → Audit service: records changes
- Doctor service → Unit of work: uses
- Unit of work → Domain repositories: coordinates
- Appointment queries → Application database: queries
- Domain repositories → Application database: persists records
- Application database → Clinical records: stores
- Application startup → Application database: configures
- Application startup → Role and admin seeds: runs on startup
- Role and admin seeds → Identity store: seeds roles and users
- User management → Identity store: manages accounts
- Role permissions → Identity store: manages claims
- Permission policies → Permission checks: resolves requirements
