# mostafamo17/grad_depi architecture

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

- Interactive diagram: https://gitdiagram.com/mostafamo17/grad_depi
- Repository: https://github.com/mostafamo17/grad_depi

## Overview

MediCare is a doctor–patient appointment platform with an MVC web front end and an ASP.NET API backed by shared services and EF Core data access. Patients and doctors use the web app to authenticate, find availability, book and manage appointments; doctors manage schedules and time off, while administrators review doctors and appointments and view reports. The API also supports notifications and real-time delivery. Several controllers and service implementations were not sampled, so their internal call paths are not asserted; documented capabilities and directory-supported subsystems are retained where possible.

Main entry points: [`src/MediCare.API/Program.cs`](https://github.com/mostafamo17/grad_depi/blob/main/src/MediCare.API/Program.cs) (HTTP API), [`src/MediCare.Data/Repositories`](https://github.com/mostafamo17/grad_depi/tree/main/src/MediCare.Data/Repositories) (Repositories), [`src/MediCare.Services/Implementations/AuthService.cs`](https://github.com/mostafamo17/grad_depi/blob/main/src/MediCare.Services/Implementations/AuthService.cs) (Identity service), [`src/MediCare.Services/Implementations/AppointmentService.cs`](https://github.com/mostafamo17/grad_depi/blob/main/src/MediCare.Services/Implementations/AppointmentService.cs) (Appointment rules)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_webui["MVC pages<br/>[Controllers]"]
  node_webaccount["Account flows"]
  node_webappointments["Appointment pages"]
  node_webdoctor["Doctor pages"]
  node_webclient["API clients"]
  node_webgeneral["General API client"]
end

subgraph group_api["API workflows"]
  node_apihost["HTTP API<br/>[Program.cs]"]
  node_authapi["Authentication endpoints<br/>[AuthController.cs]"]
  node_apptapi["Appointment endpoints"]
  node_notifyapi["Notification endpoints"]
  node_availability["Availability"]
  node_adminapi["Admin operations<br/>[AdminController.cs]"]
  node_reportapi["Reports"]
  node_realtime["Real-time notifications<br/>[NotificationHub.cs]"]
end

subgraph group_services["Domain services"]
  node_authservice["Identity service<br/>[AuthService.cs]"]
  node_appointmentservice["Appointment rules"]
  node_scheduling["Schedule and leave"]
  node_adminservice["Administration<br/>[AdminService.cs]"]
  node_reportservice["Reporting service<br/>[ReportService.cs]"]
  node_notificationservice["Notification service"]
  node_domain["Domain entities and DTOs<br/>[Entities]"]
end

subgraph group_data["Persistence"]
  node_db[("EF Core database<br/>[AppDbContext.cs]")]
  node_repositories["Repositories<br/>[Repositories]"]
  node_uow["Unit of work<br/>[UnitOfWork.cs]"]
end

node_patients(("Patients"))
node_doctors(("Doctors"))
node_admins(("Administrators"))

node_patients -->|"use"| node_webui
node_doctors -->|"use"| node_webui
node_admins -->|"use"| node_webui
node_webui -->|"routes"| node_webaccount
node_webaccount -->|"calls"| node_webgeneral
node_webappointments -->|"calls"| node_webclient
node_webdoctor -->|"calls"| node_webclient
node_webclient -->|"HTTP requests"| node_apptapi
node_webgeneral -.->|"HTTP requests"| node_apihost
node_authapi -->|"delegates"| node_authservice
node_apptapi -->|"delegates"| node_appointmentservice
node_notifyapi -->|"delegates"| node_notificationservice
node_apihost -->|"registers"| node_authservice
node_apihost -->|"registers"| node_notificationservice
node_apihost -->|"registers"| node_reportservice
node_apihost -->|"registers"| node_scheduling
node_apihost -.->|"registers"| node_adminservice
node_apihost -.->|"registers"| node_appointmentservice
node_authservice -->|"uses repositories"| node_repositories
node_appointmentservice -.->|"uses repositories"| node_repositories
node_scheduling -.->|"uses repositories"| node_repositories
node_adminservice -.->|"uses repositories"| node_repositories
node_reportservice -->|"uses repositories"| node_repositories
node_notificationservice -.->|"uses repositories"| node_repositories
node_repositories -->|"queries and writes"| node_db
node_uow -.->|"coordinates"| node_db
node_appointmentservice -.->|"uses models"| node_domain
node_authservice -->|"creates profiles"| node_domain
node_availability -.->|"delegates"| node_scheduling
node_adminapi -.->|"delegates"| node_adminservice
node_reportapi -.->|"delegates"| node_reportservice
node_notifyapi -.->|"issues hub token"| node_realtime

click node_webui "https://github.com/mostafamo17/grad_depi/tree/main/src/MediCare.Web/Controllers"
click node_webaccount "https://github.com/mostafamo17/grad_depi/blob/main/src/MediCare.Web/Controllers/AccountController.cs"
click node_webappointments "https://github.com/mostafamo17/grad_depi/blob/main/src/MediCare.Web/Controllers/PatientAppointmentsController.cs"
click node_webdoctor "https://github.com/mostafamo17/grad_depi/blob/main/src/MediCare.Web/Controllers/DoctorAppointmentsController.cs"
click node_webclient "https://github.com/mostafamo17/grad_depi/blob/main/src/MediCare.Web/Services/AppointmentApiClient.cs"
click node_webgeneral "https://github.com/mostafamo17/grad_depi/blob/main/src/MediCare.Web/Services/MediCareApiClient.cs"
click node_apihost "https://github.com/mostafamo17/grad_depi/blob/main/src/MediCare.API/Program.cs"
click node_authapi "https://github.com/mostafamo17/grad_depi/blob/main/src/MediCare.API/Controllers/AuthController.cs"
click node_apptapi "https://github.com/mostafamo17/grad_depi/blob/main/src/MediCare.API/Controllers/AppointmentsController.cs"
click node_notifyapi "https://github.com/mostafamo17/grad_depi/blob/main/src/MediCare.API/Controllers/NotificationsController.cs"
click node_availability "https://github.com/mostafamo17/grad_depi/blob/main/src/MediCare.API/Controllers/DoctorAvailabilityController.cs"
click node_adminapi "https://github.com/mostafamo17/grad_depi/blob/main/src/MediCare.API/Controllers/AdminController.cs"
click node_reportapi "https://github.com/mostafamo17/grad_depi/blob/main/src/MediCare.API/Controllers/ReportsController.cs"
click node_realtime "https://github.com/mostafamo17/grad_depi/blob/main/src/MediCare.API/Hubs/NotificationHub.cs"
click node_authservice "https://github.com/mostafamo17/grad_depi/blob/main/src/MediCare.Services/Implementations/AuthService.cs"
click node_appointmentservice "https://github.com/mostafamo17/grad_depi/blob/main/src/MediCare.Services/Implementations/AppointmentService.cs"
click node_scheduling "https://github.com/mostafamo17/grad_depi/blob/main/src/MediCare.Services/Implementations/AvailabilityService.cs"
click node_adminservice "https://github.com/mostafamo17/grad_depi/blob/main/src/MediCare.Services/Implementations/AdminService.cs"
click node_reportservice "https://github.com/mostafamo17/grad_depi/blob/main/src/MediCare.Services/Implementations/ReportService.cs"
click node_notificationservice "https://github.com/mostafamo17/grad_depi/blob/main/src/MediCare.Services/Implementations/NotificationService.cs"
click node_domain "https://github.com/mostafamo17/grad_depi/tree/main/src/MediCare.Services/Entities"
click node_db "https://github.com/mostafamo17/grad_depi/blob/main/src/MediCare.Data/AppDbContext.cs"
click node_repositories "https://github.com/mostafamo17/grad_depi/tree/main/src/MediCare.Data/Repositories"
click node_uow "https://github.com/mostafamo17/grad_depi/blob/main/src/MediCare.Data/Repositories/UnitOfWork.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_webui,node_webaccount,node_webappointments,node_webdoctor,node_webclient,node_webgeneral toneBlue
class node_apihost,node_authapi,node_apptapi,node_notifyapi,node_availability,node_adminapi,node_reportapi,node_realtime toneAmber
class node_authservice,node_appointmentservice,node_scheduling,node_adminservice,node_reportservice,node_notificationservice,node_domain toneMint
class node_db,node_repositories,node_uow toneRose
class node_patients,node_doctors,node_admins toneIndigo
```

## Components

### Web experience

- [MVC pages](https://github.com/mostafamo17/grad_depi/tree/main/src/MediCare.Web/Controllers): `src/MediCare.Web/Controllers`
- [Account flows](https://github.com/mostafamo17/grad_depi/blob/main/src/MediCare.Web/Controllers/AccountController.cs): `src/MediCare.Web/Controllers/AccountController.cs`
- [Appointment pages](https://github.com/mostafamo17/grad_depi/blob/main/src/MediCare.Web/Controllers/PatientAppointmentsController.cs): `src/MediCare.Web/Controllers/PatientAppointmentsController.cs`
- [Doctor pages](https://github.com/mostafamo17/grad_depi/blob/main/src/MediCare.Web/Controllers/DoctorAppointmentsController.cs): `src/MediCare.Web/Controllers/DoctorAppointmentsController.cs`
- [API clients](https://github.com/mostafamo17/grad_depi/blob/main/src/MediCare.Web/Services/AppointmentApiClient.cs): `src/MediCare.Web/Services/AppointmentApiClient.cs`
- [General API client](https://github.com/mostafamo17/grad_depi/blob/main/src/MediCare.Web/Services/MediCareApiClient.cs): `src/MediCare.Web/Services/MediCareApiClient.cs`

### API workflows

- [HTTP API](https://github.com/mostafamo17/grad_depi/blob/main/src/MediCare.API/Program.cs): `src/MediCare.API/Program.cs`
- [Authentication endpoints](https://github.com/mostafamo17/grad_depi/blob/main/src/MediCare.API/Controllers/AuthController.cs): `src/MediCare.API/Controllers/AuthController.cs`
- [Appointment endpoints](https://github.com/mostafamo17/grad_depi/blob/main/src/MediCare.API/Controllers/AppointmentsController.cs): `src/MediCare.API/Controllers/AppointmentsController.cs`
- [Notification endpoints](https://github.com/mostafamo17/grad_depi/blob/main/src/MediCare.API/Controllers/NotificationsController.cs): `src/MediCare.API/Controllers/NotificationsController.cs`
- [Availability](https://github.com/mostafamo17/grad_depi/blob/main/src/MediCare.API/Controllers/DoctorAvailabilityController.cs): `src/MediCare.API/Controllers/DoctorAvailabilityController.cs`
- [Admin operations](https://github.com/mostafamo17/grad_depi/blob/main/src/MediCare.API/Controllers/AdminController.cs): `src/MediCare.API/Controllers/AdminController.cs`
- [Reports](https://github.com/mostafamo17/grad_depi/blob/main/src/MediCare.API/Controllers/ReportsController.cs): `src/MediCare.API/Controllers/ReportsController.cs`
- [Real-time notifications](https://github.com/mostafamo17/grad_depi/blob/main/src/MediCare.API/Hubs/NotificationHub.cs): `src/MediCare.API/Hubs/NotificationHub.cs`

### Domain services

- [Identity service](https://github.com/mostafamo17/grad_depi/blob/main/src/MediCare.Services/Implementations/AuthService.cs): `src/MediCare.Services/Implementations/AuthService.cs`
- [Appointment rules](https://github.com/mostafamo17/grad_depi/blob/main/src/MediCare.Services/Implementations/AppointmentService.cs): `src/MediCare.Services/Implementations/AppointmentService.cs`
- [Schedule and leave](https://github.com/mostafamo17/grad_depi/blob/main/src/MediCare.Services/Implementations/AvailabilityService.cs): `src/MediCare.Services/Implementations/AvailabilityService.cs`
- [Administration](https://github.com/mostafamo17/grad_depi/blob/main/src/MediCare.Services/Implementations/AdminService.cs): `src/MediCare.Services/Implementations/AdminService.cs`
- [Reporting service](https://github.com/mostafamo17/grad_depi/blob/main/src/MediCare.Services/Implementations/ReportService.cs): `src/MediCare.Services/Implementations/ReportService.cs`
- [Notification service](https://github.com/mostafamo17/grad_depi/blob/main/src/MediCare.Services/Implementations/NotificationService.cs): `src/MediCare.Services/Implementations/NotificationService.cs`
- [Domain entities and DTOs](https://github.com/mostafamo17/grad_depi/tree/main/src/MediCare.Services/Entities): `src/MediCare.Services/Entities`

### Persistence

- [EF Core database](https://github.com/mostafamo17/grad_depi/blob/main/src/MediCare.Data/AppDbContext.cs): `src/MediCare.Data/AppDbContext.cs`
- [Repositories](https://github.com/mostafamo17/grad_depi/tree/main/src/MediCare.Data/Repositories): `src/MediCare.Data/Repositories`
- [Unit of work](https://github.com/mostafamo17/grad_depi/blob/main/src/MediCare.Data/Repositories/UnitOfWork.cs): `src/MediCare.Data/Repositories/UnitOfWork.cs`

### Other components

- **Patients**
- **Doctors**
- **Administrators**

## Connections

- Patients → MVC pages: use
- Doctors → MVC pages: use
- Administrators → MVC pages: use
- MVC pages → Account flows: routes (evidence: `src/MediCare.Web/Controllers/AccountController.cs`)
- Account flows → General API client: calls (evidence: `src/MediCare.Web/Controllers/AccountController.cs`)
- Appointment pages → API clients: calls (evidence: `src/MediCare.Web/Controllers/PatientAppointmentsController.cs`)
- Doctor pages → API clients: calls (evidence: `src/MediCare.Web/Controllers/DoctorAppointmentsController.cs`)
- API clients → Appointment endpoints: HTTP requests (evidence: `src/MediCare.Web/Services/AppointmentApiClient.cs`)
- General API client → HTTP API: HTTP requests
- Authentication endpoints → Identity service: delegates (evidence: `src/MediCare.API/Controllers/AuthController.cs`)
- Appointment endpoints → Appointment rules: delegates (evidence: `src/MediCare.API/Controllers/AppointmentsController.cs`)
- Notification endpoints → Notification service: delegates (evidence: `src/MediCare.API/Controllers/NotificationsController.cs`)
- HTTP API → Identity service: registers (evidence: `src/MediCare.API/Program.cs`)
- HTTP API → Notification service: registers (evidence: `src/MediCare.API/Program.cs`)
- HTTP API → Reporting service: registers (evidence: `src/MediCare.API/Program.cs`)
- HTTP API → Schedule and leave: registers (evidence: `src/MediCare.API/Program.cs`)
- HTTP API → Administration: registers (evidence: `src/MediCare.API/Program.cs`)
- HTTP API → Appointment rules: registers (evidence: `src/MediCare.API/Program.cs`)
- Identity service → Repositories: uses repositories (evidence: `src/MediCare.Services/Implementations/AuthService.cs`)
- Appointment rules → Repositories: uses repositories
- Schedule and leave → Repositories: uses repositories
- Administration → Repositories: uses repositories
- Reporting service → Repositories: uses repositories (evidence: `src/MediCare.API/Program.cs`)
- Notification service → Repositories: uses repositories
- Repositories → EF Core database: queries and writes (evidence: `src/MediCare.Data/Repositories/AppointmentRepository.cs`)
- Unit of work → EF Core database: coordinates
- Appointment rules → Domain entities and DTOs: uses models (evidence: `src/MediCare.Services/Implementations/AppointmentService.cs`)
- Identity service → Domain entities and DTOs: creates profiles (evidence: `src/MediCare.Services/Implementations/AuthService.cs`)
- Availability → Schedule and leave: delegates
- Admin operations → Administration: delegates
- Reports → Reporting service: delegates
- Notification endpoints → Real-time notifications: issues hub token
