# Production Operations

Run these checks before and after each deployment.

## Release Checks

- `composer install --no-dev --optimize-autoloader`
- `npm ci`
- `npm run build`
- `php artisan migrate --force`
- `php artisan config:cache`
- `php artisan route:cache`
- `php artisan view:cache`
- `php artisan storage:link`
- `php artisan app:production-check`

## Cron

Add one cron entry on the server:

```bash
* * * * * cd /path/to/stephup && php artisan schedule:run >> /dev/null 2>&1
```

The scheduler creates a backup every day at 02:00 and keeps the latest seven scheduled backups.

## Queue Worker

Run a queue worker for notifications and background jobs:

```bash
php artisan queue:work --tries=3 --timeout=90
```

On shared hosting, use the host's process manager if available. If not, keep mail on a synchronous path until a worker can be supervised.

## Health

Admins can review system health from Settings. The same checks are available in the terminal:

```bash
php artisan app:production-check
```

Review failed jobs, test SMTP from Settings, and download a fresh backup after every successful deployment.
