# sherilyn19/ap3_project architecture

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

- Interactive diagram: https://gitdiagram.com/sherilyn19/ap3_project
- Repository: https://github.com/sherilyn19/ap3_project

## Overview

AKSyon Medical Center is a clinic-management web application. Patients can find services and doctors, check availability, and book appointments; staff and doctors manage schedules, records, and payments, while superadmins manage operational data and accounts. The graph keeps those user-facing workflows distinct from the domain models and MySQL connection layer. The README is empty, so capability coverage is based on the tree and SOURCE INDEX; unsampled relationships are omitted where their callers are not shown.

Main entry points: [`public/superadmin/superadmin_dashboard.php`](https://github.com/sherilyn19/ap3_project/blob/main/public/superadmin/superadmin_dashboard.php) (Admin Portal), [`config/Database.php`](https://github.com/sherilyn19/ap3_project/blob/main/config/Database.php) (MySQL Database), [`public/staff_dashboard.php`](https://github.com/sherilyn19/ap3_project/blob/main/public/staff_dashboard.php) (Staff Portal), [`public/ajax/patient_book_appointment.php`](https://github.com/sherilyn19/ap3_project/blob/main/public/ajax/patient_book_appointment.php) (Booking Endpoint)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_portals["User Portals"]
  node_public_site["Public Site<br/>[index.php]"]
  node_patient_portal["Patient Portal"]
  node_doctor_portal["Doctor Portal"]
  node_staff_portal["Staff Portal"]
  node_admin_portal["Admin Portal"]
end

subgraph group_appointments["Appointments"]
  node_booking_endpoint["Booking Endpoint"]
  node_availability_endpoint["Availability Endpoint"]
  node_appointment_model["Appointments<br/>[Appointment.php]"]
  node_schedule_model["Schedules<br/>[Schedule.php]"]
  node_doctor_model["Doctor Directory<br/>[Doctor.php]"]
end

subgraph group_care["Care Operations"]
  node_medical_records["Medical Records<br/>[Medical_Record.php]"]
  node_payments["Payments<br/>[Payment.php]"]
  node_patient_model["Patient Records<br/>[Patient.php]"]
end

subgraph group_administration["Administration"]
  node_staff_model["Staff Records<br/>[Staff.php]"]
  node_user_model["User Accounts<br/>[User.php]"]
  node_service_model["Services<br/>[Service.php]"]
  node_specialization_model["Specializations<br/>[Specialization.php]"]
  node_status_model["Statuses<br/>[Status.php]"]
end

subgraph group_data["Data Layer"]
  node_database[("MySQL Database<br/>[Database.php]")]
end

node_patient(("Patient"))
node_doctor(("Doctor"))
node_staff(("Staff"))
node_superadmin(("Superadmin"))

node_patient -->|"visits"| node_public_site
node_public_site -->|"links to"| node_patient_portal
node_patient -.->|"books through"| node_booking_endpoint
node_booking_endpoint -->|"creates appointment"| node_appointment_model
node_booking_endpoint -->|"uses patient data"| node_patient_model
node_patient_portal -.->|"requests slots"| node_availability_endpoint
node_availability_endpoint -->|"gets time slots"| node_schedule_model
node_availability_endpoint -->|"gets doctor data"| node_doctor_model
node_doctor -.->|"uses"| node_doctor_portal
node_staff -.->|"uses"| node_staff_portal
node_superadmin -.->|"uses"| node_admin_portal
node_staff_portal -->|"manages"| node_medical_records
node_staff_portal -->|"manages"| node_payments
node_staff_portal -->|"manages"| node_service_model
node_admin_portal -->|"manages"| node_appointment_model
node_admin_portal -->|"manages"| node_payments
node_admin_portal -->|"manages"| node_doctor_model
node_admin_portal -->|"manages"| node_service_model
node_admin_portal -->|"manages"| node_user_model
node_appointment_model -->|"connects via"| node_database
node_doctor_model -->|"connects via"| node_database
node_schedule_model -->|"connects via"| node_database
node_medical_records -->|"connects via"| node_database
node_staff_model -->|"connects via"| node_database
node_user_model -->|"connects via"| node_database

click node_public_site "https://github.com/sherilyn19/ap3_project/blob/main/index.php"
click node_patient_portal "https://github.com/sherilyn19/ap3_project/blob/main/public/patient_book_appt.php"
click node_doctor_portal "https://github.com/sherilyn19/ap3_project/blob/main/public/doctor_schedule.php"
click node_staff_portal "https://github.com/sherilyn19/ap3_project/blob/main/public/staff_dashboard.php"
click node_admin_portal "https://github.com/sherilyn19/ap3_project/blob/main/public/superadmin/superadmin_dashboard.php"
click node_booking_endpoint "https://github.com/sherilyn19/ap3_project/blob/main/public/ajax/patient_book_appointment.php"
click node_availability_endpoint "https://github.com/sherilyn19/ap3_project/blob/main/public/ajax/patient_get_avail_times.php"
click node_appointment_model "https://github.com/sherilyn19/ap3_project/blob/main/classes/Appointment.php"
click node_schedule_model "https://github.com/sherilyn19/ap3_project/blob/main/classes/Schedule.php"
click node_doctor_model "https://github.com/sherilyn19/ap3_project/blob/main/classes/Doctor.php"
click node_medical_records "https://github.com/sherilyn19/ap3_project/blob/main/classes/Medical_Record.php"
click node_payments "https://github.com/sherilyn19/ap3_project/blob/main/classes/Payment.php"
click node_patient_model "https://github.com/sherilyn19/ap3_project/blob/main/classes/Patient.php"
click node_staff_model "https://github.com/sherilyn19/ap3_project/blob/main/classes/Staff.php"
click node_user_model "https://github.com/sherilyn19/ap3_project/blob/main/classes/User.php"
click node_service_model "https://github.com/sherilyn19/ap3_project/blob/main/classes/Service.php"
click node_specialization_model "https://github.com/sherilyn19/ap3_project/blob/main/classes/Specialization.php"
click node_status_model "https://github.com/sherilyn19/ap3_project/blob/main/classes/Status.php"
click node_database "https://github.com/sherilyn19/ap3_project/blob/main/config/Database.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_public_site,node_patient_portal,node_doctor_portal,node_staff_portal,node_admin_portal toneBlue
class node_booking_endpoint,node_availability_endpoint,node_appointment_model,node_schedule_model,node_doctor_model toneAmber
class node_medical_records,node_payments,node_patient_model toneMint
class node_staff_model,node_user_model,node_service_model,node_specialization_model,node_status_model toneRose
class node_database,node_patient,node_doctor,node_staff,node_superadmin toneIndigo
```

## Components

### User Portals

- [Public Site](https://github.com/sherilyn19/ap3_project/blob/main/index.php): `index.php`
- [Patient Portal](https://github.com/sherilyn19/ap3_project/blob/main/public/patient_book_appt.php): `public/patient_book_appt.php`
- [Doctor Portal](https://github.com/sherilyn19/ap3_project/blob/main/public/doctor_schedule.php): `public/doctor_schedule.php`
- [Staff Portal](https://github.com/sherilyn19/ap3_project/blob/main/public/staff_dashboard.php): `public/staff_dashboard.php`
- [Admin Portal](https://github.com/sherilyn19/ap3_project/blob/main/public/superadmin/superadmin_dashboard.php): `public/superadmin/superadmin_dashboard.php`

### Appointments

- [Booking Endpoint](https://github.com/sherilyn19/ap3_project/blob/main/public/ajax/patient_book_appointment.php): `public/ajax/patient_book_appointment.php`
- [Availability Endpoint](https://github.com/sherilyn19/ap3_project/blob/main/public/ajax/patient_get_avail_times.php): `public/ajax/patient_get_avail_times.php`
- [Appointments](https://github.com/sherilyn19/ap3_project/blob/main/classes/Appointment.php): `classes/Appointment.php`
- [Schedules](https://github.com/sherilyn19/ap3_project/blob/main/classes/Schedule.php): `classes/Schedule.php`
- [Doctor Directory](https://github.com/sherilyn19/ap3_project/blob/main/classes/Doctor.php): `classes/Doctor.php`

### Care Operations

- [Medical Records](https://github.com/sherilyn19/ap3_project/blob/main/classes/Medical_Record.php): `classes/Medical_Record.php`
- [Payments](https://github.com/sherilyn19/ap3_project/blob/main/classes/Payment.php): `classes/Payment.php`
- [Patient Records](https://github.com/sherilyn19/ap3_project/blob/main/classes/Patient.php): `classes/Patient.php`

### Administration

- [Staff Records](https://github.com/sherilyn19/ap3_project/blob/main/classes/Staff.php): `classes/Staff.php`
- [User Accounts](https://github.com/sherilyn19/ap3_project/blob/main/classes/User.php): `classes/User.php`
- [Services](https://github.com/sherilyn19/ap3_project/blob/main/classes/Service.php): `classes/Service.php`
- [Specializations](https://github.com/sherilyn19/ap3_project/blob/main/classes/Specialization.php): `classes/Specialization.php`
- [Statuses](https://github.com/sherilyn19/ap3_project/blob/main/classes/Status.php): `classes/Status.php`

### Data Layer

- [MySQL Database](https://github.com/sherilyn19/ap3_project/blob/main/config/Database.php): `config/Database.php`

### Other components

- **Patient**
- **Doctor**
- **Staff**
- **Superadmin**

## Connections

- Patient → Public Site: visits
- Public Site → Patient Portal: links to
- Patient → Booking Endpoint: books through
- Booking Endpoint → Appointments: creates appointment (evidence: `public/ajax/patient_book_appointment.php`)
- Booking Endpoint → Patient Records: uses patient data (evidence: `public/ajax/patient_book_appointment.php`)
- Patient Portal → Availability Endpoint: requests slots
- Availability Endpoint → Schedules: gets time slots (evidence: `public/ajax/patient_get_avail_times.php`)
- Availability Endpoint → Doctor Directory: gets doctor data (evidence: `public/ajax/patient_get_avail_times.php`)
- Doctor → Doctor Portal: uses
- Staff → Staff Portal: uses
- Superadmin → Admin Portal: uses
- Staff Portal → Medical Records: manages
- Staff Portal → Payments: manages
- Staff Portal → Services: manages
- Admin Portal → Appointments: manages (evidence: `public/superadmin/superadmin_dashboard.php`)
- Admin Portal → Payments: manages (evidence: `public/superadmin/superadmin_dashboard.php`)
- Admin Portal → Doctor Directory: manages
- Admin Portal → Services: manages
- Admin Portal → User Accounts: manages (evidence: `public/superadmin/superadmin_dashboard.php`)
- Appointments → MySQL Database: connects via (evidence: `classes/Appointment.php`)
- Doctor Directory → MySQL Database: connects via (evidence: `classes/Doctor.php`)
- Schedules → MySQL Database: connects via (evidence: `classes/Schedule.php`)
- Medical Records → MySQL Database: connects via (evidence: `classes/Medical_Record.php`)
- Staff Records → MySQL Database: connects via (evidence: `classes/Staff.php`)
- User Accounts → MySQL Database: connects via (evidence: `classes/User.php`)
