Inbox
Set up, configure, and run the Reloop inbox microservice locally.
Complete Base Setup First
Ensure you've finished the Setup — before proceeding.
Service Overview
Agent Inbox API — mailboxes, threads, and messages from inbound email via NATS.
| Property | Value |
|---|---|
| Directory | apps/backend/inbox |
| Port | 8021 |
| Local URL | https://local.reloop.sh/api/inbox |
| Swagger UI | https://local.reloop.sh/api/inbox/openapi |
| Stack | ElysiaJS PostgreSQL Redis NATS MinIO |
Quick Start
Run from the monorepo root (requires inbound via Docker):
bun be:inbox:dev
The service starts with hot reloading on port 8021.
Environment Configuration
Variables live in apps/backend/inbox/.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=8021
BASE_URL="https://local.reloop.sh"
NATS_URL=nats://localhost:4222
S3_ENDPOINT=http://localhost:9010
S3_ACCESS_KEY=reloop
S3_SECRET_KEY=reloop123
S3_BUCKET=reloop-attachments
S3_REGION=us-east-1
S3_FORCE_PATH_STYLE=true
NODE_ENV=development
Reference Table
| Variable | Required | Default |
|---|---|---|
PG_URL | YES | postgresql://... |
REDIS_URL | YES | redis://... |
PORT | YES | 8021 |
NATS_URL | YES | nats://localhost:4222 |
S3_ENDPOINT | YES | http://localhost:9010 |
Development Commands
| Command | Description |
|---|---|
bun be:inbox:dev | Start dev server with hot reloading |
bun run --filter=inbox build | Compile production bundle |
bun run --filter=inbox start | Run compiled production build |
bun run --filter=inbox check-types | TypeScript type-check |
Architecture
| Layer | Detail |
|---|---|
| Inbound flow | inbound MTA → NATS → inbox persistence. |
| Attachments | Stored in MinIO via S3-compatible endpoint. |
| Dashboard API | Mailboxes, threads, and messages at /api/inbox. |
Was this page helpful?