Set up, configure, and run the Reloop platform email microservice locally.
Complete Base Setup First
Ensure you've finished the Setup — before proceeding.
Not the same as Mail
Email sends platform notifications to Reloop users (invites, password resets). Mail is the customer-facing send API for their audiences.
Service Overview
Platform transactional emails triggered by NATS events (invites, OTPs, billing alerts).
| Property | Value |
|---|---|
| Directory | apps/backend/email |
| Port | 8022 |
| Local URL | https://local.reloop.sh/api/email |
| Swagger UI | https://local.reloop.sh/api/email/openapi |
| Stack | ElysiaJS Redis NATS |
Quick Start
Run from the monorepo root:
bun be:email:dev
The service starts with hot reloading on port 8022.
Environment Configuration
Variables live in apps/backend/email/.env. Running bun env:setup from the root auto-populates this file.
EMAIL_PORT=8022
PORT=8022
BASE_URL="https://local.reloop.sh"
NATS_URL=nats://localhost:4222
RELOOP_API_KEY=
RELOOP_SENDER_DOMAIN=
NODE_ENV=development
Reference Table
| Variable | Required | Default | Notes |
|---|---|---|---|
EMAIL_PORT / PORT | YES | 8022 | Listening port |
BASE_URL | YES | https://local.reloop.sh | Platform base URL |
NATS_URL | YES | nats://localhost:4222 | Event subscriptions |
RELOOP_API_KEY | YES | — | Internal key for send authorization |
RELOOP_SENDER_DOMAIN | YES | — | From-address domain |
Development Commands
| Command | Description |
|---|---|
bun be:email:dev | Start dev server with hot reloading |
bun run --filter=email build | Compile production bundle |
bun run --filter=email start | Run compiled production build |
bun run --filter=email check-types | TypeScript type-check |
Architecture
| Layer | Detail |
|---|---|
| Triggers | Subscribes to NATS subjects (auth.*, billing.*, etc.). |
| Delivery | Sends via the mail pipeline using RELOOP_API_KEY. |
| Schema | email_log in packages/db/src/schema/email.ts. |
Was this page helpful?