Contacts
Set up, configure, and run the Reloop contacts microservice locally.
Complete Base Setup First
Ensure you've finished the Setup — before proceeding.
Service Overview
Subscriber profiles, groups, channels, custom properties, and suppression lists.
| Property | Value |
|---|---|
| Directory | apps/backend/contacts |
| Port | 8014 |
| Local URL | https://local.reloop.sh/api/contacts |
| Swagger UI | https://local.reloop.sh/api/contacts/openapi |
| Stack | ElysiaJS PostgreSQL Redis NATS |
Quick Start
Run from the monorepo root:
bun be:contacts:dev
The service starts with hot reloading on port 8014.
Environment Configuration
Variables live in apps/backend/contacts/.env. Running bun env:setup from the root auto-populates this file.
PG_URL=postgresql://reloop:reloop123@localhost:5432/reloop
REDIS_URL=redis://:reloop123@localhost:6379
PORT=8014
BASE_URL="https://local.reloop.sh"
NATS_URL=nats://localhost:4222
PREFERENCES_SECRET="reloop-preferences-secret-key-change-in-prod"
NODE_ENV=development
PREFERENCES_SECRET signs preference-center tokens consumed by the Links app. The service refuses to start in production if this is left at the default dev value.
Reference Table
| Variable | Required | Default |
|---|---|---|
PG_URL | YES | postgresql://... |
REDIS_URL | YES | redis://... |
PORT | YES | 8014 |
BASE_URL | YES | https://local.reloop.sh |
NATS_URL | YES | nats://localhost:4222 |
PREFERENCES_SECRET | Prod only | Dev default in .env.dev — must be a strong random value in production |
Development Commands
| Command | Description |
|---|---|
bun be:contacts:dev | Start dev server with hot reloading |
bun run --filter=contacts build | Compile production bundle |
bun run --filter=contacts start | Run compiled production build |
bun run --filter=contacts check-types | TypeScript type-check |
Architecture
| Layer | Detail |
|---|---|
| Audience | Contacts, groups, channels, and custom properties per organization. |
| Preferences | Powers the Links preference center. |
| Events | Lifecycle events published to NATS under contacts.*. |
| Schema | contact, channel, group in packages/db/src/schema/. |
Was this page helpful?