# ahmadtawela/lora-medical-tourism_system architecture

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

- Interactive diagram: https://gitdiagram.com/ahmadtawela/lora-medical-tourism_system
- Repository: https://github.com/ahmadtawela/lora-medical-tourism_system

## Overview

Lora Clinic is a medical-tourism clinic management system with separate admin and patient experiences. Users sign in through the React app; its API client sends Bearer-token requests to Laravel, which dispatches role-specific dashboard and domain operations. Admins manage patients, invoices, reports, and notifications; patients view their own records and can upload reports. The documented product also supports patient invitations, spreadsheet import, and overdue/upcoming-operation reminders. Edges follow the supplied source and README; detailed wiring for unsampled controllers and notification implementations is not inferred.

Main entry points: [`lora-clinic-backend/lora/app/Notifications`](https://github.com/ahmadtawela/lora-medical-tourism_system/tree/main/lora-clinic-backend/lora/app/Notifications) (Notification types), [`lora-clinic-backend/lora/routes/api.php`](https://github.com/ahmadtawela/lora-medical-tourism_system/blob/main/lora-clinic-backend/lora/routes/api.php) (API routes), [`lora-clinic-backend/lora/app/Models`](https://github.com/ahmadtawela/lora-medical-tourism_system/tree/main/lora-clinic-backend/lora/app/Models) (Clinic models), [`lora- clinic -front/src/api/lora-clinic-api-client.js`](https://github.com/ahmadtawela/lora-medical-tourism_system/blob/main/lora-%20clinic%20-front/src/api/lora-clinic-api-client.js) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_app["App and portals<br/>[App.jsx]"]
  node_authcontext["Auth context<br/>[AuthContext.jsx]"]
  node_client["API client"]
  node_adminpages["Admin pages"]
  node_patientpages["Patient pages"]
  node_loginpage["Login page<br/>[LoginPage.jsx]"]
end

subgraph group_api["API and access"]
  node_routes["API routes<br/>[api.php]"]
  node_unifiedauth["Unified login"]
  node_middleware["Role middleware"]
end

subgraph group_records["Clinic records"]
  node_admincontrollers["Admin controllers"]
  node_patientcontrollers["Patient controllers"]
end

subgraph group_messaging["Import and messaging"]
  node_importcontroller["Import endpoint"]
  node_importservice["Patient import"]
  node_observer["Report observer"]
  node_notifications["Notification types"]
  node_whatsapp["WhatsApp channel"]
  node_whatsappservice["WhatsApp service"]
  node_scheduler["Reminder commands"]
end

subgraph group_persistence["Persistent state"]
  node_models["Clinic models"]
  node_database[("Clinic database<br/>[database.php]")]
end

node_admin(("Clinic admin"))
node_patient(("Patient"))
node_mail{{"Email service"}}
node_meta{{"WhatsApp Cloud API"}}

node_admin -->|"signs in"| node_loginpage
node_patient -->|"signs in"| node_loginpage
node_loginpage -->|"submits credentials"| node_authcontext
node_authcontext -->|"calls auth"| node_client
node_app -->|"reads session"| node_authcontext
node_app -->|"renders admin"| node_adminpages
node_app -->|"renders patient"| node_patientpages
node_adminpages -->|"requests admin data"| node_client
node_patientpages -->|"requests patient data"| node_client
node_client -->|"sends API requests"| node_routes
node_routes -->|"dispatches login"| node_unifiedauth
node_routes -->|"applies role checks"| node_middleware
node_routes -->|"dispatches admin"| node_admincontrollers
node_routes -->|"dispatches patient"| node_patientcontrollers
node_admincontrollers -->|"reads and writes"| node_models
node_patientcontrollers -->|"reads and writes"| node_models
node_unifiedauth -->|"checks accounts"| node_models
node_models -->|"persists records"| node_database
node_importcontroller -->|"processes file"| node_importservice
node_importservice -->|"creates patients and invoices"| node_models
node_importservice -->|"sends invitations"| node_notifications
node_admincontrollers -->|"sends invitations"| node_notifications
node_observer -->|"triggers report notice"| node_notifications
node_scheduler -->|"sends reminders"| node_notifications
node_notifications -.->|"delivers email"| node_mail
node_notifications -.->|"dispatches channel"| node_whatsapp
node_whatsapp -->|"sends message"| node_whatsappservice
node_whatsappservice -->|"calls Cloud API"| node_meta

click node_app "https://github.com/ahmadtawela/lora-medical-tourism_system/blob/main/lora-%20clinic%20-front/src/app/App.jsx"
click node_authcontext "https://github.com/ahmadtawela/lora-medical-tourism_system/blob/main/lora-%20clinic%20-front/src/api/AuthContext.jsx"
click node_client "https://github.com/ahmadtawela/lora-medical-tourism_system/blob/main/lora-%20clinic%20-front/src/api/lora-clinic-api-client.js"
click node_adminpages "https://github.com/ahmadtawela/lora-medical-tourism_system/tree/main/lora-%20clinic%20-front/src/pages/admin"
click node_patientpages "https://github.com/ahmadtawela/lora-medical-tourism_system/tree/main/lora-%20clinic%20-front/src/pages/patient"
click node_loginpage "https://github.com/ahmadtawela/lora-medical-tourism_system/blob/main/lora-%20clinic%20-front/src/pages/LoginPage.jsx"
click node_routes "https://github.com/ahmadtawela/lora-medical-tourism_system/blob/main/lora-clinic-backend/lora/routes/api.php"
click node_unifiedauth "https://github.com/ahmadtawela/lora-medical-tourism_system/blob/main/lora-clinic-backend/lora/app/Http/Controllers/Api/Auth/UnifiedAuthController.php"
click node_middleware "https://github.com/ahmadtawela/lora-medical-tourism_system/tree/main/lora-clinic-backend/lora/app/Http/Middleware"
click node_admincontrollers "https://github.com/ahmadtawela/lora-medical-tourism_system/tree/main/lora-clinic-backend/lora/app/Http/Controllers/Api/Admin"
click node_patientcontrollers "https://github.com/ahmadtawela/lora-medical-tourism_system/tree/main/lora-clinic-backend/lora/app/Http/Controllers/Api/Patient"
click node_models "https://github.com/ahmadtawela/lora-medical-tourism_system/tree/main/lora-clinic-backend/lora/app/Models"
click node_database "https://github.com/ahmadtawela/lora-medical-tourism_system/blob/main/lora-clinic-backend/lora/config/database.php"
click node_importcontroller "https://github.com/ahmadtawela/lora-medical-tourism_system/blob/main/lora-clinic-backend/lora/app/Http/Controllers/Api/Admin/PatientImportController.php"
click node_importservice "https://github.com/ahmadtawela/lora-medical-tourism_system/blob/main/lora-clinic-backend/lora/app/Services/PatientImportService.php"
click node_observer "https://github.com/ahmadtawela/lora-medical-tourism_system/blob/main/lora-clinic-backend/lora/app/Observers/MedicalReportObserver.php"
click node_notifications "https://github.com/ahmadtawela/lora-medical-tourism_system/tree/main/lora-clinic-backend/lora/app/Notifications"
click node_whatsapp "https://github.com/ahmadtawela/lora-medical-tourism_system/blob/main/lora-clinic-backend/lora/app/Notifications/Channels/WhatsAppChannel.php"
click node_whatsappservice "https://github.com/ahmadtawela/lora-medical-tourism_system/blob/main/lora-clinic-backend/lora/app/Services/WhatsAppService.php"
click node_scheduler "https://github.com/ahmadtawela/lora-medical-tourism_system/tree/main/lora-clinic-backend/lora/app/Console/Commands"

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_authcontext,node_client,node_adminpages,node_patientpages,node_loginpage toneBlue
class node_routes,node_unifiedauth,node_middleware toneAmber
class node_admincontrollers,node_patientcontrollers,node_meta toneMint
class node_importcontroller,node_importservice,node_observer,node_notifications,node_whatsapp,node_whatsappservice,node_scheduler toneRose
class node_models,node_database,node_admin,node_patient,node_mail toneIndigo
```

## Components

### Web application

- [App and portals](https://github.com/ahmadtawela/lora-medical-tourism_system/blob/main/lora-%20clinic%20-front/src/app/App.jsx): `lora- clinic -front/src/app/App.jsx`
- [Auth context](https://github.com/ahmadtawela/lora-medical-tourism_system/blob/main/lora-%20clinic%20-front/src/api/AuthContext.jsx): `lora- clinic -front/src/api/AuthContext.jsx`
- [API client](https://github.com/ahmadtawela/lora-medical-tourism_system/blob/main/lora-%20clinic%20-front/src/api/lora-clinic-api-client.js): `lora- clinic -front/src/api/lora-clinic-api-client.js`
- [Admin pages](https://github.com/ahmadtawela/lora-medical-tourism_system/tree/main/lora-%20clinic%20-front/src/pages/admin): `lora- clinic -front/src/pages/admin`
- [Patient pages](https://github.com/ahmadtawela/lora-medical-tourism_system/tree/main/lora-%20clinic%20-front/src/pages/patient): `lora- clinic -front/src/pages/patient`
- [Login page](https://github.com/ahmadtawela/lora-medical-tourism_system/blob/main/lora-%20clinic%20-front/src/pages/LoginPage.jsx): `lora- clinic -front/src/pages/LoginPage.jsx`

### API and access

- [API routes](https://github.com/ahmadtawela/lora-medical-tourism_system/blob/main/lora-clinic-backend/lora/routes/api.php): `lora-clinic-backend/lora/routes/api.php`
- [Unified login](https://github.com/ahmadtawela/lora-medical-tourism_system/blob/main/lora-clinic-backend/lora/app/Http/Controllers/Api/Auth/UnifiedAuthController.php): `lora-clinic-backend/lora/app/Http/Controllers/Api/Auth/UnifiedAuthController.php`
- [Role middleware](https://github.com/ahmadtawela/lora-medical-tourism_system/tree/main/lora-clinic-backend/lora/app/Http/Middleware): `lora-clinic-backend/lora/app/Http/Middleware`

### Clinic records

- [Admin controllers](https://github.com/ahmadtawela/lora-medical-tourism_system/tree/main/lora-clinic-backend/lora/app/Http/Controllers/Api/Admin): `lora-clinic-backend/lora/app/Http/Controllers/Api/Admin`
- [Patient controllers](https://github.com/ahmadtawela/lora-medical-tourism_system/tree/main/lora-clinic-backend/lora/app/Http/Controllers/Api/Patient): `lora-clinic-backend/lora/app/Http/Controllers/Api/Patient`

### Import and messaging

- [Import endpoint](https://github.com/ahmadtawela/lora-medical-tourism_system/blob/main/lora-clinic-backend/lora/app/Http/Controllers/Api/Admin/PatientImportController.php): `lora-clinic-backend/lora/app/Http/Controllers/Api/Admin/PatientImportController.php`
- [Patient import](https://github.com/ahmadtawela/lora-medical-tourism_system/blob/main/lora-clinic-backend/lora/app/Services/PatientImportService.php): `lora-clinic-backend/lora/app/Services/PatientImportService.php`
- [Report observer](https://github.com/ahmadtawela/lora-medical-tourism_system/blob/main/lora-clinic-backend/lora/app/Observers/MedicalReportObserver.php): `lora-clinic-backend/lora/app/Observers/MedicalReportObserver.php`
- [Notification types](https://github.com/ahmadtawela/lora-medical-tourism_system/tree/main/lora-clinic-backend/lora/app/Notifications): `lora-clinic-backend/lora/app/Notifications`
- [WhatsApp channel](https://github.com/ahmadtawela/lora-medical-tourism_system/blob/main/lora-clinic-backend/lora/app/Notifications/Channels/WhatsAppChannel.php): `lora-clinic-backend/lora/app/Notifications/Channels/WhatsAppChannel.php`
- [WhatsApp service](https://github.com/ahmadtawela/lora-medical-tourism_system/blob/main/lora-clinic-backend/lora/app/Services/WhatsAppService.php): `lora-clinic-backend/lora/app/Services/WhatsAppService.php`
- [Reminder commands](https://github.com/ahmadtawela/lora-medical-tourism_system/tree/main/lora-clinic-backend/lora/app/Console/Commands): `lora-clinic-backend/lora/app/Console/Commands`

### Persistent state

- [Clinic models](https://github.com/ahmadtawela/lora-medical-tourism_system/tree/main/lora-clinic-backend/lora/app/Models): `lora-clinic-backend/lora/app/Models`
- [Clinic database](https://github.com/ahmadtawela/lora-medical-tourism_system/blob/main/lora-clinic-backend/lora/config/database.php): `lora-clinic-backend/lora/config/database.php`

### Other components

- **Clinic admin**
- **Patient**
- **Email service**
- **WhatsApp Cloud API**

## Connections

- Clinic admin → Login page: signs in
- Patient → Login page: signs in
- Login page → Auth context: submits credentials
- Auth context → API client: calls auth
- App and portals → Auth context: reads session
- App and portals → Admin pages: renders admin
- App and portals → Patient pages: renders patient
- Admin pages → API client: requests admin data
- Patient pages → API client: requests patient data
- API client → API routes: sends API requests
- API routes → Unified login: dispatches login
- API routes → Role middleware: applies role checks
- API routes → Admin controllers: dispatches admin
- API routes → Patient controllers: dispatches patient
- Admin controllers → Clinic models: reads and writes
- Patient controllers → Clinic models: reads and writes
- Unified login → Clinic models: checks accounts
- Clinic models → Clinic database: persists records
- Import endpoint → Patient import: processes file
- Patient import → Clinic models: creates patients and invoices
- Patient import → Notification types: sends invitations
- Admin controllers → Notification types: sends invitations
- Report observer → Notification types: triggers report notice
- Reminder commands → Notification types: sends reminders
- Notification types → Email service: delivers email
- Notification types → WhatsApp channel: dispatches channel
- WhatsApp channel → WhatsApp service: sends message
- WhatsApp service → WhatsApp Cloud API: calls Cloud API
