# pixelnaveen/lab_management_webapp architecture

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

- Interactive diagram: https://gitdiagram.com/pixelnaveen/lab_management_webapp
- Repository: https://github.com/pixelnaveen/lab_management_webapp

## Overview

NARA’s Laboratory Management System supports authenticated laboratory operations from sample intake through testing, reporting, and client-facing analysis. The map emphasizes the documented SAF workflow, configuration, results, report generation and printing, plus operational records and analytics. Sample intake, pricing calculation, client reporting, and sample-status handling are supported by excerpts; several other links reflect README capabilities and the routed page structure, while unsampled controller-to-model wiring is kept broad or omitted.

Main entry points: [`src/Includes`](https://github.com/pixelnaveen/lab_management_webapp/tree/main/src/Includes) (Application pages), [`Config/Database.php`](https://github.com/pixelnaveen/lab_management_webapp/blob/main/Config/Database.php) (Database connection), [`index.php`](https://github.com/pixelnaveen/lab_management_webapp/blob/main/index.php) (Web entry and router), [`src/Controllers/SampleController.php`](https://github.com/pixelnaveen/lab_management_webapp/blob/main/src/Controllers/SampleController.php) (Sample intake endpoint)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and navigation"]
  node_index["Web entry and router<br/>[index.php]"]
  node_auth["Authentication<br/>[auth.php]"]
  node_accesscontrol["Page access control<br/>[access-control.php]"]
  node_roleconfig["Role permissions"]
  node_pages["Application pages"]
end

subgraph group_intake["Sample intake"]
  node_submission["Sample submission"]
  node_samplecontroller["Sample intake endpoint"]
  node_samplemodel["Sample records<br/>[SampleModel.php]"]
  node_pricingcalc["Charge calculation<br/>[functions.php]"]
end

subgraph group_lab["Laboratory operations"]
  node_labconfigui["Lab configuration pages"]
  node_labconfig["Parameters and methods"]
  node_resultentry["Result entry<br/>[result-entry.php]"]
  node_resultcontroller["Result entry endpoint"]
  node_resultmodel["Result data"]
  node_records["Sample records view"]
  node_statuscontroller["Sample status endpoint"]
  node_statusmodel["Sample status data"]
end

subgraph group_reports["Reporting and finance"]
  node_reportsui["Test report pages<br/>[test-report.php]"]
  node_reportcontroller["Report generation"]
  node_reportmodel["Report data"]
  node_printview["Printable report"]
  node_printcontroller["Print tracking"]
  node_printmodel["Print history"]
  node_invoices["Invoice management"]
end

subgraph group_admin["Configuration and analytics"]
  node_clientanalytics["Client analytics<br/>[report-client.php]"]
  node_clientreportcontroller["Client report endpoint"]
  node_clientreportmodel["Client report queries"]
end

node_staff(("Laboratory users"))
node_database[("MySQL database")]
node_dbconfig["Database connection<br/>[Database.php]"]

node_staff -->|"opens"| node_index
node_index -->|"checks session"| node_auth
node_index -->|"checks access"| node_accesscontrol
node_accesscontrol -->|"uses rules"| node_roleconfig
node_index -->|"routes page"| node_pages
node_pages -->|"renders"| node_submission
node_submission -->|"sends intake"| node_samplecontroller
node_samplecontroller -->|"creates records"| node_samplemodel
node_samplecontroller -->|"calculates charges"| node_pricingcalc
node_samplecontroller -->|"opens connection"| node_dbconfig
node_samplemodel -->|"connects through"| node_dbconfig
node_dbconfig -->|"connects"| node_database
node_pages -->|"renders"| node_labconfigui
node_labconfigui -->|"manages configuration"| node_labconfig
node_pages -->|"renders"| node_resultentry
node_resultentry -->|"submits results"| node_resultcontroller
node_resultcontroller -->|"records results"| node_resultmodel
node_resultmodel -->|"connects through"| node_dbconfig
node_pages -->|"renders"| node_records
node_records -->|"requests records"| node_statuscontroller
node_statuscontroller -->|"updates status"| node_statusmodel
node_statusmodel -->|"connects through"| node_dbconfig
node_pages -->|"renders"| node_reportsui
node_reportsui -->|"requests reports"| node_reportcontroller
node_reportcontroller -->|"loads report data"| node_reportmodel
node_reportcontroller -->|"renders report"| node_printview
node_reportcontroller -->|"tracks printing"| node_printcontroller
node_printcontroller -->|"records print"| node_printmodel
node_pages -->|"renders"| node_invoices
node_pages -->|"renders"| node_clientanalytics
node_clientanalytics -->|"requests analytics"| node_clientreportcontroller
node_clientreportcontroller -->|"queries history and trends"| node_clientreportmodel
node_clientreportmodel -->|"connects through"| node_dbconfig

click node_index "https://github.com/pixelnaveen/lab_management_webapp/blob/main/index.php"
click node_auth "https://github.com/pixelnaveen/lab_management_webapp/blob/main/src/Includes/auth.php"
click node_accesscontrol "https://github.com/pixelnaveen/lab_management_webapp/blob/main/src/Includes/access-control.php"
click node_roleconfig "https://github.com/pixelnaveen/lab_management_webapp/blob/main/Config/RolePermissions.php"
click node_pages "https://github.com/pixelnaveen/lab_management_webapp/tree/main/src/Includes"
click node_submission "https://github.com/pixelnaveen/lab_management_webapp/blob/main/src/Includes/sample-submission.php"
click node_samplecontroller "https://github.com/pixelnaveen/lab_management_webapp/blob/main/src/Controllers/SampleController.php"
click node_samplemodel "https://github.com/pixelnaveen/lab_management_webapp/blob/main/src/Models/SampleModel.php"
click node_pricingcalc "https://github.com/pixelnaveen/lab_management_webapp/blob/main/src/Helpers/functions.php"
click node_labconfigui "https://github.com/pixelnaveen/lab_management_webapp/tree/main/src/Includes"
click node_labconfig "https://github.com/pixelnaveen/lab_management_webapp/tree/main/src/Controllers"
click node_resultentry "https://github.com/pixelnaveen/lab_management_webapp/blob/main/src/Includes/result-entry.php"
click node_resultcontroller "https://github.com/pixelnaveen/lab_management_webapp/blob/main/src/Controllers/ResultEntryController.php"
click node_resultmodel "https://github.com/pixelnaveen/lab_management_webapp/blob/main/src/Models/ResultEntryModel.php"
click node_records "https://github.com/pixelnaveen/lab_management_webapp/blob/main/src/Includes/sample-records-view.php"
click node_statuscontroller "https://github.com/pixelnaveen/lab_management_webapp/blob/main/src/Controllers/SampleRecordsController.php"
click node_statusmodel "https://github.com/pixelnaveen/lab_management_webapp/blob/main/src/Models/SampleStatusModel.php"
click node_reportsui "https://github.com/pixelnaveen/lab_management_webapp/blob/main/src/Includes/test-report.php"
click node_reportcontroller "https://github.com/pixelnaveen/lab_management_webapp/blob/main/src/Controllers/TestReportController.php"
click node_reportmodel "https://github.com/pixelnaveen/lab_management_webapp/blob/main/src/Models/TestReportModel.php"
click node_printview "https://github.com/pixelnaveen/lab_management_webapp/blob/main/src/Views/report-print-template.php"
click node_printcontroller "https://github.com/pixelnaveen/lab_management_webapp/blob/main/src/Controllers/PrintTrackerController.php"
click node_printmodel "https://github.com/pixelnaveen/lab_management_webapp/blob/main/src/Models/PrintHistoryModel.php"
click node_invoices "https://github.com/pixelnaveen/lab_management_webapp/blob/main/src/Includes/manage-invoices.php"
click node_clientanalytics "https://github.com/pixelnaveen/lab_management_webapp/blob/main/src/Includes/report-client.php"
click node_clientreportcontroller "https://github.com/pixelnaveen/lab_management_webapp/blob/main/src/Controllers/ClientReportController.php"
click node_clientreportmodel "https://github.com/pixelnaveen/lab_management_webapp/blob/main/src/Models/ClientReportModel.php"
click node_dbconfig "https://github.com/pixelnaveen/lab_management_webapp/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_index,node_auth,node_accesscontrol,node_roleconfig,node_pages,node_staff toneBlue
class node_submission,node_samplecontroller,node_samplemodel,node_pricingcalc,node_database,node_dbconfig toneAmber
class node_labconfigui,node_labconfig,node_resultentry,node_resultcontroller,node_resultmodel,node_records,node_statuscontroller,node_statusmodel toneMint
class node_reportsui,node_reportcontroller,node_reportmodel,node_printview,node_printcontroller,node_printmodel,node_invoices toneRose
class node_clientanalytics,node_clientreportcontroller,node_clientreportmodel toneIndigo
```

## Components

### Access and navigation

- [Web entry and router](https://github.com/pixelnaveen/lab_management_webapp/blob/main/index.php): `index.php`
- [Authentication](https://github.com/pixelnaveen/lab_management_webapp/blob/main/src/Includes/auth.php): `src/Includes/auth.php`
- [Page access control](https://github.com/pixelnaveen/lab_management_webapp/blob/main/src/Includes/access-control.php): `src/Includes/access-control.php`
- [Role permissions](https://github.com/pixelnaveen/lab_management_webapp/blob/main/Config/RolePermissions.php): `Config/RolePermissions.php`
- [Application pages](https://github.com/pixelnaveen/lab_management_webapp/tree/main/src/Includes): `src/Includes`

### Sample intake

- [Sample submission](https://github.com/pixelnaveen/lab_management_webapp/blob/main/src/Includes/sample-submission.php): `src/Includes/sample-submission.php`
- [Sample intake endpoint](https://github.com/pixelnaveen/lab_management_webapp/blob/main/src/Controllers/SampleController.php): `src/Controllers/SampleController.php`
- [Sample records](https://github.com/pixelnaveen/lab_management_webapp/blob/main/src/Models/SampleModel.php): `src/Models/SampleModel.php`
- [Charge calculation](https://github.com/pixelnaveen/lab_management_webapp/blob/main/src/Helpers/functions.php): `src/Helpers/functions.php`

### Laboratory operations

- [Lab configuration pages](https://github.com/pixelnaveen/lab_management_webapp/tree/main/src/Includes): `src/Includes`
- [Parameters and methods](https://github.com/pixelnaveen/lab_management_webapp/tree/main/src/Controllers): `src/Controllers`
- [Result entry](https://github.com/pixelnaveen/lab_management_webapp/blob/main/src/Includes/result-entry.php): `src/Includes/result-entry.php`
- [Result entry endpoint](https://github.com/pixelnaveen/lab_management_webapp/blob/main/src/Controllers/ResultEntryController.php): `src/Controllers/ResultEntryController.php`
- [Result data](https://github.com/pixelnaveen/lab_management_webapp/blob/main/src/Models/ResultEntryModel.php): `src/Models/ResultEntryModel.php`
- [Sample records view](https://github.com/pixelnaveen/lab_management_webapp/blob/main/src/Includes/sample-records-view.php): `src/Includes/sample-records-view.php`
- [Sample status endpoint](https://github.com/pixelnaveen/lab_management_webapp/blob/main/src/Controllers/SampleRecordsController.php): `src/Controllers/SampleRecordsController.php`
- [Sample status data](https://github.com/pixelnaveen/lab_management_webapp/blob/main/src/Models/SampleStatusModel.php): `src/Models/SampleStatusModel.php`

### Reporting and finance

- [Test report pages](https://github.com/pixelnaveen/lab_management_webapp/blob/main/src/Includes/test-report.php): `src/Includes/test-report.php`
- [Report generation](https://github.com/pixelnaveen/lab_management_webapp/blob/main/src/Controllers/TestReportController.php): `src/Controllers/TestReportController.php`
- [Report data](https://github.com/pixelnaveen/lab_management_webapp/blob/main/src/Models/TestReportModel.php): `src/Models/TestReportModel.php`
- [Printable report](https://github.com/pixelnaveen/lab_management_webapp/blob/main/src/Views/report-print-template.php): `src/Views/report-print-template.php`
- [Print tracking](https://github.com/pixelnaveen/lab_management_webapp/blob/main/src/Controllers/PrintTrackerController.php): `src/Controllers/PrintTrackerController.php`
- [Print history](https://github.com/pixelnaveen/lab_management_webapp/blob/main/src/Models/PrintHistoryModel.php): `src/Models/PrintHistoryModel.php`
- [Invoice management](https://github.com/pixelnaveen/lab_management_webapp/blob/main/src/Includes/manage-invoices.php): `src/Includes/manage-invoices.php`

### Configuration and analytics

- [Client analytics](https://github.com/pixelnaveen/lab_management_webapp/blob/main/src/Includes/report-client.php): `src/Includes/report-client.php`
- [Client report endpoint](https://github.com/pixelnaveen/lab_management_webapp/blob/main/src/Controllers/ClientReportController.php): `src/Controllers/ClientReportController.php`
- [Client report queries](https://github.com/pixelnaveen/lab_management_webapp/blob/main/src/Models/ClientReportModel.php): `src/Models/ClientReportModel.php`

### Other components

- **Laboratory users**
- **MySQL database**
- [Database connection](https://github.com/pixelnaveen/lab_management_webapp/blob/main/Config/Database.php): `Config/Database.php`

## Connections

- Laboratory users → Web entry and router: opens
- Web entry and router → Authentication: checks session
- Web entry and router → Page access control: checks access
- Page access control → Role permissions: uses rules
- Web entry and router → Application pages: routes page
- Application pages → Sample submission: renders
- Sample submission → Sample intake endpoint: sends intake
- Sample intake endpoint → Sample records: creates records
- Sample intake endpoint → Charge calculation: calculates charges
- Sample intake endpoint → Database connection: opens connection
- Sample records → Database connection: connects through
- Database connection → MySQL database: connects
- Application pages → Lab configuration pages: renders
- Lab configuration pages → Parameters and methods: manages configuration
- Application pages → Result entry: renders
- Result entry → Result entry endpoint: submits results
- Result entry endpoint → Result data: records results
- Result data → Database connection: connects through
- Application pages → Sample records view: renders
- Sample records view → Sample status endpoint: requests records
- Sample status endpoint → Sample status data: updates status
- Sample status data → Database connection: connects through
- Application pages → Test report pages: renders
- Test report pages → Report generation: requests reports
- Report generation → Report data: loads report data
- Report generation → Printable report: renders report
- Report generation → Print tracking: tracks printing
- Print tracking → Print history: records print
- Application pages → Invoice management: renders
- Application pages → Client analytics: renders
- Client analytics → Client report endpoint: requests analytics
- Client report endpoint → Client report queries: queries history and trends
- Client report queries → Database connection: connects through
