Domain

Set up, configure, and run the Reloop domain microservice locally.

Complete Base Setup First

Ensure you've finished the Setup — before proceeding.

Service Overview

Custom sending domains, DKIM keys, DNS verification, and tracking subdomain setup.

PropertyValue
Directoryapps/backend/domain
Port8011
Local URLhttps://local.reloop.sh/api/domain
Swagger UIhttps://local.reloop.sh/api/domain/openapi
StackElysiaJS PostgreSQL Redis NATS

Quick Start

Run from the monorepo root:

bun be:domain:dev

The service starts with hot reloading on port 8011.

Environment Configuration

Variables live in apps/backend/domain/.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=8011
BASE_URL="https://local.reloop.sh"
HOST_DOMAIN=reloop.sh
DKIM_SELECTOR=reloop
NATS_URL=nats://localhost:4222
NODE_ENV=development

Reference Table

VariableRequiredDefault
PG_URLYESpostgresql://...
REDIS_URLYESredis://...
PORTYES8011
BASE_URLYEShttps://local.reloop.sh
HOST_DOMAINYESreloop.sh
DKIM_SELECTORYESreloop
NATS_URLYESnats://localhost:4222

Development Commands

CommandDescription
bun be:domain:devStart dev server with hot reloading
bun run --filter=domain-service buildCompile production bundle
bun run --filter=domain-service startRun compiled production build
bun run --filter=domain-service check-typesTypeScript type-check

Architecture

LayerDetail
DNS verificationValidates DKIM, SPF, DMARC, MX, and CNAME records per domain capability toggles.
Inbound validationUsed by the inbound MTA to verify recipient addresses.
Schemadomain and domain_dns_record in packages/db/src/schema/domain.ts.
EventsPublishes domain lifecycle events to NATS.

Was this page helpful?

Edit this page