# nourhankhal3d/afyatech-architecture architecture

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

- Interactive diagram: https://gitdiagram.com/nourhankhal3d/afyatech-architecture
- Repository: https://github.com/nourhankhal3d/afyatech-architecture

## Overview

AfyaTech is a Flutter/Firebase clinic-care architecture implementation. The principal patient workflow is doctor discovery, appointment booking and payment, then live queue tracking with travel-time guidance; clinic staff manage schedules, check-in and consultations. Identity, medical records, notifications, and administrative capabilities support that workflow. The README documents the layered design and intended integrations, but no source excerpts were provided, so edges below reflect documented relationships rather than verified calls in sampled code.

Main entry points: [`lib/QueueModule`](https://github.com/nourhankhal3d/afyatech-architecture/tree/main/lib/QueueModule) (Live queue), [`lib/PaymentModule`](https://github.com/nourhankhal3d/afyatech-architecture/tree/main/lib/PaymentModule) (Payments and refunds), [`lib/BookingModule`](https://github.com/nourhankhal3d/afyatech-architecture/tree/main/lib/BookingModule) (Appointment booking), [`lib/ETAModule`](https://github.com/nourhankhal3d/afyatech-architecture/tree/main/lib/ETAModule) (Travel-time guidance)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_care["Patient care"]
  node_doctor_discovery["Doctor discovery"]
  node_booking["Appointment booking"]
  node_payment["Payments and refunds"]
  node_queue["Live queue"]
  node_eta["Travel-time guidance"]
  node_medical_file["Medical records"]
end

subgraph group_clinic["Clinic operations"]
  node_scheduling["Clinic schedules"]
  node_consultation["Consultation workflow<br/>[visit_service.dart]"]
end

subgraph group_platform["Shared platform"]
  node_identity["Accounts and verification"]
  node_notifications["Patient notifications"]
  node_subscriptions["Subscriptions and invoices"]
  node_firestore[("Cloud Firestore")]
end

subgraph group_governance["Administration"]
  node_audit["Audit and monitoring"]
  node_reporting["Operational reports"]
end

node_patient(("Patient"))
node_clinic_staff(("Clinic staff"))
node_admin(("Administrators"))
node_payment_gateway["Payment gateway"]
node_push_sms["Push and SMS"]
node_maps["Maps service"]

node_patient -->|"searches doctors"| node_doctor_discovery
node_patient -->|"books slot"| node_booking
node_patient -->|"pays"| node_payment
node_patient -->|"tracks turn"| node_queue
node_queue -->|"guides arrival"| node_eta
node_patient -->|"views records"| node_medical_file
node_clinic_staff -->|"sets schedule"| node_scheduling
node_clinic_staff -->|"checks in"| node_queue
node_clinic_staff -->|"records visit"| node_consultation
node_admin -->|"verifies doctors"| node_identity
node_admin -->|"handles refunds"| node_payment
node_admin -->|"reads audit logs"| node_audit
node_booking -->|"stores data"| node_firestore
node_payment -->|"uses adapter"| node_payment_gateway
node_notifications -->|"sends alerts"| node_push_sms
node_eta -->|"gets travel time"| node_maps
node_identity -->|"stores data"| node_firestore
node_queue -->|"stores data"| node_firestore
node_medical_file -->|"stores data"| node_firestore

click node_doctor_discovery "https://github.com/nourhankhal3d/afyatech-architecture/tree/main/lib/ClinicModule"
click node_booking "https://github.com/nourhankhal3d/afyatech-architecture/tree/main/lib/BookingModule"
click node_payment "https://github.com/nourhankhal3d/afyatech-architecture/tree/main/lib/PaymentModule"
click node_queue "https://github.com/nourhankhal3d/afyatech-architecture/tree/main/lib/QueueModule"
click node_eta "https://github.com/nourhankhal3d/afyatech-architecture/tree/main/lib/ETAModule"
click node_medical_file "https://github.com/nourhankhal3d/afyatech-architecture/tree/main/lib/MedicalFileModule"
click node_identity "https://github.com/nourhankhal3d/afyatech-architecture/tree/main/lib/IdentityModule"
click node_notifications "https://github.com/nourhankhal3d/afyatech-architecture/tree/main/lib/NotificationModule"
click node_subscriptions "https://github.com/nourhankhal3d/afyatech-architecture/tree/main/lib/SubscriptionModule"
click node_scheduling "https://github.com/nourhankhal3d/afyatech-architecture/blob/main/lib/ClinicModule/Logic/schedule_service.dart"
click node_consultation "https://github.com/nourhankhal3d/afyatech-architecture/blob/main/lib/MedicalFileModule/Logic/visit_service.dart"
click node_audit "https://github.com/nourhankhal3d/afyatech-architecture/tree/main/lib/AuditModule"
click node_reporting "https://github.com/nourhankhal3d/afyatech-architecture/tree/main/lib/ReportingModule"

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_doctor_discovery,node_booking,node_payment,node_queue,node_eta,node_medical_file toneBlue
class node_scheduling,node_consultation toneAmber
class node_identity,node_notifications,node_subscriptions,node_firestore toneMint
class node_audit,node_reporting toneRose
class node_patient,node_clinic_staff,node_admin,node_payment_gateway,node_push_sms,node_maps toneIndigo
```

## Components

### Patient care

- [Doctor discovery](https://github.com/nourhankhal3d/afyatech-architecture/tree/main/lib/ClinicModule): `lib/ClinicModule`
- [Appointment booking](https://github.com/nourhankhal3d/afyatech-architecture/tree/main/lib/BookingModule): `lib/BookingModule`
- [Payments and refunds](https://github.com/nourhankhal3d/afyatech-architecture/tree/main/lib/PaymentModule): `lib/PaymentModule`
- [Live queue](https://github.com/nourhankhal3d/afyatech-architecture/tree/main/lib/QueueModule): `lib/QueueModule`
- [Travel-time guidance](https://github.com/nourhankhal3d/afyatech-architecture/tree/main/lib/ETAModule): `lib/ETAModule`
- [Medical records](https://github.com/nourhankhal3d/afyatech-architecture/tree/main/lib/MedicalFileModule): `lib/MedicalFileModule`

### Clinic operations

- [Clinic schedules](https://github.com/nourhankhal3d/afyatech-architecture/blob/main/lib/ClinicModule/Logic/schedule_service.dart): `lib/ClinicModule/Logic/schedule_service.dart`
- [Consultation workflow](https://github.com/nourhankhal3d/afyatech-architecture/blob/main/lib/MedicalFileModule/Logic/visit_service.dart): `lib/MedicalFileModule/Logic/visit_service.dart`

### Shared platform

- [Accounts and verification](https://github.com/nourhankhal3d/afyatech-architecture/tree/main/lib/IdentityModule): `lib/IdentityModule`
- [Patient notifications](https://github.com/nourhankhal3d/afyatech-architecture/tree/main/lib/NotificationModule): `lib/NotificationModule`
- [Subscriptions and invoices](https://github.com/nourhankhal3d/afyatech-architecture/tree/main/lib/SubscriptionModule): `lib/SubscriptionModule`
- **Cloud Firestore**

### Administration

- [Audit and monitoring](https://github.com/nourhankhal3d/afyatech-architecture/tree/main/lib/AuditModule): `lib/AuditModule`
- [Operational reports](https://github.com/nourhankhal3d/afyatech-architecture/tree/main/lib/ReportingModule): `lib/ReportingModule`

### Other components

- **Patient**
- **Clinic staff**
- **Administrators**
- **Payment gateway**
- **Push and SMS**
- **Maps service**

## Connections

- Patient → Doctor discovery: searches doctors (evidence: `README.md`)
- Patient → Appointment booking: books slot (evidence: `README.md`)
- Patient → Payments and refunds: pays (evidence: `README.md`)
- Patient → Live queue: tracks turn (evidence: `README.md`)
- Live queue → Travel-time guidance: guides arrival (evidence: `README.md`)
- Patient → Medical records: views records (evidence: `README.md`)
- Clinic staff → Clinic schedules: sets schedule (evidence: `README.md`)
- Clinic staff → Live queue: checks in (evidence: `README.md`)
- Clinic staff → Consultation workflow: records visit (evidence: `README.md`)
- Administrators → Accounts and verification: verifies doctors (evidence: `README.md`)
- Administrators → Payments and refunds: handles refunds (evidence: `README.md`)
- Administrators → Audit and monitoring: reads audit logs (evidence: `README.md`)
- Appointment booking → Cloud Firestore: stores data (evidence: `README.md`)
- Payments and refunds → Payment gateway: uses adapter (evidence: `README.md`)
- Patient notifications → Push and SMS: sends alerts (evidence: `README.md`)
- Travel-time guidance → Maps service: gets travel time (evidence: `README.md`)
- Accounts and verification → Cloud Firestore: stores data (evidence: `README.md`)
- Live queue → Cloud Firestore: stores data (evidence: `README.md`)
- Medical records → Cloud Firestore: stores data (evidence: `README.md`)
