Deployment
Docker Compose Topology
notifito runs on a single VPS using Docker Compose. One container per application, Horizon per queue worker, Caddy as the reverse proxy.
Services
services:
# Infrastructure
postgres: # PostgreSQL 18 (port 55432)
redis: # Redis 8 (port 56379)
caddy: # Reverse proxy (port 80)
# Applications
edge: # Public API (host port 8002)
core: # Domain logic (internal only)
dispatch: # Delivery service (internal only)
dashboard: # Seller UI (internal only)
admin: # Admin panel (internal only)
# Queue workers
core-horizon: # Processes core queue
dispatch-horizon: # Processes dispatch queue
core-outbox: # Outbox relay
Caddy Routes
| Domain | Service |
|---|---|
edge.notifito.com | edge |
app.notifito.com | dashboard |
admin.notifito.com | admin |
cdn.notifito.com | static widget files |
Internal services (core, dispatch) are not exposed to the public internet.
Production Configuration
Environment Variables
Each service needs its own .env file. Critical production variables:
# Core
APP_ENV=production
APP_DEBUG=false
DB_HOST=postgres
DB_DATABASE=notifito_core
INTERNAL_SECRET=<random-64-char-string>
EDGE_URL=https://edge.notifito.com
Dispatch
POSTMARK_API_KEY=<your-postmark-api-key>
POSTMARK_WEBHOOK_USERNAME=<webhook-basic-auth-user>
POSTMARK_WEBHOOK_PASSWORD=<webhook-basic-auth-pass>
Dashboard / Admin
CORE_URL=http://core:8000
INTERNAL_SECRET=<same-random-64-char-string>
Database
- One Postgres server, one database per service
- No cross-database queries under any circumstance
- Each database can be lifted onto its own server later without a code change
Queue
- Laravel Horizon manages queue workers
- Named queues:
core-matching,dispatch-send,core-delivery - Dead-letter queue with alerts for poison messages
SSL/TLS
Caddy handles automatic HTTPS via Let's Encrypt. No manual certificate management.
Scaling Considerations
Single VPS (current)
One server runs all services. Sufficient for the initial launch and early growth.
Horizontal Scaling
When needed:
- Database: Move each service's database to its own server
- Queue: Add more Horizon workers, or move to a dedicated queue server
- Applications: Run multiple instances behind Caddy load balancing
- Cache: Move Redis to a dedicated server or use a managed service
Per-Service Scaling
Services scale independently because they have separate databases and queues:
edgescales horizontally (stateless)corescales read replicas for matching, writes stay on primarydispatchscales horizontally (each notification is its own job)dashboardandadminscale horizontally (stateless, session in Redis)
Backups
Database
# Backup core database
docker compose exec postgres pg_dump -U notifito notifito_core > core-backup.sql
Backup dispatch database
docker compose exec postgres pg_dump -U notifito notifito_dispatch > dispatch-backup.sql
Automated Backups
Set up a cron job:
0 2 * * * docker compose exec -T postgres pg_dump -U notifito notifito_core | gzip > /backups/core-$(date +\%Y\%m\%d).sql.gz
0 2 * * * docker compose exec -T postgres pg_dump -U notifito notifito_dispatch | gzip > /backups/dispatch-$(date +\%Y\%m\%d).sql.gz
Monitoring
Health Checks
Each service exposes a /health endpoint:
GET /health → {"service": "core", "status": "ok"}
Observability
- Every message carries a correlation ID from ingest through send
- A single search reconstructs the full path of any notification
- Horizon dashboard for queue monitoring
Alerts
Configure alerts for:
- Queue depth exceeding threshold
- Delivery failure rate above baseline
- Provider webhook errors
- Disk space on database server