Production
Queue Workers
The app uses three queues that need workers:
| Queue | Purpose |
|---|---|
default | General jobs (geocoding, webhook processing) |
oos | Out-of-stock subscription processing |
notifications | Email notifications (back-in-stock alerts) |
Running Workers
Single worker processing all queues:
php artisan queue:work --queue=default,oos,notifications --tries=3Or dedicated workers per queue for better isolation:
php artisan queue:work --queue=default --tries=3
php artisan queue:work --queue=oos --tries=3
php artisan queue:work --queue=notifications --tries=3TIP
In production, use a process manager (systemd, Supervisor) to keep workers running and auto-restart on failure.
Horizon
The app includes Laravel Horizon for queue monitoring and management.
Dashboard
Horizon's dashboard is available at /horizon (access controlled via a Gate). It provides:
- Real-time job monitoring
- Failed job management
- Queue metrics and throughput
- Worker status
Configuration
Horizon is configured in config/horizon.php. Key settings:
- Supervisor blocks with queue assignments
- Balancing strategy
- Min/max processes per supervisor
- Job timeout and retry settings
Metrics
Schedule the snapshot command for Horizon metrics:
php artisan horizon:snapshotAdd to the scheduler or cron for regular metric collection.
Scheduler
Add to your server's crontab:
* * * * * cd /path/to/app && php artisan schedule:run >> /dev/null 2>&1Scheduled Tasks
| Command | Schedule | Purpose |
|---|---|---|
webhook:cleanup --days=30 | Daily | Purge old webhook event records |
data:purge | Daily | GDPR-compliant data cleanup |
bundles:cleanup | Periodic | Remove orphaned discounts |
bundles:health | Periodic | Monitor discount status |
bundles:refresh-anchors | Periodic | Refresh anchor cache |
Bundle commands only run when SHOPIFY_FEATURE_BUNDLES is enabled.
Health Checks
The app uses Spatie Laravel Health for monitoring.
Endpoint
GET /health — returns the current health status.
Checks
Configure health checks in app/Providers/HealthServiceProvider.php. Typical checks include:
- Database connectivity
- Redis connectivity
- Queue worker status
- Disk space
- Horizon status
Error Monitoring
Flare
Flare is configured for error monitoring. Set FLARE_KEY in .env to enable.
Log Viewer
The Log Viewer package provides a web UI for browsing application logs. Access is IP-gated via a Gate definition in AppServiceProvider.
GDPR Compliance
Webhook Handlers
The app handles three GDPR compliance webhooks from Shopify:
| Webhook | Action |
|---|---|
customers/data_request | Returns stored customer data (wishlists, OOS subscriptions) |
customers/redact | Deletes all stored data for a customer |
shop/redact | Deletes all stored data for a shop |
Scheduled Purge
The data:purge command runs daily to remove expired data:
- OOS subscriptions older than the configured retention period
- Wishlist data older than the configured retention period
Use --dry-run to preview what would be deleted:
php artisan data:purge --dry-runSSL
An SSL certificate is required for the App Proxy. Shopify will not proxy requests to HTTP endpoints.
Environment Considerations
- Set
APP_ENV=productionandAPP_DEBUG=false - Configure a proper
APP_URL(must match the Dev Dashboard proxy URL) - Use
phpredisfor Redis in production (better performance than predis) - Set appropriate
CACHE_STORE=redisandSESSION_DRIVER=redis