Template

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

Complete Base Setup First

Ensure you've finished the Setup — before proceeding.

Service Overview

Email template CRUD, visual builder storage, and HTML compilation for outbound sends.

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

Quick Start

Run from the monorepo root:

bun be:template:dev

The service starts with hot reloading on port 8019.

Environment Configuration

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

Reference Table

VariableRequiredDefault
PG_URLYESpostgresql://...
REDIS_URLYESredis://...
PORTYES8019
BASE_URLYEShttps://local.reloop.sh
NATS_URLYESnats://localhost:4222

Development Commands

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

Architecture

LayerDetail
BuilderStores drag-and-drop block JSON from the dashboard editor.
CompilationRenders HTML with merge tags for the mail service.
Schematemplate and revisions in packages/db/src/schema/template.ts.

Was this page helpful?

Edit this page