How huyg17082006/ctumedic works
CTUMedic is a role-based clinic portal for patients, doctors, and managers. Its central workflow is role-aware page routing, followed by appointment booking or management; appointment APIs validate patient access and normalize requested slots before database operations. Separate capabilities cover account access and profiles, doctor discovery, appointment lifecycle actions, and manager administration of doctors and patients. The graph reflects the routing and dependencies visible in the excerpts and source index; frontend-to-API wiring is not shown, so those links are omitted.
Main entry points: index.php Role page router · appointments Appointment endpoints · middleware Role authorization · database.php Clinic database
Components 19
Web experience
- Role page router
index.php - Sign-in and registration
frontend/views/authentication - Patient workspace
frontend/views/patients - Doctor workspace
frontend/views/doctors/doctors.php - Manager workspace
frontend/views/management - Appointment interface
frontend/components/appointment - Account and history views
frontend/views/shared - Pagination
frontend/components/pagination.php - Schedule periods
frontend/components/schedule_periods.php - Shared app setup
BASE.php
Accounts and access
- Account endpoints
backend/api/accounts - Session authorization
backend/middleware/auth.php - Role authorization
backend/middleware
Appointments
- Appointment endpoints
backend/api/appointments - Doctor discovery
backend/api/doctors
Clinic administration
- Management endpoints
backend/api/management
Data and scheduling
- Slot validation
backend/helpers/appointment_schedule.php - Clinic database
backend/database.php
Other components
- Portal user
Connections 16
- Portal user → Role page router: opens portal
index.php - Role page router → Sign-in and registration: routes to
index.php - Role page router → Patient workspace: routes to
index.php - Role page router → Doctor workspace: routes to
index.php - Role page router → Manager workspace: routes to
index.php - Role page router → Shared app setup: loads
index.php - Account endpoints → Session authorization: requires
backend/api/accounts/personal_profile.php - Role authorization → Session authorization: checks session
backend/middleware/manager.php - Management endpoints → Role authorization: requires manager
backend/api/management/manager_add_doctor.php - Appointment endpoints → Clinic database: reads and writes
backend/api/appointments/create_appointment.php - Appointment endpoints → Slot validation: validates slots
backend/api/appointments/create_appointment.php - Appointment endpoints → Role authorization: requires patient
backend/api/appointments/create_appointment.php - Doctor discovery → Clinic database: queries doctors
backend/api/doctors/get_available_doctors_for_booking.php - Management endpoints → Clinic database: manages records
backend/api/management/manager_add_doctor.php - Appointment interface → Schedule periods: renders slots
frontend/components/appointment/reschedule_modal.php - Manager workspace → Pagination: uses pagination
frontend/views/management/tabs/doctors.php