# phong-kaster/ptit-do-an-tot-nghiep architecture

> Architecture diagram of the GitHub repository phong-kaster/ptit-do-an-tot-nghiep, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/phong-kaster/ptit-do-an-tot-nghiep
- Repository: https://github.com/phong-kaster/ptit-do-an-tot-nghiep

## Overview

This repository contains the PHP API and administrative website for a healthcare appointment and treatment system; the Android client is a separate product component. The patient workflow is to submit a booking, have staff arrange appointments, and maintain appointment records and treatment plans. The README establishes these domain capabilities, while the sampled API routes show resource dispatch and the appointment controller excerpt shows doctor validation. Several subsystem links are documented rather than visible in sampled implementation, so the graph avoids claiming unshown model or persistence calls.

Main entry points: [`api/app/inc/routes.inc.php`](https://github.com/phong-kaster/ptit-do-an-tot-nghiep/blob/main/api/app/inc/routes.inc.php) (API routes), [`umbrella-corporation/app/inc/routes.inc.php`](https://github.com/phong-kaster/ptit-do-an-tot-nghiep/blob/main/umbrella-corporation/app/inc/routes.inc.php) (Admin routes), [`api/app/controllers/AppointmentsController.php`](https://github.com/phong-kaster/ptit-do-an-tot-nghiep/blob/main/api/app/controllers/AppointmentsController.php) (Appointment queue), [`api/app/lib/OneFileManager/Common.php`](https://github.com/phong-kaster/ptit-do-an-tot-nghiep/blob/main/api/app/lib/OneFileManager/Common.php) (File utilities)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application entry"]
  node_api_routes["API routes<br/>[routes.inc.php]"]
  node_admin_routes["Admin routes<br/>[routes.inc.php]"]
  node_api_runtime["API runtime<br/>[App.php]"]
  node_admin_runtime["Admin runtime<br/>[App.php]"]
end

subgraph group_patient["Patient care"]
  node_booking["Bookings"]
  node_appointments["Appointment queue"]
  node_records["Appointment records"]
  node_treatments["Treatment plans"]
  node_notifications["Patient notifications"]
end

subgraph group_clinic["Clinic administration"]
  node_doctors["Doctor directory"]
  node_patients["Patient directory"]
  node_services["Services &amp; specialties"]
  node_rooms["Rooms"]
  node_doctor_service["Doctor-service links"]
  node_admin_dashboard["Clinic dashboard"]
  node_admin_appointments["Appointment management"]
end

subgraph group_platform["Shared platform"]
  node_auth["Authentication<br/>[Auth.php]"]
  node_doctor_model[("Doctor data<br/>[DoctorModel.php]")]
  node_file_manager["File manager<br/>[FileManager.php]"]
  node_file_common["File utilities<br/>[Common.php]"]
  node_extension_map["Extension map<br/>[ext2mime.php]"]
  node_mime_map["MIME map<br/>[mime2ext.php]"]
end

node_patient_user(("Patient / Android"))
node_clinic_staff(("Clinic staff"))
node_database[("Healthcare database")]

node_patient_user -->|"requests care"| node_api_routes
node_api_routes -->|"routes bookings"| node_booking
node_api_routes -->|"routes appointments"| node_appointments
node_api_routes -->|"routes treatments"| node_treatments
node_api_routes -.->|"dispatches routes"| node_api_runtime
node_appointments -->|"validates doctor"| node_doctor_model
node_clinic_staff -->|"manages clinic"| node_admin_routes
node_admin_routes -.->|"routes appointments"| node_admin_appointments
node_admin_routes -.->|"routes dashboard"| node_admin_dashboard
node_admin_routes -.->|"dispatches routes"| node_admin_runtime
node_admin_appointments -.->|"arranges visits"| node_appointments
node_admin_runtime -->|"uses authentication"| node_auth
node_file_manager -->|"uses utilities"| node_file_common
node_file_common -->|"loads MIME map"| node_extension_map
node_file_common -->|"loads extension map"| node_mime_map
node_booking -.->|"stores bookings"| node_database
node_appointments -.->|"stores appointments"| node_database
node_records -.->|"stores records"| node_database
node_treatments -.->|"stores plans"| node_database

click node_api_routes "https://github.com/phong-kaster/ptit-do-an-tot-nghiep/blob/main/api/app/inc/routes.inc.php"
click node_admin_routes "https://github.com/phong-kaster/ptit-do-an-tot-nghiep/blob/main/umbrella-corporation/app/inc/routes.inc.php"
click node_api_runtime "https://github.com/phong-kaster/ptit-do-an-tot-nghiep/blob/main/api/app/core/App.php"
click node_admin_runtime "https://github.com/phong-kaster/ptit-do-an-tot-nghiep/blob/main/umbrella-corporation/app/core/App.php"
click node_booking "https://github.com/phong-kaster/ptit-do-an-tot-nghiep/blob/main/api/app/controllers/PatientBookingsController.php"
click node_appointments "https://github.com/phong-kaster/ptit-do-an-tot-nghiep/blob/main/api/app/controllers/AppointmentsController.php"
click node_records "https://github.com/phong-kaster/ptit-do-an-tot-nghiep/blob/main/api/app/controllers/AppointmentRecordsController.php"
click node_treatments "https://github.com/phong-kaster/ptit-do-an-tot-nghiep/blob/main/api/app/controllers/TreatmentsController.php"
click node_notifications "https://github.com/phong-kaster/ptit-do-an-tot-nghiep/blob/main/api/app/controllers/PatientNotificationsController.php"
click node_doctors "https://github.com/phong-kaster/ptit-do-an-tot-nghiep/blob/main/api/app/controllers/DoctorsController.php"
click node_patients "https://github.com/phong-kaster/ptit-do-an-tot-nghiep/blob/main/api/app/controllers/PatientsController.php"
click node_services "https://github.com/phong-kaster/ptit-do-an-tot-nghiep/blob/main/api/app/controllers/ServicesController.php"
click node_rooms "https://github.com/phong-kaster/ptit-do-an-tot-nghiep/blob/main/api/app/controllers/RoomsController.php"
click node_doctor_service "https://github.com/phong-kaster/ptit-do-an-tot-nghiep/blob/main/api/app/controllers/DoctorsAndServicesController.php"
click node_admin_dashboard "https://github.com/phong-kaster/ptit-do-an-tot-nghiep/blob/main/umbrella-corporation/app/controllers/DashboardController.php"
click node_admin_appointments "https://github.com/phong-kaster/ptit-do-an-tot-nghiep/blob/main/umbrella-corporation/app/controllers/AppointmentsController.php"
click node_auth "https://github.com/phong-kaster/ptit-do-an-tot-nghiep/blob/main/umbrella-corporation/app/lib/Auth.php"
click node_doctor_model "https://github.com/phong-kaster/ptit-do-an-tot-nghiep/blob/main/api/app/models/DoctorModel.php"
click node_file_manager "https://github.com/phong-kaster/ptit-do-an-tot-nghiep/blob/main/api/app/lib/OneFileManager/FileManager.php"
click node_file_common "https://github.com/phong-kaster/ptit-do-an-tot-nghiep/blob/main/api/app/lib/OneFileManager/Common.php"
click node_extension_map "https://github.com/phong-kaster/ptit-do-an-tot-nghiep/blob/main/api/app/lib/OneFileManager/ext2mime.php"
click node_mime_map "https://github.com/phong-kaster/ptit-do-an-tot-nghiep/blob/main/api/app/lib/OneFileManager/mime2ext.php"

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_api_routes,node_admin_routes,node_api_runtime,node_admin_runtime toneBlue
class node_booking,node_appointments,node_records,node_treatments,node_notifications,node_database toneAmber
class node_doctors,node_patients,node_services,node_rooms,node_doctor_service,node_admin_dashboard,node_admin_appointments toneMint
class node_auth,node_doctor_model,node_file_manager,node_file_common,node_extension_map,node_mime_map toneRose
class node_patient_user,node_clinic_staff toneIndigo
```

## Components

### Application entry

- [API routes](https://github.com/phong-kaster/ptit-do-an-tot-nghiep/blob/main/api/app/inc/routes.inc.php): `api/app/inc/routes.inc.php`
- [Admin routes](https://github.com/phong-kaster/ptit-do-an-tot-nghiep/blob/main/umbrella-corporation/app/inc/routes.inc.php): `umbrella-corporation/app/inc/routes.inc.php`
- [API runtime](https://github.com/phong-kaster/ptit-do-an-tot-nghiep/blob/main/api/app/core/App.php): `api/app/core/App.php`
- [Admin runtime](https://github.com/phong-kaster/ptit-do-an-tot-nghiep/blob/main/umbrella-corporation/app/core/App.php): `umbrella-corporation/app/core/App.php`

### Patient care

- [Bookings](https://github.com/phong-kaster/ptit-do-an-tot-nghiep/blob/main/api/app/controllers/PatientBookingsController.php): `api/app/controllers/PatientBookingsController.php`
- [Appointment queue](https://github.com/phong-kaster/ptit-do-an-tot-nghiep/blob/main/api/app/controllers/AppointmentsController.php): `api/app/controllers/AppointmentsController.php`
- [Appointment records](https://github.com/phong-kaster/ptit-do-an-tot-nghiep/blob/main/api/app/controllers/AppointmentRecordsController.php): `api/app/controllers/AppointmentRecordsController.php`
- [Treatment plans](https://github.com/phong-kaster/ptit-do-an-tot-nghiep/blob/main/api/app/controllers/TreatmentsController.php): `api/app/controllers/TreatmentsController.php`
- [Patient notifications](https://github.com/phong-kaster/ptit-do-an-tot-nghiep/blob/main/api/app/controllers/PatientNotificationsController.php): `api/app/controllers/PatientNotificationsController.php`

### Clinic administration

- [Doctor directory](https://github.com/phong-kaster/ptit-do-an-tot-nghiep/blob/main/api/app/controllers/DoctorsController.php): `api/app/controllers/DoctorsController.php`
- [Patient directory](https://github.com/phong-kaster/ptit-do-an-tot-nghiep/blob/main/api/app/controllers/PatientsController.php): `api/app/controllers/PatientsController.php`
- [Services & specialties](https://github.com/phong-kaster/ptit-do-an-tot-nghiep/blob/main/api/app/controllers/ServicesController.php): `api/app/controllers/ServicesController.php`
- [Rooms](https://github.com/phong-kaster/ptit-do-an-tot-nghiep/blob/main/api/app/controllers/RoomsController.php): `api/app/controllers/RoomsController.php`
- [Doctor-service links](https://github.com/phong-kaster/ptit-do-an-tot-nghiep/blob/main/api/app/controllers/DoctorsAndServicesController.php): `api/app/controllers/DoctorsAndServicesController.php`
- [Clinic dashboard](https://github.com/phong-kaster/ptit-do-an-tot-nghiep/blob/main/umbrella-corporation/app/controllers/DashboardController.php): `umbrella-corporation/app/controllers/DashboardController.php`
- [Appointment management](https://github.com/phong-kaster/ptit-do-an-tot-nghiep/blob/main/umbrella-corporation/app/controllers/AppointmentsController.php): `umbrella-corporation/app/controllers/AppointmentsController.php`

### Shared platform

- [Authentication](https://github.com/phong-kaster/ptit-do-an-tot-nghiep/blob/main/umbrella-corporation/app/lib/Auth.php): `umbrella-corporation/app/lib/Auth.php`
- [Doctor data](https://github.com/phong-kaster/ptit-do-an-tot-nghiep/blob/main/api/app/models/DoctorModel.php): `api/app/models/DoctorModel.php`
- [File manager](https://github.com/phong-kaster/ptit-do-an-tot-nghiep/blob/main/api/app/lib/OneFileManager/FileManager.php): `api/app/lib/OneFileManager/FileManager.php`
- [File utilities](https://github.com/phong-kaster/ptit-do-an-tot-nghiep/blob/main/api/app/lib/OneFileManager/Common.php): `api/app/lib/OneFileManager/Common.php`
- [Extension map](https://github.com/phong-kaster/ptit-do-an-tot-nghiep/blob/main/api/app/lib/OneFileManager/ext2mime.php): `api/app/lib/OneFileManager/ext2mime.php`
- [MIME map](https://github.com/phong-kaster/ptit-do-an-tot-nghiep/blob/main/api/app/lib/OneFileManager/mime2ext.php): `api/app/lib/OneFileManager/mime2ext.php`

### Other components

- **Patient / Android**
- **Clinic staff**
- **Healthcare database**

## Connections

- Patient / Android → API routes: requests care (evidence: `README.md`)
- API routes → Bookings: routes bookings (evidence: `api/app/inc/routes.inc.php`)
- API routes → Appointment queue: routes appointments (evidence: `api/app/inc/routes.inc.php`)
- API routes → Treatment plans: routes treatments (evidence: `api/app/inc/routes.inc.php`)
- API routes → API runtime: dispatches routes
- Appointment queue → Doctor data: validates doctor (evidence: `api/app/controllers/AppointmentsController.php`)
- Clinic staff → Admin routes: manages clinic (evidence: `README.md`)
- Admin routes → Appointment management: routes appointments
- Admin routes → Clinic dashboard: routes dashboard
- Admin routes → Admin runtime: dispatches routes
- Appointment management → Appointment queue: arranges visits (evidence: `README.md`)
- Admin runtime → Authentication: uses authentication (evidence: `umbrella-corporation/app/core/App.php`)
- File manager → File utilities: uses utilities (evidence: `api/app/lib/OneFileManager/FileManager.php`)
- File utilities → Extension map: loads MIME map (evidence: `api/app/lib/OneFileManager/Common.php`)
- File utilities → MIME map: loads extension map (evidence: `api/app/lib/OneFileManager/Common.php`)
- Bookings → Healthcare database: stores bookings (evidence: `README.md`)
- Appointment queue → Healthcare database: stores appointments (evidence: `README.md`)
- Appointment records → Healthcare database: stores records (evidence: `README.md`)
- Treatment plans → Healthcare database: stores plans (evidence: `README.md`)
