# Phase 17 — Documentation and deployment

Phase 17 completes the application build with audience-specific manuals, production
configuration, runtime health checks, deployment/rollback automation, backup/restore
procedures, and an installation rehearsal.

## Delivered

- User guide covering applicant, student, lecturer, finance, document, graduation,
  formation/research, messaging, privacy, and support workflows.
- Administrator manual with module ordering, least privilege, sensitive-data rules,
  and daily/weekly/monthly reviews.
- Local and production installation instructions.
- Nginx/PHP-FPM, Supervisor queue worker, and systemd scheduler templates.
- Atomic symlink deployment with locked dependencies, asset build, Laravel caches,
  forward migrations, queue restart, readiness verification, and code rollback.
- Non-destructive rollback procedure.
- Database/object/config/key backup scope, retention guidance, checksums, and isolated
  restore rehearsal.
- Monitoring, incident response, queue/payment/CBT troubleshooting, patching, and
  credential rotation runbook.
- `/ready` probe for database, cache, and private-storage dependencies, complementing
  the `/up` liveness probe without exposing dependency details.
- Development-only Registrar, Bursar, and Examination Officer accounts.

## Deployment rehearsal

All 18 migrations were applied to a new isolated SQLite database from zero and
`migrate:status` confirmed every migration. Composer's locked production dependency
set and npm's locked dependency set were dry-run validated. Laravel configuration,
route, and Blade caches, the scheduler inventory, readiness feature test, and
production asset build were validated.

The rehearsal database was created only under ignored `tmp/` workspace storage and
contains no production data.

## Production decision

The repository is deployable, but go-live still requires the external gates recorded
in Phase 16: production MySQL/Redis/S3/SMTP/payment sandbox testing, malware-scanner
integration, backup restore evidence, load testing, manual accessibility/browser
testing, monitoring/alerting, TLS/DNS, privacy/regulatory approval, and named incident
and rollback owners.

## Verification

Focused deployment suite: 5 tests, 30 assertions.
Final application suite: 127 tests, 492 assertions. Composer and npm security audits
reported no known vulnerabilities. The production Vite bundle and all Laravel caches
built successfully.

```powershell
C:\xampp\php\php.exe artisan test --filter=DeploymentReadinessTest
C:\xampp\php\php.exe artisan migrate:status
C:\xampp\php\php.exe artisan schedule:list
C:\xampp\php\php.exe artisan config:cache
C:\xampp\php\php.exe artisan route:cache
C:\xampp\php\php.exe artisan view:cache
C:\xampp\php\php.exe artisan test
```

Phase 17 and the requested implementation roadmap are complete.
