# Production readiness checklist

This checklist is mandatory before any real patient data is processed.

## Platform and deployment
- [ ] Install dependencies with Composer on the target PHP 8.3+ host and run `composer validate`.
- [ ] Configure a fresh MySQL 8 database with a least-privilege account.
- [ ] Configure `APP_KEY`, `APP_ENV=production`, `APP_DEBUG=false`, HTTPS and secure cookies.
- [ ] Point the web root exclusively to `public/`; deny access to source, `.env`, vendor and storage.
- [ ] Confirm PHP-FPM, Nginx/Apache, file permissions, TLS renewal, monitoring and log rotation.
- [ ] Run migrations and seeders on an empty staging database; verify rollback and recovery.

## Identity, access and privacy
- [ ] Create named user accounts and assign least-privilege roles and facility scope.
- [ ] Test every role against every module, action and cross-facility record boundary.
- [ ] Add/verify MFA, password reset, account lockout, staff offboarding and periodic access reviews.
- [ ] Complete NDPA 2023 / NDPC compliance assessment, DPIA, privacy notices, lawful-basis review and processor agreements.
- [ ] Define consent, retention, correction, access request, breach response and data-subject request processes.
- [ ] Review encryption at rest, key management, secrets rotation, audit immutability and access monitoring.

## Clinical governance
- [ ] Obtain Nigerian clinical leadership approval for clinical forms, terminology, thresholds, EWS and CDSS protocols.
- [ ] Validate clinical workflows with representative clinicians and patient-safety reviewers.
- [ ] Verify drug formulary, allergy/interaction data, dispensing controls and pharmacy governance.
- [ ] Verify lab units, reference ranges, critical values and independent result verification.
- [ ] Approve national/local maternal, child-health and immunisation protocols and schedules.
- [ ] Validate referral, triage, alert acknowledgement and escalation workflows.
- [ ] Prohibit use of AI predictions until model validation, fairness, calibration, external validation and governance approval are complete.

## Interoperability and offline
- [ ] Run FHIR R4 conformance tests against target profiles and terminology bindings.
- [ ] Load only licensed/approved ICD and LOINC distributions and validate code mappings.
- [ ] Validate DHIS2 UIDs, dataset periods, organisation-unit mappings and payloads in a test instance.
- [ ] Threat-model PWA/IndexedDB, device loss, shared devices, session expiry and queued-operation conflicts.
- [ ] Confirm offline storage remains limited to non-patient inventory stocktake data.

## Verification and acceptance
- [ ] Run `bash scripts/verify-project.sh` on the deployment build with Composer and a test database available.
- [ ] Run full Laravel feature tests, migration tests, API tests and browser-based end-to-end tests.
- [ ] Run static analysis, dependency vulnerability scanning, SAST/DAST and independent penetration testing.
- [ ] Run load, concurrency and financial transaction integrity tests.
- [ ] Test encrypted backup, restore, disaster recovery, RPO and RTO.
- [ ] Obtain written clinical, privacy, security, operational and executive sign-off.

## Container deployment checks
- [ ] Build the Docker image in controlled CI using a reviewed and committed `composer.lock`.
- [ ] Run Docker Compose in staging and verify PHP-FPM, Nginx and MySQL health.
- [ ] Verify TLS termination, trusted proxy headers, secure cookies and host firewall.
- [ ] Run migrations and seeders against an empty staging database.
- [ ] Create the first super administrator using the interactive Artisan command.
- [ ] Test database and private-document volume backup and restore.
