# shabbirmai124/spordha-diagnostics-ltd-pki-secure-medical-web-portal architecture

> Architecture diagram of the GitHub repository shabbirmai124/spordha-diagnostics-ltd-pki-secure-medical-web-portal, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shabbirmai124/spordha-diagnostics-ltd-pki-secure-medical-web-portal
- Repository: https://github.com/shabbirmai124/spordha-diagnostics-ltd-pki-secure-medical-web-portal

## Overview

Spordha Diagnostics is a PHP medical-laboratory portal with PKI and signed-report capabilities. The user workflow spans public service discovery and role-based sign-in, branch sample upload, pathologist report signing, and public report verification; staff also manage certificates and security incidents. The graph includes the shared database, authentication, and cryptographic helper layer, plus documented evidence and documentation features. Relationships are limited to README claims and SOURCE INDEX references; unsampled implementations are represented only at their supported paths.

Main entry points: [`config/database.php`](https://github.com/shabbirmai124/spordha-diagnostics-ltd-pki-secure-medical-web-portal/blob/main/config/database.php) (Database connection), [`includes/functions.php`](https://github.com/shabbirmai124/spordha-diagnostics-ltd-pki-secure-medical-web-portal/blob/main/includes/functions.php) (Digest & security helpers), [`includes/auth.php`](https://github.com/shabbirmai124/spordha-diagnostics-ltd-pki-secure-medical-web-portal/blob/main/includes/auth.php) (Authentication & roles), [`dashboard.php`](https://github.com/shabbirmai124/spordha-diagnostics-ltd-pki-secure-medical-web-portal/blob/main/dashboard.php) (Role dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_portal["Portal &amp; Identity"]
  node_home["Public portal<br/>[index.php]"]
  node_services["Diagnostic services<br/>[services.php]"]
  node_identity["Sign-in &amp; registration<br/>[login.php]"]
  node_dashboard["Role dashboard<br/>[dashboard.php]"]
  node_evidence["Evidence gallery"]
  node_documentation["Project documentation<br/>[documentation.php]"]
  node_branches["Branch directory<br/>[branches.php]"]
end

subgraph group_clinical["Clinical Workflow"]
  node_doctor["Doctor portal<br/>[doctor_portal.php]"]
  node_branch["Branch upload<br/>[branch_upload.php]"]
  node_pathologist["Pathologist studio"]
  node_report["Report generation"]
  node_patient["Patient portal<br/>[patient_portal.php]"]
  node_verify["Report verification<br/>[verify.php]"]
  node_verify_api["Verification API<br/>[verify_report.php]"]
end

subgraph group_security["PKI &amp; Security"]
  node_pki["PKI operations center<br/>[pki_soc.php]"]
  node_revoke["Certificate revocation API<br/>[revoke_cert.php]"]
  node_incident["Incident action API"]
end

subgraph group_shared["Shared Runtime"]
  node_auth["Authentication &amp; roles<br/>[auth.php]"]
  node_functions["Digest &amp; security helpers<br/>[functions.php]"]
  node_database["Database connection<br/>[database.php]"]
  node_store[("Application data<br/>[spordha.db]")]
end

node_visitor(("Portal user"))

node_visitor -->|"browses"| node_home
node_home -->|"explores tests"| node_services
node_visitor -->|"signs in"| node_identity
node_identity -->|"authenticates"| node_auth
node_auth -->|"queries users"| node_database
node_dashboard -->|"checks session"| node_auth
node_dashboard -->|"offers role access"| node_doctor
node_dashboard -->|"offers upload"| node_branch
node_branch -->|"records uploads"| node_database
node_branch -->|"checks roles"| node_auth
node_pathologist -->|"signs reports"| node_functions
node_functions -->|"updates reports"| node_database
node_patient -->|"reads reports"| node_database
node_visitor -->|"submits report lookup"| node_verify
node_verify -->|"checks integrity"| node_functions
node_verify -.->|"requests verification"| node_verify_api
node_verify_api -->|"reads report"| node_database
node_pki -.->|"requests revocation"| node_revoke
node_revoke -->|"updates certificate"| node_database
node_pki -.->|"logs incidents"| node_incident
node_incident -->|"records incident"| node_functions
node_functions -->|"stores incident"| node_database
node_database -.->|"persists data"| node_store
node_visitor -->|"views evidence"| node_evidence
node_visitor -->|"views documentation"| node_documentation
node_visitor -->|"finds branches"| node_branches

click node_home "https://github.com/shabbirmai124/spordha-diagnostics-ltd-pki-secure-medical-web-portal/blob/main/index.php"
click node_services "https://github.com/shabbirmai124/spordha-diagnostics-ltd-pki-secure-medical-web-portal/blob/main/services.php"
click node_identity "https://github.com/shabbirmai124/spordha-diagnostics-ltd-pki-secure-medical-web-portal/blob/main/login.php"
click node_auth "https://github.com/shabbirmai124/spordha-diagnostics-ltd-pki-secure-medical-web-portal/blob/main/includes/auth.php"
click node_dashboard "https://github.com/shabbirmai124/spordha-diagnostics-ltd-pki-secure-medical-web-portal/blob/main/dashboard.php"
click node_doctor "https://github.com/shabbirmai124/spordha-diagnostics-ltd-pki-secure-medical-web-portal/blob/main/doctor_portal.php"
click node_branch "https://github.com/shabbirmai124/spordha-diagnostics-ltd-pki-secure-medical-web-portal/blob/main/branch_upload.php"
click node_pathologist "https://github.com/shabbirmai124/spordha-diagnostics-ltd-pki-secure-medical-web-portal/blob/main/pathologist_studio.php"
click node_report "https://github.com/shabbirmai124/spordha-diagnostics-ltd-pki-secure-medical-web-portal/blob/main/generate_report.php"
click node_patient "https://github.com/shabbirmai124/spordha-diagnostics-ltd-pki-secure-medical-web-portal/blob/main/patient_portal.php"
click node_verify "https://github.com/shabbirmai124/spordha-diagnostics-ltd-pki-secure-medical-web-portal/blob/main/verify.php"
click node_verify_api "https://github.com/shabbirmai124/spordha-diagnostics-ltd-pki-secure-medical-web-portal/blob/main/api/verify_report.php"
click node_pki "https://github.com/shabbirmai124/spordha-diagnostics-ltd-pki-secure-medical-web-portal/blob/main/pki_soc.php"
click node_revoke "https://github.com/shabbirmai124/spordha-diagnostics-ltd-pki-secure-medical-web-portal/blob/main/api/revoke_cert.php"
click node_incident "https://github.com/shabbirmai124/spordha-diagnostics-ltd-pki-secure-medical-web-portal/blob/main/api/incident_action.php"
click node_functions "https://github.com/shabbirmai124/spordha-diagnostics-ltd-pki-secure-medical-web-portal/blob/main/includes/functions.php"
click node_database "https://github.com/shabbirmai124/spordha-diagnostics-ltd-pki-secure-medical-web-portal/blob/main/config/database.php"
click node_store "https://github.com/shabbirmai124/spordha-diagnostics-ltd-pki-secure-medical-web-portal/blob/main/database/spordha.db"
click node_evidence "https://github.com/shabbirmai124/spordha-diagnostics-ltd-pki-secure-medical-web-portal/blob/main/evidence_gallery.php"
click node_documentation "https://github.com/shabbirmai124/spordha-diagnostics-ltd-pki-secure-medical-web-portal/blob/main/documentation.php"
click node_branches "https://github.com/shabbirmai124/spordha-diagnostics-ltd-pki-secure-medical-web-portal/blob/main/branches.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_home,node_services,node_identity,node_dashboard,node_evidence,node_documentation,node_branches,node_visitor toneBlue
class node_doctor,node_branch,node_pathologist,node_report,node_patient,node_verify,node_verify_api toneAmber
class node_pki,node_revoke,node_incident toneMint
class node_auth,node_functions,node_database,node_store toneRose
```

## Components

### Portal & Identity

- [Public portal](https://github.com/shabbirmai124/spordha-diagnostics-ltd-pki-secure-medical-web-portal/blob/main/index.php): `index.php`
- [Diagnostic services](https://github.com/shabbirmai124/spordha-diagnostics-ltd-pki-secure-medical-web-portal/blob/main/services.php): `services.php`
- [Sign-in & registration](https://github.com/shabbirmai124/spordha-diagnostics-ltd-pki-secure-medical-web-portal/blob/main/login.php): `login.php`
- [Role dashboard](https://github.com/shabbirmai124/spordha-diagnostics-ltd-pki-secure-medical-web-portal/blob/main/dashboard.php): `dashboard.php`
- [Evidence gallery](https://github.com/shabbirmai124/spordha-diagnostics-ltd-pki-secure-medical-web-portal/blob/main/evidence_gallery.php): `evidence_gallery.php`
- [Project documentation](https://github.com/shabbirmai124/spordha-diagnostics-ltd-pki-secure-medical-web-portal/blob/main/documentation.php): `documentation.php`
- [Branch directory](https://github.com/shabbirmai124/spordha-diagnostics-ltd-pki-secure-medical-web-portal/blob/main/branches.php): `branches.php`

### Clinical Workflow

- [Doctor portal](https://github.com/shabbirmai124/spordha-diagnostics-ltd-pki-secure-medical-web-portal/blob/main/doctor_portal.php): `doctor_portal.php`
- [Branch upload](https://github.com/shabbirmai124/spordha-diagnostics-ltd-pki-secure-medical-web-portal/blob/main/branch_upload.php): `branch_upload.php`
- [Pathologist studio](https://github.com/shabbirmai124/spordha-diagnostics-ltd-pki-secure-medical-web-portal/blob/main/pathologist_studio.php): `pathologist_studio.php`
- [Report generation](https://github.com/shabbirmai124/spordha-diagnostics-ltd-pki-secure-medical-web-portal/blob/main/generate_report.php): `generate_report.php`
- [Patient portal](https://github.com/shabbirmai124/spordha-diagnostics-ltd-pki-secure-medical-web-portal/blob/main/patient_portal.php): `patient_portal.php`
- [Report verification](https://github.com/shabbirmai124/spordha-diagnostics-ltd-pki-secure-medical-web-portal/blob/main/verify.php): `verify.php`
- [Verification API](https://github.com/shabbirmai124/spordha-diagnostics-ltd-pki-secure-medical-web-portal/blob/main/api/verify_report.php): `api/verify_report.php`

### PKI & Security

- [PKI operations center](https://github.com/shabbirmai124/spordha-diagnostics-ltd-pki-secure-medical-web-portal/blob/main/pki_soc.php): `pki_soc.php`
- [Certificate revocation API](https://github.com/shabbirmai124/spordha-diagnostics-ltd-pki-secure-medical-web-portal/blob/main/api/revoke_cert.php): `api/revoke_cert.php`
- [Incident action API](https://github.com/shabbirmai124/spordha-diagnostics-ltd-pki-secure-medical-web-portal/blob/main/api/incident_action.php): `api/incident_action.php`

### Shared Runtime

- [Authentication & roles](https://github.com/shabbirmai124/spordha-diagnostics-ltd-pki-secure-medical-web-portal/blob/main/includes/auth.php): `includes/auth.php`
- [Digest & security helpers](https://github.com/shabbirmai124/spordha-diagnostics-ltd-pki-secure-medical-web-portal/blob/main/includes/functions.php): `includes/functions.php`
- [Database connection](https://github.com/shabbirmai124/spordha-diagnostics-ltd-pki-secure-medical-web-portal/blob/main/config/database.php): `config/database.php`
- [Application data](https://github.com/shabbirmai124/spordha-diagnostics-ltd-pki-secure-medical-web-portal/blob/main/database/spordha.db): `database/spordha.db`

### Other components

- **Portal user**

## Connections

- Portal user → Public portal: browses (evidence: `README.md`)
- Public portal → Diagnostic services: explores tests
- Portal user → Sign-in & registration: signs in
- Sign-in & registration → Authentication & roles: authenticates (evidence: `login.php`)
- Authentication & roles → Database connection: queries users (evidence: `includes/auth.php`)
- Role dashboard → Authentication & roles: checks session (evidence: `dashboard.php`)
- Role dashboard → Doctor portal: offers role access (evidence: `dashboard.php`)
- Role dashboard → Branch upload: offers upload (evidence: `dashboard.php`)
- Branch upload → Database connection: records uploads (evidence: `branch_upload.php`)
- Branch upload → Authentication & roles: checks roles (evidence: `branch_upload.php`)
- Pathologist studio → Digest & security helpers: signs reports (evidence: `README.md`)
- Digest & security helpers → Database connection: updates reports (evidence: `includes/functions.php`)
- Patient portal → Database connection: reads reports (evidence: `patient_portal.php`)
- Portal user → Report verification: submits report lookup (evidence: `README.md`)
- Report verification → Digest & security helpers: checks integrity (evidence: `verify.php`)
- Report verification → Verification API: requests verification
- Verification API → Database connection: reads report (evidence: `api/verify_report.php`)
- PKI operations center → Certificate revocation API: requests revocation
- Certificate revocation API → Database connection: updates certificate (evidence: `api/revoke_cert.php`)
- PKI operations center → Incident action API: logs incidents
- Incident action API → Digest & security helpers: records incident (evidence: `api/incident_action.php`)
- Digest & security helpers → Database connection: stores incident (evidence: `includes/functions.php`)
- Database connection → Application data: persists data
- Portal user → Evidence gallery: views evidence
- Portal user → Project documentation: views documentation
- Portal user → Branch directory: finds branches
