Redis Setup
Prime SaaS uses Redis as the backing store for BullMQ — the background job queue that handles async tasks like email sending, account expiration checks, trial notifications, and media cleanup.
1. Install Redis
macOS (Homebrew):
brew install redis
brew services start redis
Ubuntu/Debian:
sudo apt update
sudo apt install redis-server
sudo systemctl start redis-server
sudo systemctl enable redis-server
Docker:
docker run -d \
--name primesaas-redis \
-p 6379:6379 \
redis:7-alpine
2. Verify Redis is running
redis-cli ping
# PONG
3. Configure environment variables
In demo-server/.env:
REDIS_HOST=localhost
REDIS_PORT=6379
# REDIS_PASSWORD=yourpassword # Only needed if Redis auth is enabled
Background jobs powered by Redis
BullMQ uses Redis to queue and process these jobs:
| Job | Description |
|---|---|
| Account expiration | Marks accounts as expired when trials end |
| Trial notifications | Sends warning emails before trial expires |
| Billing refresh | Resets usage counters on billing cycle renewal |
| Media cleanup | Removes orphaned media files from S3 |
| Plan validation | Checks plan consistency across accounts |
| Slack notifications | Sends alerts for payments, errors, violations |