# mohamedfawzy29/shefaa architecture

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

- Interactive diagram: https://gitdiagram.com/mohamedfawzy29/shefaa
- Repository: https://github.com/mohamedfawzy29/shefaa

## Overview

Shefaa is a multi-role clinic and appointment platform. Patients discover doctors, book appointments, attend a branch, and receive medical records; completed visits can lead to reviews. Doctors configure branch membership and schedules, receptionists manage check-in and no-shows, and administrators oversee clinic resources and analytics. The React frontend is organized by feature and calls an area-based ASP.NET API backed by Entity Framework and SQL Server. The README documents the broader capabilities; sampled sources confirm selected controller, persistence, authentication, and review behavior, but not every feature’s wiring.

Main entry points: [`Frontend/src/app/App.tsx`](https://github.com/mohamedfawzy29/shefaa/blob/master/Frontend/src/app/App.tsx) (React application), [`Backend/Shefaa/Repositories/IRepository.cs`](https://github.com/mohamedfawzy29/shefaa/blob/master/Backend/Shefaa/Repositories/IRepository.cs) (Repository access), [`Backend/Shefaa/Data/ApplicationDbContext.cs`](https://github.com/mohamedfawzy29/shefaa/blob/master/Backend/Shefaa/Data/ApplicationDbContext.cs) (SQL Server data), [`Backend/Shefaa/Areas/Patient/Controllers/ReviewsController.cs`](https://github.com/mohamedfawzy29/shefaa/blob/master/Backend/Shefaa/Areas/Patient/Controllers/ReviewsController.cs) (Review handling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend experience"]
  node_webapp["React application<br/>[App.tsx]"]
  node_auth["Authentication<br/>[authService.ts]"]
  node_discovery["Doctor discovery"]
  node_booking["Patient appointments"]
  node_staffappointments["Staff appointments"]
  node_clinicui["Clinic scheduling"]
  node_medicalui["Medical history"]
  node_reviewsui["Reviews"]
  node_adminui["Admin management<br/>[branchService.ts]"]
end

subgraph group_clinical["Clinical workflows"]
  node_identityapi["Identity and profile"]
  node_lookupapi["Public lookups"]
  node_patientapi["Patient appointments"]
  node_clinicapi["Doctor clinic and schedule"]
  node_receptionapi["Front desk"]
  node_medicalapi["Medical records"]
  node_reviewapi["Review handling"]
end

subgraph group_operations["Clinic administration"]
  node_adminapi["Admin operations"]
  node_analytics["Admin analytics"]
end

subgraph group_platform["Platform services"]
  node_repository["Repository access<br/>[IRepository.cs]"]
  node_doctorservice["Doctor rating service<br/>[IDoctorService.cs]"]
  node_database[("SQL Server data")]
end

node_visitor(("Visitor / patient"))
node_doctor(("Doctor"))
node_receptionist(("Receptionist"))
node_admin(("Administrator"))

node_visitor -->|"uses"| node_webapp
node_doctor -->|"uses"| node_webapp
node_receptionist -->|"uses"| node_webapp
node_admin -->|"uses"| node_webapp
node_webapp -->|"routes through"| node_auth
node_webapp -->|"offers discovery"| node_discovery
node_visitor -->|"registers"| node_auth
node_auth -->|"sends auth requests"| node_identityapi
node_discovery -.->|"requests lookups"| node_lookupapi
node_visitor -->|"books visit"| node_booking
node_booking -.->|"sends booking requests"| node_patientapi
node_patientapi -->|"reads and writes"| node_repository
node_doctor -->|"sets availability"| node_clinicui
node_clinicui -.->|"manages schedules"| node_clinicapi
node_clinicapi -->|"queries data"| node_database
node_receptionist -->|"manages visits"| node_staffappointments
node_staffappointments -.->|"sends appointment requests"| node_receptionapi
node_receptionapi -->|"reads and writes"| node_repository
node_doctor -->|"records consultation"| node_medicalui
node_medicalui -.->|"sends record requests"| node_medicalapi
node_medicalapi -->|"queries data"| node_database
node_visitor -->|"leaves review"| node_reviewsui
node_reviewsui -.->|"sends review requests"| node_reviewapi
node_reviewapi -->|"reads and writes"| node_repository
node_reviewapi -->|"recalculates rating"| node_doctorservice
node_doctorservice -.->|"updates doctor rating"| node_database
node_admin -->|"manages clinics"| node_adminui
node_adminui -.->|"sends management requests"| node_adminapi
node_admin -->|"views analytics"| node_analytics
node_adminapi -.->|"accesses records"| node_repository
node_analytics -.->|"summarizes data"| node_database
node_repository -.->|"persists entities"| node_database

click node_webapp "https://github.com/mohamedfawzy29/shefaa/blob/master/Frontend/src/app/App.tsx"
click node_auth "https://github.com/mohamedfawzy29/shefaa/blob/master/Frontend/src/features/auth/services/authService.ts"
click node_discovery "https://github.com/mohamedfawzy29/shefaa/blob/master/Frontend/src/features/patient-appointments/services/patientDoctorService.ts"
click node_booking "https://github.com/mohamedfawzy29/shefaa/blob/master/Frontend/src/features/patient-appointments/services/patientAppointmentService.ts"
click node_staffappointments "https://github.com/mohamedfawzy29/shefaa/blob/master/Frontend/src/features/appointments/services/appointmentService.ts"
click node_clinicui "https://github.com/mohamedfawzy29/shefaa/blob/master/Frontend/src/features/doctor-clinic/services/doctorClinicService.ts"
click node_medicalui "https://github.com/mohamedfawzy29/shefaa/blob/master/Frontend/src/features/patient-medical/services/patientMedicalService.ts"
click node_reviewsui "https://github.com/mohamedfawzy29/shefaa/blob/master/Frontend/src/features/reviews/services/patientReviewService.ts"
click node_adminui "https://github.com/mohamedfawzy29/shefaa/blob/master/Frontend/src/features/branches/services/branchService.ts"
click node_identityapi "https://github.com/mohamedfawzy29/shefaa/tree/master/Backend/Shefaa/Areas/Identity/Controllers"
click node_lookupapi "https://github.com/mohamedfawzy29/shefaa/blob/master/Backend/Shefaa/Public%20Controllers/LookupController.cs"
click node_patientapi "https://github.com/mohamedfawzy29/shefaa/blob/master/Backend/Shefaa/Areas/Patient/Controllers/AppiontmentController.cs"
click node_clinicapi "https://github.com/mohamedfawzy29/shefaa/blob/master/Backend/Shefaa/Areas/DoctorArea/Controllers/DoctorClinicController.cs"
click node_receptionapi "https://github.com/mohamedfawzy29/shefaa/blob/master/Backend/Shefaa/Areas/Receptionist/Controllers/AppointmentController.cs"
click node_medicalapi "https://github.com/mohamedfawzy29/shefaa/blob/master/Backend/Shefaa/Areas/DoctorArea/Controllers/DoctorMedicalController.cs"
click node_reviewapi "https://github.com/mohamedfawzy29/shefaa/blob/master/Backend/Shefaa/Areas/Patient/Controllers/ReviewsController.cs"
click node_adminapi "https://github.com/mohamedfawzy29/shefaa/tree/master/Backend/Shefaa/Areas/Admin/Controllers"
click node_analytics "https://github.com/mohamedfawzy29/shefaa/blob/master/Backend/Shefaa/Areas/Admin/Controllers/DashboardController.cs"
click node_repository "https://github.com/mohamedfawzy29/shefaa/blob/master/Backend/Shefaa/Repositories/IRepository.cs"
click node_doctorservice "https://github.com/mohamedfawzy29/shefaa/blob/master/Backend/Shefaa/Services/IDoctorService.cs"
click node_database "https://github.com/mohamedfawzy29/shefaa/blob/master/Backend/Shefaa/Data/ApplicationDbContext.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_webapp,node_auth,node_discovery,node_booking,node_staffappointments,node_clinicui,node_medicalui,node_reviewsui,node_adminui toneBlue
class node_identityapi,node_lookupapi,node_patientapi,node_clinicapi,node_receptionapi,node_medicalapi,node_reviewapi toneAmber
class node_adminapi,node_analytics toneMint
class node_repository,node_doctorservice,node_database toneRose
class node_visitor,node_doctor,node_receptionist,node_admin toneIndigo
```

## Components

### Frontend experience

- [React application](https://github.com/mohamedfawzy29/shefaa/blob/master/Frontend/src/app/App.tsx): `Frontend/src/app/App.tsx`
- [Authentication](https://github.com/mohamedfawzy29/shefaa/blob/master/Frontend/src/features/auth/services/authService.ts): `Frontend/src/features/auth/services/authService.ts`
- [Doctor discovery](https://github.com/mohamedfawzy29/shefaa/blob/master/Frontend/src/features/patient-appointments/services/patientDoctorService.ts): `Frontend/src/features/patient-appointments/services/patientDoctorService.ts`
- [Patient appointments](https://github.com/mohamedfawzy29/shefaa/blob/master/Frontend/src/features/patient-appointments/services/patientAppointmentService.ts): `Frontend/src/features/patient-appointments/services/patientAppointmentService.ts`
- [Staff appointments](https://github.com/mohamedfawzy29/shefaa/blob/master/Frontend/src/features/appointments/services/appointmentService.ts): `Frontend/src/features/appointments/services/appointmentService.ts`
- [Clinic scheduling](https://github.com/mohamedfawzy29/shefaa/blob/master/Frontend/src/features/doctor-clinic/services/doctorClinicService.ts): `Frontend/src/features/doctor-clinic/services/doctorClinicService.ts`
- [Medical history](https://github.com/mohamedfawzy29/shefaa/blob/master/Frontend/src/features/patient-medical/services/patientMedicalService.ts): `Frontend/src/features/patient-medical/services/patientMedicalService.ts`
- [Reviews](https://github.com/mohamedfawzy29/shefaa/blob/master/Frontend/src/features/reviews/services/patientReviewService.ts): `Frontend/src/features/reviews/services/patientReviewService.ts`
- [Admin management](https://github.com/mohamedfawzy29/shefaa/blob/master/Frontend/src/features/branches/services/branchService.ts): `Frontend/src/features/branches/services/branchService.ts`

### Clinical workflows

- [Identity and profile](https://github.com/mohamedfawzy29/shefaa/tree/master/Backend/Shefaa/Areas/Identity/Controllers): `Backend/Shefaa/Areas/Identity/Controllers`
- [Public lookups](https://github.com/mohamedfawzy29/shefaa/blob/master/Backend/Shefaa/Public%20Controllers/LookupController.cs): `Backend/Shefaa/Public Controllers/LookupController.cs`
- [Patient appointments](https://github.com/mohamedfawzy29/shefaa/blob/master/Backend/Shefaa/Areas/Patient/Controllers/AppiontmentController.cs): `Backend/Shefaa/Areas/Patient/Controllers/AppiontmentController.cs`
- [Doctor clinic and schedule](https://github.com/mohamedfawzy29/shefaa/blob/master/Backend/Shefaa/Areas/DoctorArea/Controllers/DoctorClinicController.cs): `Backend/Shefaa/Areas/DoctorArea/Controllers/DoctorClinicController.cs`
- [Front desk](https://github.com/mohamedfawzy29/shefaa/blob/master/Backend/Shefaa/Areas/Receptionist/Controllers/AppointmentController.cs): `Backend/Shefaa/Areas/Receptionist/Controllers/AppointmentController.cs`
- [Medical records](https://github.com/mohamedfawzy29/shefaa/blob/master/Backend/Shefaa/Areas/DoctorArea/Controllers/DoctorMedicalController.cs): `Backend/Shefaa/Areas/DoctorArea/Controllers/DoctorMedicalController.cs`
- [Review handling](https://github.com/mohamedfawzy29/shefaa/blob/master/Backend/Shefaa/Areas/Patient/Controllers/ReviewsController.cs): `Backend/Shefaa/Areas/Patient/Controllers/ReviewsController.cs`

### Clinic administration

- [Admin operations](https://github.com/mohamedfawzy29/shefaa/tree/master/Backend/Shefaa/Areas/Admin/Controllers): `Backend/Shefaa/Areas/Admin/Controllers`
- [Admin analytics](https://github.com/mohamedfawzy29/shefaa/blob/master/Backend/Shefaa/Areas/Admin/Controllers/DashboardController.cs): `Backend/Shefaa/Areas/Admin/Controllers/DashboardController.cs`

### Platform services

- [Repository access](https://github.com/mohamedfawzy29/shefaa/blob/master/Backend/Shefaa/Repositories/IRepository.cs): `Backend/Shefaa/Repositories/IRepository.cs`
- [Doctor rating service](https://github.com/mohamedfawzy29/shefaa/blob/master/Backend/Shefaa/Services/IDoctorService.cs): `Backend/Shefaa/Services/IDoctorService.cs`
- [SQL Server data](https://github.com/mohamedfawzy29/shefaa/blob/master/Backend/Shefaa/Data/ApplicationDbContext.cs): `Backend/Shefaa/Data/ApplicationDbContext.cs`

### Other components

- **Visitor / patient**
- **Doctor**
- **Receptionist**
- **Administrator**

## Connections

- Visitor / patient → React application: uses
- Doctor → React application: uses
- Receptionist → React application: uses
- Administrator → React application: uses
- React application → Authentication: routes through (evidence: `Frontend/src/app/App.tsx`)
- React application → Doctor discovery: offers discovery
- Visitor / patient → Authentication: registers
- Authentication → Identity and profile: sends auth requests (evidence: `Frontend/src/features/auth/services/authService.ts`)
- Doctor discovery → Public lookups: requests lookups
- Visitor / patient → Patient appointments: books visit
- Patient appointments → Patient appointments: sends booking requests
- Patient appointments → Repository access: reads and writes (evidence: `Backend/Shefaa/Areas/Patient/Controllers/AppiontmentController.cs`)
- Doctor → Clinic scheduling: sets availability
- Clinic scheduling → Doctor clinic and schedule: manages schedules
- Doctor clinic and schedule → SQL Server data: queries data (evidence: `Backend/Shefaa/Areas/DoctorArea/Controllers/DoctorClinicController.cs`)
- Receptionist → Staff appointments: manages visits
- Staff appointments → Front desk: sends appointment requests
- Front desk → Repository access: reads and writes (evidence: `Backend/Shefaa/Areas/Receptionist/Controllers/AppointmentController.cs`)
- Doctor → Medical history: records consultation
- Medical history → Medical records: sends record requests
- Medical records → SQL Server data: queries data (evidence: `Backend/Shefaa/Areas/DoctorArea/Controllers/DoctorMedicalController.cs`)
- Visitor / patient → Reviews: leaves review
- Reviews → Review handling: sends review requests
- Review handling → Repository access: reads and writes (evidence: `Backend/Shefaa/Areas/Patient/Controllers/ReviewsController.cs`)
- Review handling → Doctor rating service: recalculates rating (evidence: `Backend/Shefaa/Areas/Patient/Controllers/ReviewsController.cs`)
- Doctor rating service → SQL Server data: updates doctor rating
- Administrator → Admin management: manages clinics
- Admin management → Admin operations: sends management requests
- Administrator → Admin analytics: views analytics
- Admin operations → Repository access: accesses records (evidence: `Backend/Shefaa/Areas/Admin/Controllers/ReviewController.cs`)
- Admin analytics → SQL Server data: summarizes data
- Repository access → SQL Server data: persists entities
