Project Structure
Quick overview of the monorepo organization - apps, packages, and tools.
A modern monorepo with clear separation between apps, shared packages, and development tools.
See Tech Stack for technology details.
Quick Overview
reloop/
├── apps/
│ ├── backend/ # ElysiaJS microservices
│ │ ├── api-key/ # API key management
│ │ ├── auth/ # Better Auth service
│ │ ├── billing/ # Stripe billing service
│ │ ├── contacts/ # Contact segmentation
│ │ ├── domain/ # Domain & DNS validations
│ │ ├── email/ # Direct transactional mail
│ │ ├── kumomta/ # Kumomta MTA logging
│ │ ├── kumomta-smtp/# SMTP protocol service
│ │ ├── logs/ # Clickhouse event logging
│ │ ├── mailing/ # Campaign delivery queues
│ │ ├── template/ # Visual template builder
│ │ ├── upload/ # File & S3 upload manager
│ │ ├── webhook/ # Webhook dispatching handlers
│ │ └── workflow/ # Automation workflows
│ └── frontend/ # Next.js applications
│ ├── dashboard/ # Core customer dashboard
│ ├── docs/ # Public MDX docs (this app)
│ └── web/ # Public marketing website
├── packages/ # Shared libraries (@reloop/ui, @reloop/db, etc.)
└── package.json # Workspace scripts & dependencies
Frontend Applications
We maintain three user-facing applications inside the monorepo:
Dashboard
User Dashboard: The main React/Next.js dashboard app. Includes workspaces, campaigns, templates, visual builders, and analytics views.
Web
Marketing Site: The public-facing website, product features page, and branding home built on Next.js.
Docs
Public Docs Portal: This developer documentation portal, built using standard MDX and Next.js.
Backend API Microservices
Our modular backend architecture consists of 14 dedicated ElysiaJS microservices inside apps/backend/. These coordinate via a NATS pub-sub bus and BullMQ background queues:
Auth Service
Manages signup, signin, permissions, organization memberships, and integrates Better Auth.
Mailing Service
Handles high-throughput marketing email delivery queues and campaigns dispatching.
Domain Service
Manages sending domains, DKIM signing keys, and automated DNS verification.
Webhook Service
Processes system events, matches triggers, and dispatches external webhook payloads.
Contacts Service
Maintains contact books, segments lists, and manages contact metadata.
API Key Service
Authorizes and manages developers' external API tokens.
Logs Service
ClickHouse querying layer for tracking event histories, open/click counts, and bounces.
Workflow Service
Runs the automation sequence triggers and marketing logic flows.
Upload Service
Asset storage provider orchestrating direct-to-S3 signed uploads and CDNs.
Template Service
Manages visual email templates, drag-and-drop JSON blocks, and HTML rendering.
Kumomta Service
MTA bridge collecting logging signals, incoming bounces, and status receipts.
Email Service
Serves single transactional emails and notifications.
Billing Service
Stripe integration managing client invoices and pricing tiers.
Kumomta SMTP
Handles low-level SMTP protocol setups for mail routing.
Shared Packages
Shared libraries inside /packages ensure consistent types, schemas, and logic across the entire repository:
@reloop/ui
Core shared UI design system and components package.
@reloop/db
Relational PostgreSQL Drizzle schema and query client.
@reloop/auth
Shared authentication utility logic.
@reloop/bus
NATS messaging bus wrapper library.
@reloop/cache
Redis caching layer utility functions.
@reloop/webhook-events
Shared TypeScript models and typings for webhook event definitions.
@reloop/apikey
API key hashing and verification utilities.
@reloop/analytics
Analytical queries and ClickHouse schema helper client.
Configuration Tooling
Global settings and development pipelines are kept unified under dedicated directories:
@reloop/tailwind
Shared Tailwind CSS themes and global rules.
@reloop/tsconfig
Shared compiler specifications for apps and library environments.
Key Benefits of this Monorepo Structure
- Typesafe Contract (Zero-overhead APIs): Drizzle database schemas, UI components, and TypeScript interfaces are shared directly between frontend applications and backend microservices, ensuring absolute compile-time type safety.
- Fast Build Caching (Turborepo): Build and lint processes are optimized globally. Unchanged packages leverage fast local and cloud caches, reducing build times to near-instant.
- Unified Code Style: A global Biome layout enforces extremely fast formatting, import sorting, and linting rules across all workspaces.
- Modular Abstraction: Each backend feature functions as a decoupled microservice, allowing developer teams to scale and deploy distinct modules without interference.