# eng-ahmed-ibrahim/clinic-system-asp.net-angular architecture

> Architecture diagram of the GitHub repository eng-ahmed-ibrahim/clinic-system-asp.net-angular, 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/eng-ahmed-ibrahim/clinic-system-asp.net-angular
- Repository: https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular

## Overview

This repository is a clinic-management application with an Angular frontend and ASP.NET Core API. A user navigates the dashboard or patient pages; frontend routes select feature views, while API controllers delegate patient, doctor, specialty, and user operations to application services and persistence. The domain models also cover scheduling, consultations, prescriptions, laboratory requests, attachments, invoicing, and payments. Those latter capabilities are visible in entity and DbContext excerpts, but their runtime handlers were not sampled, so no operational workflow is inferred for them.

Main entry points: [`backend/Infrastructure/Data/AppDbContext.cs`](https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/backend/Infrastructure/Data/AppDbContext.cs) (Clinic database context), [`backend/Domain/Entities/Appointment.cs`](https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/backend/Domain/Entities/Appointment.cs) (Appointments), [`frontend/src/app/app.routes.ts`](https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/frontend/src/app/app.routes.ts) (Feature routes), [`backend/Domain/Entities/Consultation.cs`](https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/backend/Domain/Entities/Consultation.cs) (Care records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Angular interface"]
  node_app["App shell<br/>[app.ts]"]
  node_routes["Feature routes<br/>[app.routes.ts]"]
  node_dashboard["Dashboard"]
  node_patient_page["Patient page"]
  node_profile["Profile page"]
  node_showcase["Component showcase"]
  node_patient_client["Patient API client<br/>[patient.service.ts]"]
  node_ui_services["UI services"]
end

subgraph group_api["API endpoints"]
  node_auth_api["Authentication API<br/>[AuthController.cs]"]
  node_patient_api["Patient API"]
  node_doctor_api["Doctor API"]
  node_specialty_api["Specialty API"]
  node_user_api["User API<br/>[UsersController.cs]"]
end

subgraph group_application["Application services"]
  node_patient_service["Patient operations<br/>[PatientService.cs]"]
  node_doctor_service["Doctor operations<br/>[DoctorService.cs]"]
  node_specialty_service["Specialty operations"]
  node_user_service["User operations<br/>[UserService.cs]"]
  node_jwt_service["JWT service<br/>[JwtService.cs]"]
  node_dto_contracts["API DTO contracts"]
end

subgraph group_domain["Clinic domain"]
  node_patient_model["Patient records<br/>[Patient.cs]"]
  node_doctor_model["Doctors and schedules<br/>[Doctor.cs]"]
  node_appointment_model["Appointments<br/>[Appointment.cs]"]
  node_consultation_model["Care records<br/>[Consultation.cs]"]
  node_invoice_model["Invoices and payments<br/>[Invoice.cs]"]
  node_user_model["Identity users<br/>[AppUser.cs]"]
end

subgraph group_persistence["Persistence"]
  node_db[("Clinic database context<br/>[AppDbContext.cs]")]
end

node_browser(("Clinic user"))

node_browser -->|"opens"| node_app
node_app -->|"hosts routes"| node_routes
node_routes -->|"loads default"| node_dashboard
node_routes -->|"loads patients"| node_patient_page
node_routes -->|"loads profile"| node_profile
node_routes -->|"loads showcase"| node_showcase
node_app -->|"uses translation"| node_ui_services
node_patient_api -->|"delegates"| node_patient_service
node_doctor_api -->|"delegates"| node_doctor_service
node_specialty_api -->|"delegates"| node_specialty_service
node_user_api -->|"delegates"| node_user_service
node_auth_api -->|"uses tokens"| node_jwt_service
node_patient_service -->|"reads and writes"| node_db
node_doctor_service -->|"reads and writes"| node_db
node_specialty_service -->|"uses context"| node_db
node_user_service -->|"uses identity"| node_user_model
node_patient_api -->|"accepts DTOs"| node_dto_contracts
node_doctor_api -->|"accepts DTOs"| node_dto_contracts
node_patient_service -->|"maps records"| node_patient_model
node_doctor_service -->|"maps records"| node_doctor_model
node_db -->|"maps entity"| node_patient_model
node_db -->|"maps entity"| node_doctor_model
node_db -->|"maps entity"| node_appointment_model
node_db -->|"maps entity"| node_consultation_model
node_db -->|"maps entity"| node_invoice_model
node_db -->|"maps identity"| node_user_model
node_appointment_model -->|"references patient"| node_patient_model
node_appointment_model -->|"references doctor"| node_doctor_model
node_appointment_model -->|"has consultation"| node_consultation_model
node_appointment_model -->|"has invoices"| node_invoice_model
node_consultation_model -->|"references appointment"| node_appointment_model
node_consultation_model -->|"references patient"| node_patient_model
node_consultation_model -->|"references doctor"| node_doctor_model
node_invoice_model -->|"references patient"| node_patient_model

click node_app "https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/frontend/src/app/app.ts"
click node_routes "https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/frontend/src/app/app.routes.ts"
click node_dashboard "https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/frontend/src/app/features/dashboard/dashboard-overview.component.ts"
click node_patient_page "https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/frontend/src/app/features/patients/patients-page.component.ts"
click node_profile "https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/frontend/src/app/features/profile/profile-page.component.ts"
click node_showcase "https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/frontend/src/app/features/components-showcase/components-showcase.component.ts"
click node_patient_client "https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/frontend/src/app/core/services/patient.service.ts"
click node_ui_services "https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/frontend/src/app/core/services/translation.service.ts"
click node_auth_api "https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/backend/Controllers/Auth/AuthController.cs"
click node_patient_api "https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/backend/Controllers/PatientsController.cs"
click node_doctor_api "https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/backend/Controllers/DoctorsController.cs"
click node_specialty_api "https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/backend/Controllers/SpecialtiesController.cs"
click node_user_api "https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/backend/Controllers/UsersController.cs"
click node_patient_service "https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/backend/Applications/Services/PatientService.cs"
click node_doctor_service "https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/backend/Applications/Services/DoctorService.cs"
click node_specialty_service "https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/backend/Applications/Services/SpecialtyService.cs"
click node_user_service "https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/backend/Applications/Services/UserService.cs"
click node_jwt_service "https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/backend/Applications/Services/JwtService.cs"
click node_dto_contracts "https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/tree/main/backend/Applications/DTOs"
click node_patient_model "https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/backend/Domain/Entities/Patient.cs"
click node_doctor_model "https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/backend/Domain/Entities/Doctor.cs"
click node_appointment_model "https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/backend/Domain/Entities/Appointment.cs"
click node_consultation_model "https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/backend/Domain/Entities/Consultation.cs"
click node_invoice_model "https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/backend/Domain/Entities/Invoice.cs"
click node_user_model "https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/backend/Domain/Entities/AppUser.cs"
click node_db "https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/backend/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_app,node_routes,node_dashboard,node_patient_page,node_profile,node_showcase,node_patient_client,node_ui_services,node_browser toneBlue
class node_auth_api,node_patient_api,node_doctor_api,node_specialty_api,node_user_api toneAmber
class node_patient_service,node_doctor_service,node_specialty_service,node_user_service,node_jwt_service,node_dto_contracts toneMint
class node_patient_model,node_doctor_model,node_appointment_model,node_consultation_model,node_invoice_model,node_user_model toneRose
class node_db toneIndigo
```

## Components

### Angular interface

- [App shell](https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/frontend/src/app/app.ts): `frontend/src/app/app.ts`
- [Feature routes](https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/frontend/src/app/app.routes.ts): `frontend/src/app/app.routes.ts`
- [Dashboard](https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/frontend/src/app/features/dashboard/dashboard-overview.component.ts): `frontend/src/app/features/dashboard/dashboard-overview.component.ts`
- [Patient page](https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/frontend/src/app/features/patients/patients-page.component.ts): `frontend/src/app/features/patients/patients-page.component.ts`
- [Profile page](https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/frontend/src/app/features/profile/profile-page.component.ts): `frontend/src/app/features/profile/profile-page.component.ts`
- [Component showcase](https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/frontend/src/app/features/components-showcase/components-showcase.component.ts): `frontend/src/app/features/components-showcase/components-showcase.component.ts`
- [Patient API client](https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/frontend/src/app/core/services/patient.service.ts): `frontend/src/app/core/services/patient.service.ts`
- [UI services](https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/frontend/src/app/core/services/translation.service.ts): `frontend/src/app/core/services/translation.service.ts`

### API endpoints

- [Authentication API](https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/backend/Controllers/Auth/AuthController.cs): `backend/Controllers/Auth/AuthController.cs`
- [Patient API](https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/backend/Controllers/PatientsController.cs): `backend/Controllers/PatientsController.cs`
- [Doctor API](https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/backend/Controllers/DoctorsController.cs): `backend/Controllers/DoctorsController.cs`
- [Specialty API](https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/backend/Controllers/SpecialtiesController.cs): `backend/Controllers/SpecialtiesController.cs`
- [User API](https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/backend/Controllers/UsersController.cs): `backend/Controllers/UsersController.cs`

### Application services

- [Patient operations](https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/backend/Applications/Services/PatientService.cs): `backend/Applications/Services/PatientService.cs`
- [Doctor operations](https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/backend/Applications/Services/DoctorService.cs): `backend/Applications/Services/DoctorService.cs`
- [Specialty operations](https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/backend/Applications/Services/SpecialtyService.cs): `backend/Applications/Services/SpecialtyService.cs`
- [User operations](https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/backend/Applications/Services/UserService.cs): `backend/Applications/Services/UserService.cs`
- [JWT service](https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/backend/Applications/Services/JwtService.cs): `backend/Applications/Services/JwtService.cs`
- [API DTO contracts](https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/tree/main/backend/Applications/DTOs): `backend/Applications/DTOs`

### Clinic domain

- [Patient records](https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/backend/Domain/Entities/Patient.cs): `backend/Domain/Entities/Patient.cs`
- [Doctors and schedules](https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/backend/Domain/Entities/Doctor.cs): `backend/Domain/Entities/Doctor.cs`
- [Appointments](https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/backend/Domain/Entities/Appointment.cs): `backend/Domain/Entities/Appointment.cs`
- [Care records](https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/backend/Domain/Entities/Consultation.cs): `backend/Domain/Entities/Consultation.cs`
- [Invoices and payments](https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/backend/Domain/Entities/Invoice.cs): `backend/Domain/Entities/Invoice.cs`
- [Identity users](https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/backend/Domain/Entities/AppUser.cs): `backend/Domain/Entities/AppUser.cs`

### Persistence

- [Clinic database context](https://github.com/eng-ahmed-ibrahim/clinic-system-asp.net-angular/blob/main/backend/Infrastructure/Data/AppDbContext.cs): `backend/Infrastructure/Data/AppDbContext.cs`

### Other components

- **Clinic user**

## Connections

- Clinic user → App shell: opens
- App shell → Feature routes: hosts routes
- Feature routes → Dashboard: loads default (evidence: `frontend/src/app/app.routes.ts`)
- Feature routes → Patient page: loads patients (evidence: `frontend/src/app/app.routes.ts`)
- Feature routes → Profile page: loads profile (evidence: `frontend/src/app/app.routes.ts`)
- Feature routes → Component showcase: loads showcase (evidence: `frontend/src/app/app.routes.ts`)
- App shell → UI services: uses translation (evidence: `frontend/src/app/app.ts`)
- Patient API → Patient operations: delegates (evidence: `backend/Controllers/PatientsController.cs`)
- Doctor API → Doctor operations: delegates (evidence: `backend/Controllers/DoctorsController.cs`)
- Specialty API → Specialty operations: delegates (evidence: `backend/Controllers/SpecialtiesController.cs`)
- User API → User operations: delegates (evidence: `backend/Controllers/UsersController.cs`)
- Authentication API → JWT service: uses tokens (evidence: `backend/Controllers/Auth/AuthController.cs`)
- Patient operations → Clinic database context: reads and writes (evidence: `backend/Applications/Services/PatientService.cs`)
- Doctor operations → Clinic database context: reads and writes (evidence: `backend/Applications/Services/DoctorService.cs`)
- Specialty operations → Clinic database context: uses context (evidence: `backend/Applications/Services/SpecialtyService.cs`)
- User operations → Identity users: uses identity (evidence: `backend/Applications/Services/UserService.cs`)
- Patient API → API DTO contracts: accepts DTOs (evidence: `backend/Controllers/PatientsController.cs`)
- Doctor API → API DTO contracts: accepts DTOs (evidence: `backend/Controllers/DoctorsController.cs`)
- Patient operations → Patient records: maps records (evidence: `backend/Applications/Services/PatientService.cs`)
- Doctor operations → Doctors and schedules: maps records (evidence: `backend/Applications/Services/DoctorService.cs`)
- Clinic database context → Patient records: maps entity (evidence: `backend/Infrastructure/Data/AppDbContext.cs`)
- Clinic database context → Doctors and schedules: maps entity (evidence: `backend/Infrastructure/Data/AppDbContext.cs`)
- Clinic database context → Appointments: maps entity (evidence: `backend/Infrastructure/Data/AppDbContext.cs`)
- Clinic database context → Care records: maps entity (evidence: `backend/Infrastructure/Data/AppDbContext.cs`)
- Clinic database context → Invoices and payments: maps entity (evidence: `backend/Infrastructure/Data/AppDbContext.cs`)
- Clinic database context → Identity users: maps identity (evidence: `backend/Infrastructure/Data/AppDbContext.cs`)
- Appointments → Patient records: references patient (evidence: `backend/Domain/Entities/Appointment.cs`)
- Appointments → Doctors and schedules: references doctor (evidence: `backend/Domain/Entities/Appointment.cs`)
- Appointments → Care records: has consultation (evidence: `backend/Domain/Entities/Appointment.cs`)
- Appointments → Invoices and payments: has invoices (evidence: `backend/Domain/Entities/Appointment.cs`)
- Care records → Appointments: references appointment (evidence: `backend/Domain/Entities/Consultation.cs`)
- Care records → Patient records: references patient (evidence: `backend/Domain/Entities/Consultation.cs`)
- Care records → Doctors and schedules: references doctor (evidence: `backend/Domain/Entities/Consultation.cs`)
- Invoices and payments → Patient records: references patient (evidence: `backend/Domain/Entities/Invoice.cs`)
