# mamun417/prescription-management-system architecture

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

- Interactive diagram: https://gitdiagram.com/mamun417/prescription-management-system
- Repository: https://github.com/mamun417/prescription-management-system

## Overview

This CakePHP application is a prescription-management system for doctors. Its documented workflow centers on creating prescriptions and scheduling appointments, with patient history as a related capability. The sampled code shows prescription viewing and editing, patient lookup and persistence, diagnosis-template management, and shared authentication. Several listed admin controllers indicate additional product areas, but their behavior and wiring were not sampled; those branches are represented without inferred call relationships.

Main entry points: [`src/Controller/Admin/PrescriptionsController.php`](https://github.com/mamun417/prescription-management-system/blob/master/src/Controller/Admin/PrescriptionsController.php) (Prescriptions), [`src/Controller/Admin/UsersController.php`](https://github.com/mamun417/prescription-management-system/blob/master/src/Controller/Admin/UsersController.php) (Patient accounts), [`src/Controller/AppController.php`](https://github.com/mamun417/prescription-management-system/blob/master/src/Controller/AppController.php) (Shared controller), [`src/Controller/Admin/DiagnosisController.php`](https://github.com/mamun417/prescription-management-system/blob/master/src/Controller/Admin/DiagnosisController.php) (Diagnosis templates)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clinical["Clinical workflow"]
  node_prescriptions["Prescriptions"]
  node_prescription_record["Prescription record<br/>[Prescription.php]"]
  node_appointments["Appointments"]
  node_dashboard["Dashboard"]
  node_prescriptions_table[("Prescription persistence")]
end

subgraph group_patients["Patient management"]
  node_patients_controller["Patient accounts"]
  node_user_record["User record<br/>[User.php]"]
  node_user_table[("User persistence<br/>[UsersTable.php]")]
end

subgraph group_catalog["Clinical catalog"]
  node_diagnosis["Diagnosis templates"]
  node_diagnosis_lists["Diagnosis lists"]
  node_medicines_controller["Medicines"]
  node_medicine_record["Medicine record<br/>[Medicine.php]"]
  node_tests["Tests catalog"]
end

subgraph group_platform["Application platform"]
  node_app_controller["Shared controller<br/>[AppController.php]"]
  node_application["HTTP application<br/>[Application.php]"]
  node_pdf_handler["PDF generation"]
  node_settings["Settings"]
  node_library["Library"]
end

node_doctor(("Doctor"))

node_doctor -->|"creates prescriptions"| node_prescriptions
node_doctor -->|"schedules appointments"| node_appointments
node_doctor -->|"tracks patient history"| node_patients_controller
node_prescriptions -->|"loads and edits"| node_prescription_record
node_prescriptions -.->|"queries and saves"| node_prescriptions_table
node_prescriptions -->|"looks up patients"| node_patients_controller
node_prescriptions -->|"inherits from"| node_app_controller
node_patients_controller -->|"loads and updates"| node_user_record
node_patients_controller -.->|"queries and saves"| node_user_table
node_patients_controller -->|"retrieves history"| node_prescriptions
node_patients_controller -->|"inherits from"| node_app_controller
node_diagnosis -->|"inherits from"| node_app_controller
node_diagnosis -->|"matches medicines"| node_medicine_record
node_prescriptions -->|"inherits from"| node_app_controller
node_application -.->|"routes requests"| node_app_controller
node_application -.->|"enables PDF output"| node_pdf_handler

click node_prescriptions "https://github.com/mamun417/prescription-management-system/blob/master/src/Controller/Admin/PrescriptionsController.php"
click node_prescription_record "https://github.com/mamun417/prescription-management-system/blob/master/src/Model/Entity/Prescription.php"
click node_appointments "https://github.com/mamun417/prescription-management-system/blob/master/src/Controller/Admin/AppointmentsController.php"
click node_dashboard "https://github.com/mamun417/prescription-management-system/blob/master/src/Controller/Admin/DashboardController.php"
click node_patients_controller "https://github.com/mamun417/prescription-management-system/blob/master/src/Controller/Admin/UsersController.php"
click node_user_record "https://github.com/mamun417/prescription-management-system/blob/master/src/Model/Entity/User.php"
click node_user_table "https://github.com/mamun417/prescription-management-system/blob/master/src/Model/Table/UsersTable.php"
click node_diagnosis "https://github.com/mamun417/prescription-management-system/blob/master/src/Controller/Admin/DiagnosisController.php"
click node_diagnosis_lists "https://github.com/mamun417/prescription-management-system/blob/master/src/Controller/Admin/DiagnosisListsController.php"
click node_medicines_controller "https://github.com/mamun417/prescription-management-system/blob/master/src/Controller/Admin/MedicinesController.php"
click node_medicine_record "https://github.com/mamun417/prescription-management-system/blob/master/src/Model/Entity/Medicine.php"
click node_tests "https://github.com/mamun417/prescription-management-system/blob/master/src/Controller/Admin/TestsController.php"
click node_prescriptions_table "https://github.com/mamun417/prescription-management-system/blob/master/src/Model/Table/PrescriptionsTable.php"
click node_app_controller "https://github.com/mamun417/prescription-management-system/blob/master/src/Controller/AppController.php"
click node_application "https://github.com/mamun417/prescription-management-system/blob/master/src/Application.php"
click node_pdf_handler "https://github.com/mamun417/prescription-management-system/blob/master/src/Controller/Component/PdfHandlerComponent.php"
click node_settings "https://github.com/mamun417/prescription-management-system/blob/master/src/Controller/Admin/SettingsController.php"
click node_library "https://github.com/mamun417/prescription-management-system/blob/master/src/Controller/Admin/LibraryController.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_prescriptions,node_prescription_record,node_appointments,node_dashboard,node_prescriptions_table toneBlue
class node_patients_controller,node_user_record,node_user_table toneAmber
class node_diagnosis,node_diagnosis_lists,node_medicines_controller,node_medicine_record,node_tests toneMint
class node_app_controller,node_application,node_pdf_handler,node_settings,node_library toneRose
class node_doctor toneIndigo
```

## Components

### Clinical workflow

- [Prescriptions](https://github.com/mamun417/prescription-management-system/blob/master/src/Controller/Admin/PrescriptionsController.php): `src/Controller/Admin/PrescriptionsController.php`
- [Prescription record](https://github.com/mamun417/prescription-management-system/blob/master/src/Model/Entity/Prescription.php): `src/Model/Entity/Prescription.php`
- [Appointments](https://github.com/mamun417/prescription-management-system/blob/master/src/Controller/Admin/AppointmentsController.php): `src/Controller/Admin/AppointmentsController.php`
- [Dashboard](https://github.com/mamun417/prescription-management-system/blob/master/src/Controller/Admin/DashboardController.php): `src/Controller/Admin/DashboardController.php`
- [Prescription persistence](https://github.com/mamun417/prescription-management-system/blob/master/src/Model/Table/PrescriptionsTable.php): `src/Model/Table/PrescriptionsTable.php`

### Patient management

- [Patient accounts](https://github.com/mamun417/prescription-management-system/blob/master/src/Controller/Admin/UsersController.php): `src/Controller/Admin/UsersController.php`
- [User record](https://github.com/mamun417/prescription-management-system/blob/master/src/Model/Entity/User.php): `src/Model/Entity/User.php`
- [User persistence](https://github.com/mamun417/prescription-management-system/blob/master/src/Model/Table/UsersTable.php): `src/Model/Table/UsersTable.php`

### Clinical catalog

- [Diagnosis templates](https://github.com/mamun417/prescription-management-system/blob/master/src/Controller/Admin/DiagnosisController.php): `src/Controller/Admin/DiagnosisController.php`
- [Diagnosis lists](https://github.com/mamun417/prescription-management-system/blob/master/src/Controller/Admin/DiagnosisListsController.php): `src/Controller/Admin/DiagnosisListsController.php`
- [Medicines](https://github.com/mamun417/prescription-management-system/blob/master/src/Controller/Admin/MedicinesController.php): `src/Controller/Admin/MedicinesController.php`
- [Medicine record](https://github.com/mamun417/prescription-management-system/blob/master/src/Model/Entity/Medicine.php): `src/Model/Entity/Medicine.php`
- [Tests catalog](https://github.com/mamun417/prescription-management-system/blob/master/src/Controller/Admin/TestsController.php): `src/Controller/Admin/TestsController.php`

### Application platform

- [Shared controller](https://github.com/mamun417/prescription-management-system/blob/master/src/Controller/AppController.php): `src/Controller/AppController.php`
- [HTTP application](https://github.com/mamun417/prescription-management-system/blob/master/src/Application.php): `src/Application.php`
- [PDF generation](https://github.com/mamun417/prescription-management-system/blob/master/src/Controller/Component/PdfHandlerComponent.php): `src/Controller/Component/PdfHandlerComponent.php`
- [Settings](https://github.com/mamun417/prescription-management-system/blob/master/src/Controller/Admin/SettingsController.php): `src/Controller/Admin/SettingsController.php`
- [Library](https://github.com/mamun417/prescription-management-system/blob/master/src/Controller/Admin/LibraryController.php): `src/Controller/Admin/LibraryController.php`

### Other components

- **Doctor**

## Connections

- Doctor → Prescriptions: creates prescriptions (evidence: `README.md`)
- Doctor → Appointments: schedules appointments (evidence: `README.md`)
- Doctor → Patient accounts: tracks patient history (evidence: `README.md`)
- Prescriptions → Prescription record: loads and edits (evidence: `src/Controller/Admin/PrescriptionsController.php`)
- Prescriptions → Prescription persistence: queries and saves
- Prescriptions → Patient accounts: looks up patients (evidence: `src/Controller/Admin/PrescriptionsController.php`)
- Prescriptions → Shared controller: inherits from (evidence: `src/Controller/Admin/PrescriptionsController.php`)
- Patient accounts → User record: loads and updates (evidence: `src/Controller/Admin/UsersController.php`)
- Patient accounts → User persistence: queries and saves
- Patient accounts → Prescriptions: retrieves history (evidence: `src/Controller/Admin/UsersController.php`)
- Patient accounts → Shared controller: inherits from (evidence: `src/Controller/Admin/UsersController.php`)
- Diagnosis templates → Shared controller: inherits from (evidence: `src/Controller/Admin/DiagnosisController.php`)
- Diagnosis templates → Medicine record: matches medicines (evidence: `src/Controller/Admin/DiagnosisController.php`)
- Prescriptions → Shared controller: inherits from (evidence: `src/Controller/Admin/PrescriptionsController.php`)
- HTTP application → Shared controller: routes requests
- HTTP application → PDF generation: enables PDF output
