Codapult
DocsBlogPricingPluginsDemo
Get Codapult
Logo

Build your SaaS with AI. Keep the architecture under control.

Get Codapult

Product

  • Pricing
  • Architecture
  • Modules
  • AI platform
  • Plugins

Developers

  • MCP
  • CLI
  • Documentation
  • Launch your SaaS
  • Build a B2B SaaS

Resources

  • Blog
  • FAQ

Connect

  • Contact
  • GitHub

Compare

  • SaaS template comparison
  • Codapult vs Supastarter
  • Codapult vs Makerkit
  • Codapult vs ShipFast
  • Codapult vs SaaSBold
  • Codapult vs Gravity
  • Codapult vs Nextbase
  • Codapult vs BuilderKit

Featured on

Codapult on LaunchNestCodapult on LaunchNestbetterlaunch.cobetterlaunch.coFeatured on LaunchBuffFeatured on LaunchBuffCodapult on PeerPushCodapult on PeerPushFeatured on LaunchItFeatured on LaunchIt
© 2026 Codapult·All rights reserved·Privacy Policy·Terms of Service
Full source code · One-time purchase · Self-host anywhere
All articles

Getting Started

  • Introduction
  • Quick Start
  • Your First 30 Minutes
  • Project Structure
  • License and Permitted Use
  • Starter Profiles and Recipes
  • Product Recipes

Configuration

  • Environment Variables
  • App Configuration
  • Which Modules Should I Enable?
  • Provider Matrix
  • Capability Coverage

Database

  • Database and Provider Guide
  • Database
  • Migrations

Authentication

  • Authentication
  • OAuth Providers
  • Two-Factor & Passwordless
  • Enterprise SSO (SAML)

Ai

  • AI Runtime Architecture and Evals
  • AI Features
  • Streaming Chat
  • RAG and Semantic Search
  • Quotas and Memory

Teams

  • Teams & Organizations
  • Permissions & RBAC
  • SCIM Provisioning

Security

  • Data Retention Policy
  • Security

Deployment

  • Enterprise E2E Evidence
  • Enterprise Production Readiness
  • Deployment, Backup, and Restore Runbook
  • Deployment
  • Troubleshooting

Payments

  • Payments & Billing
  • Stripe Setup
  • LemonSqueezy Setup
  • Polar Setup
  • Payment Webhooks

Api

  • API Layer
  • tRPC
  • GraphQL

Email

  • Email
  • Email Templates

Infrastructure

  • Infrastructure
  • Self-Hosting
  • File Storage
  • Docker
  • Background Jobs
  • Terraform & Pulumi
  • Kubernetes

Ui

  • UI & Theming

I18n

  • Internationalization

Content Management

  • Content Management

Admin

  • Admin Panel

Monitoring

  • Analytics & Monitoring

Modules

  • Module Architecture
  • Waitlist
  • Audit Log
  • White-Labeling
  • Workflow Automation
  • A/B Testing
  • Welcome Page
  • Referrals
  • GDPR Export and Deletion
  • Promotions
  • Outgoing Webhooks

Plugins

  • Plugin System
  • CRM Plugin
  • Helpdesk Plugin
  • Email Marketing Plugin

Upgrading

  • Upgrading Codapult

Developer Tools

  • AI Agents & IDEs
  • MCP Server
  • Testing
  • Build Your First Feature with Codapult MCP
  • How Guard Blocks an Architectural Regression
Infrastructure

Background Jobs

Offload work to background jobs with in-memory or BullMQ (Redis) adapters.

Offload work to background jobs for email sending, webhook delivery, credit resets, and RAG indexing. The job adapter is selected by JOB_PROVIDER.

Providers

ProviderEnv ValueBest For
In-memory queuememory (default)Development, single-instance
BullMQ (Redis)bullmqProduction, multi-instance

Enqueuing Jobs

import { enqueue, enqueueEmail } from '@/lib/jobs';

// Generic job
await enqueue('webhook-retry', { webhookId: 'wh_123', attempt: 1 });

// Shorthand for emails
await enqueueEmail('user@example.com', 'Welcome!', emailHtml);

Pass a stable jobId when the same logical work may be enqueued more than once:

await enqueue('rag-index', document, { jobId: `rag:${document.sourceId}` });

Adapters treat a repeated jobId as the same queued job. This is an enqueue-level guard; handlers should still be safe to retry.

Built-in Jobs

Job NameDescription
send-emailSends transactional email via Resend
webhook-retryRetries failed webhook deliveries with exponential backoff
credit-resetResets monthly AI/usage credits for all organizations
rag-indexIndexes documents for AI RAG pipeline

Cron Jobs

ScheduleTask
DailySession cleanup (remove expired sessions)
MonthlyCredit reset (reset usage quotas)

Cron jobs run automatically when the app starts. They use the same job adapter.

Switching to BullMQ

For production, use BullMQ with Redis for durable, concurrent job processing:

JOB_PROVIDER="bullmq"
REDIS_URL="redis://localhost:6379"
JOB_QUEUE_NAME="my-app"   # optional, defaults to `appConfig.appName`

Worker Process

In production, run the worker as a separate process alongside your Next.js server. The worker picks up jobs from Redis and processes them independently.

For Kubernetes deployments, the Helm chart includes a dedicated worker Deployment. For Docker, add a separate service in docker-compose.yml.

Important: The memory adapter processes jobs in-process and loses pending jobs on restart. Always use bullmq in production.

BullMQ keeps exhausted jobs in Redis' failed set (removeOnFail retains the latest failed jobs). Treat that set as the dead-letter queue: alert on growth, inspect the error and payload, then replay only after the handler's side effects are idempotent. The failed count is exposed through getStats() for monitoring.

Environment Variables

VariableRequiredDescription
JOB_PROVIDERNo"memory" (default) or "bullmq"
REDIS_URLYes*Redis connection URL, e.g. redis://localhost:6379
JOB_QUEUE_NAMENoBullMQ queue name. Defaults to "codapult"

* Required when JOB_PROVIDER=bullmq.

DockerTerraform & Pulumi