# Deployment

## cPanel / normal PHP hosting

1. Create MySQL database and user.
2. Import `database/schema.sql`.
3. Import `database/seed.sql`.
4. Edit `app/config.php` with database credentials and the public URL.
5. Upload the project.
6. Set the document root to the `public` folder.
7. Keep `app/`, `database/`, `cron/` and `storage/` outside the document root where possible.
8. Run `php cron/daily_alerts.php` daily from cPanel Cron Jobs.
9. Use HTTPS.
10. Change all demo passwords.

If the hosting cannot set a document root to `public`, protect non-public directories with server rules and do not expose SQL files.

## Docker quick start

The supplied `docker-compose.yml` is a development/demo starting point. Change all passwords before use.

`docker compose up -d`

Then open `http://localhost:8080`.

For production, use a proper PHP/Apache image with required extensions baked into the image rather than installing extensions during container startup.

## Recommended production settings
- PHP 8.2/8.3
- MySQL 8
- HTTPS
- Daily database backup + offsite copy
- Monthly restore test
- SMTP provider for email notifications
- Least-privilege DB account
- WAF / reverse proxy if internet exposed
- File upload restrictions if attachments are added later
