# isamattia23/yashfeenmedical architecture

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

- Interactive diagram: https://gitdiagram.com/isamattia23/yashfeenmedical
- Repository: https://github.com/isamattia23/yashfeenmedical

## Overview

YashfeenMedical is a medical-practice backend for account and clinical-data management, including doctor and patient profiles, appointments, records, prescriptions, billing, and file handling. The principal workflow is an API request routed through a controller to business services and, for persisted operations, repositories and the EF database context. Authentication and recycle-bin handling are distinct capabilities. Several business modules are represented from the file tree and SOURCE INDEX rather than inspected excerpts, so their internal calls are not expanded; edges are limited to relationships supported by the supplied evidence.

Main entry points: [`YashfeenMedical.DAL/Repositories/UnitOfWork.cs`](https://github.com/isamattia23/yashfeenmedical/blob/main/YashfeenMedical.DAL/Repositories/UnitOfWork.cs) (Unit of work), [`YashfeenMedical/Controllers`](https://github.com/isamattia23/yashfeenmedical/tree/main/YashfeenMedical/Controllers) (API controllers), [`YashfeenMedical.BLL/Services/AuthServices.cs`](https://github.com/isamattia23/yashfeenmedical/blob/main/YashfeenMedical.BLL/Services/AuthServices.cs) (Authentication), [`YashfeenMedical.BLL/RecycleBin/RecycleBinService.cs`](https://github.com/isamattia23/yashfeenmedical/blob/main/YashfeenMedical.BLL/RecycleBin/RecycleBinService.cs) (Recycle bin)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API entry"]
  node_controllers["API controllers"]
end

subgraph group_business["Clinical workflows"]
  node_appointments["Appointments"]
  node_doctors["Doctor management<br/>[DoctorServices.cs]"]
  node_patients["Patient management<br/>[PatientServices.cs]"]
  node_specialties["Specialties"]
  node_records["Medical records"]
  node_prescriptions["Prescriptions"]
  node_billing["Invoices"]
end

subgraph group_persistence["Data access"]
  node_unit_of_work["Unit of work<br/>[UnitOfWork.cs]"]
  node_repositories["Repository layer<br/>[TRepository.cs]"]
  node_database[("Clinical database")]
end

subgraph group_identity["Identity and access"]
  node_auth["Authentication<br/>[AuthServices.cs]"]
  node_user_management["User management"]
  node_jwt["JWT service<br/>[JwtService.cs]"]
end

subgraph group_support["Files and recovery"]
  node_recycle["Recycle bin"]
  node_file_storage["File storage"]
  node_email["Email service<br/>[IEmailService.cs]"]
end

node_client(("API client"))

node_client -->|"sends requests"| node_controllers
node_controllers -->|"calls"| node_appointments
node_controllers -->|"calls"| node_doctors
node_controllers -->|"calls"| node_patients
node_auth -->|"manages accounts"| node_user_management
node_auth -->|"issues tokens"| node_jwt
node_auth -->|"uses"| node_unit_of_work
node_patients -->|"uses"| node_unit_of_work
node_doctors -->|"uses"| node_unit_of_work
node_appointments -.->|"uses"| node_unit_of_work
node_records -.->|"uses"| node_unit_of_work
node_prescriptions -.->|"uses"| node_unit_of_work
node_unit_of_work -->|"exposes repositories"| node_repositories
node_repositories -->|"queries and saves"| node_database
node_database -.-> node_file_storage
node_recycle -->|"reads entities"| node_database
node_recycle -->|"handles files"| node_file_storage
node_recycle -->|"handles users"| node_user_management

click node_controllers "https://github.com/isamattia23/yashfeenmedical/tree/main/YashfeenMedical/Controllers"
click node_appointments "https://github.com/isamattia23/yashfeenmedical/blob/main/YashfeenMedical.BLL/Services/AppointmentServices.cs"
click node_doctors "https://github.com/isamattia23/yashfeenmedical/blob/main/YashfeenMedical.BLL/Services/DoctorServices.cs"
click node_patients "https://github.com/isamattia23/yashfeenmedical/blob/main/YashfeenMedical.BLL/Services/PatientServices.cs"
click node_specialties "https://github.com/isamattia23/yashfeenmedical/blob/main/YashfeenMedical.BLL/Services/SpecialtyServices.cs"
click node_records "https://github.com/isamattia23/yashfeenmedical/blob/main/YashfeenMedical.BLL/Services/MedicalRecordServices.cs"
click node_prescriptions "https://github.com/isamattia23/yashfeenmedical/blob/main/YashfeenMedical.BLL/Services/PrescriptionServices.cs"
click node_billing "https://github.com/isamattia23/yashfeenmedical/blob/main/YashfeenMedical.BLL/IServices/IInvoiceServices.cs"
click node_recycle "https://github.com/isamattia23/yashfeenmedical/blob/main/YashfeenMedical.BLL/RecycleBin/RecycleBinService.cs"
click node_auth "https://github.com/isamattia23/yashfeenmedical/blob/main/YashfeenMedical.BLL/Services/AuthServices.cs"
click node_user_management "https://github.com/isamattia23/yashfeenmedical/blob/main/YashfeenMedical.Infrastructure/UsersManagment/UserManagmentServices.cs"
click node_jwt "https://github.com/isamattia23/yashfeenmedical/blob/main/YashfeenMedical.Infrastructure/JWT/JwtService.cs"
click node_unit_of_work "https://github.com/isamattia23/yashfeenmedical/blob/main/YashfeenMedical.DAL/Repositories/UnitOfWork.cs"
click node_repositories "https://github.com/isamattia23/yashfeenmedical/blob/main/YashfeenMedical.DAL/Repositories/TRepository.cs"
click node_database "https://github.com/isamattia23/yashfeenmedical/blob/main/YashfeenMedical.DAL/ApplicationDbContext.cs"
click node_file_storage "https://github.com/isamattia23/yashfeenmedical/blob/main/YashfeenMedical.Infrastructure/FileStorage/LocalFileStorageService.cs"
click node_email "https://github.com/isamattia23/yashfeenmedical/blob/main/YashfeenMedical.Infrastructure/Email/IEmailService.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_controllers,node_client toneBlue
class node_appointments,node_doctors,node_patients,node_specialties,node_records,node_prescriptions,node_billing toneAmber
class node_unit_of_work,node_repositories,node_database toneMint
class node_auth,node_user_management,node_jwt toneRose
class node_recycle,node_file_storage,node_email toneIndigo
```

## Components

### API entry

- [API controllers](https://github.com/isamattia23/yashfeenmedical/tree/main/YashfeenMedical/Controllers): `YashfeenMedical/Controllers`

### Clinical workflows

- [Appointments](https://github.com/isamattia23/yashfeenmedical/blob/main/YashfeenMedical.BLL/Services/AppointmentServices.cs): `YashfeenMedical.BLL/Services/AppointmentServices.cs`
- [Doctor management](https://github.com/isamattia23/yashfeenmedical/blob/main/YashfeenMedical.BLL/Services/DoctorServices.cs): `YashfeenMedical.BLL/Services/DoctorServices.cs`
- [Patient management](https://github.com/isamattia23/yashfeenmedical/blob/main/YashfeenMedical.BLL/Services/PatientServices.cs): `YashfeenMedical.BLL/Services/PatientServices.cs`
- [Specialties](https://github.com/isamattia23/yashfeenmedical/blob/main/YashfeenMedical.BLL/Services/SpecialtyServices.cs): `YashfeenMedical.BLL/Services/SpecialtyServices.cs`
- [Medical records](https://github.com/isamattia23/yashfeenmedical/blob/main/YashfeenMedical.BLL/Services/MedicalRecordServices.cs): `YashfeenMedical.BLL/Services/MedicalRecordServices.cs`
- [Prescriptions](https://github.com/isamattia23/yashfeenmedical/blob/main/YashfeenMedical.BLL/Services/PrescriptionServices.cs): `YashfeenMedical.BLL/Services/PrescriptionServices.cs`
- [Invoices](https://github.com/isamattia23/yashfeenmedical/blob/main/YashfeenMedical.BLL/IServices/IInvoiceServices.cs): `YashfeenMedical.BLL/IServices/IInvoiceServices.cs`

### Data access

- [Unit of work](https://github.com/isamattia23/yashfeenmedical/blob/main/YashfeenMedical.DAL/Repositories/UnitOfWork.cs): `YashfeenMedical.DAL/Repositories/UnitOfWork.cs`
- [Repository layer](https://github.com/isamattia23/yashfeenmedical/blob/main/YashfeenMedical.DAL/Repositories/TRepository.cs): `YashfeenMedical.DAL/Repositories/TRepository.cs`
- [Clinical database](https://github.com/isamattia23/yashfeenmedical/blob/main/YashfeenMedical.DAL/ApplicationDbContext.cs): `YashfeenMedical.DAL/ApplicationDbContext.cs`

### Identity and access

- [Authentication](https://github.com/isamattia23/yashfeenmedical/blob/main/YashfeenMedical.BLL/Services/AuthServices.cs): `YashfeenMedical.BLL/Services/AuthServices.cs`
- [User management](https://github.com/isamattia23/yashfeenmedical/blob/main/YashfeenMedical.Infrastructure/UsersManagment/UserManagmentServices.cs): `YashfeenMedical.Infrastructure/UsersManagment/UserManagmentServices.cs`
- [JWT service](https://github.com/isamattia23/yashfeenmedical/blob/main/YashfeenMedical.Infrastructure/JWT/JwtService.cs): `YashfeenMedical.Infrastructure/JWT/JwtService.cs`

### Files and recovery

- [Recycle bin](https://github.com/isamattia23/yashfeenmedical/blob/main/YashfeenMedical.BLL/RecycleBin/RecycleBinService.cs): `YashfeenMedical.BLL/RecycleBin/RecycleBinService.cs`
- [File storage](https://github.com/isamattia23/yashfeenmedical/blob/main/YashfeenMedical.Infrastructure/FileStorage/LocalFileStorageService.cs): `YashfeenMedical.Infrastructure/FileStorage/LocalFileStorageService.cs`
- [Email service](https://github.com/isamattia23/yashfeenmedical/blob/main/YashfeenMedical.Infrastructure/Email/IEmailService.cs): `YashfeenMedical.Infrastructure/Email/IEmailService.cs`

### Other components

- **API client**

## Connections

- API client → API controllers: sends requests
- API controllers → Appointments: calls (evidence: `YashfeenMedical/Controllers/AppointmentController.cs`)
- API controllers → Doctor management: calls (evidence: `YashfeenMedical/Controllers/DoctorController.cs`)
- API controllers → Patient management: calls (evidence: `YashfeenMedical/Controllers/PatientsController.cs`)
- Authentication → User management: manages accounts (evidence: `YashfeenMedical.BLL/Services/AuthServices.cs`)
- Authentication → JWT service: issues tokens (evidence: `YashfeenMedical.BLL/Services/AuthServices.cs`)
- Authentication → Unit of work: uses (evidence: `YashfeenMedical.BLL/Services/AuthServices.cs`)
- Patient management → Unit of work: uses
- Doctor management → Unit of work: uses (evidence: `YashfeenMedical.BLL/Services/DoctorServices.cs`)
- Appointments → Unit of work: uses
- Medical records → Unit of work: uses
- Prescriptions → Unit of work: uses
- Unit of work → Repository layer: exposes repositories
- Repository layer → Clinical database: queries and saves (evidence: `YashfeenMedical.DAL/Repositories/TRepository.cs`)
- Clinical database → File storage
- Recycle bin → Clinical database: reads entities (evidence: `YashfeenMedical.BLL/RecycleBin/RecycleBinService.cs`)
- Recycle bin → File storage: handles files
- Recycle bin → User management: handles users
