Skip to main content

Overview

Sendook is open source and can be self-hosted for full control over your email infrastructure. The stack includes:
  • API - Node.js backend with Bun runtime
  • App - Nuxt 3 dashboard application
  • Landing - Nuxt 3 marketing website
  • Database - MongoDB for data persistence
  • Cache - Redis for session management (optional)

Quick Start with Docker

The fastest way to get Sendook running is with Docker.

Prerequisites

  • Docker and Docker Compose installed
  • MongoDB instance (local or hosted)
  • AWS account with SES configured
  • Stripe account (for billing)

Build and Run API

1. Build the Docker image
2. Run the container

Dockerfile Explanation

The API uses Bun’s official Docker image:
The Dockerfile exposes port 3000 internally, but the API listens on port 8006 by default. Map the ports accordingly.

Environment Variables

Required Variables

MongoDB

Connection string for your MongoDB database.

Email Domain

Default domain for creating inboxes without custom domains.

AWS Credentials

AWS credentials with permissions for:
  • SES (Simple Email Service) - Send and receive emails
  • SES domain verification
  • SES configuration sets

Stripe Configuration

  • STRIPE_SECRET_KEY - Your Stripe API secret key
  • STRIPE_WEBHOOK_SECRET - Webhook signing secret for verifying events
  • STRIPE_PRICE_ID - Usage-based price ID from your Stripe product
  • STRIPE_PRODUCT_ID - Product ID from Stripe
  • STRIPE_METER_EVENT - Name of the billing meter event

Optional Variables

Redis

Redis host for caching (optional but recommended for production).

Rupt Integration

Optional secret key for Rupt integration (fake accounts & account takeover features).

Port Configuration

Port for the API server (defaults to 8006).

Environment

Environment identifier for logging and debugging.

Running Locally

API Server

Sendook uses Bun instead of Node.js for better performance. Development Mode
The API will start on http://localhost:8006 with hot reload enabled. Production Mode
Bun automatically loads .env files, so you don’t need dotenv.

Dashboard App

The dashboard is built with Nuxt 3. Development Mode
Production Mode
Environment Variables

Landing Site

The marketing site is also built with Nuxt 3.
No environment variables required for the landing site.

AWS SES Setup

Sendook uses AWS SES for email sending and receiving.

Prerequisites

  1. AWS Account - Sign up at aws.amazon.com
  2. SES Access - Enable SES in your AWS region
  3. Move out of sandbox - Request production access to send to any email

Configuration Steps

1. Verify Domain In AWS SES Console:
  • Go to “Verified identities”
  • Click “Create identity”
  • Select “Domain”
  • Enter your domain
  • Follow DNS verification steps
2. Create IAM User Create an IAM user with these permissions:
Save the access key ID and secret access key. 3. Configure Receiving For receiving emails:
  • Create an S3 bucket (optional, for email storage)
  • Set up SES receipt rules
  • Configure SNS topics or Lambda functions for processing
4. DNS Records Add these DNS records for each domain: MX Record (for receiving):
DKIM Records (provided by SES):
SPF Record (optional but recommended):
DMARC Record (optional):

MongoDB Setup

Local MongoDB

Using Docker
Using MongoDB Community Edition Download and install from mongodb.com.

Hosted MongoDB

Use a managed MongoDB service: Get your connection string and set it as MONGO_URI.

Database Migrations

Sendook runs migrations automatically on startup:
Migrations are located in api/migrations/.

Production Deployment

Using Docker Compose

Create a docker-compose.yml:
Run with:

Deployment Platforms

Railway

Deploy with one click using Railway’s Docker support. Connect your GitHub repo and set environment variables.

Fly.io

Use Fly.io for global edge deployment. Create a fly.toml and deploy with fly deploy.

AWS ECS

Run on AWS ECS with Fargate for serverless containers. Use ECR for Docker images.

DigitalOcean

Deploy to DigitalOcean App Platform or Droplets with Docker.

Repository Structure

Understanding the monorepo layout:

Security Considerations

Always use environment variables for secrets. Never commit credentials to version control.

Production Checklist

  • Use strong, unique passwords for MongoDB
  • Enable MongoDB authentication
  • Use Stripe live mode keys (not test keys)
  • Configure HTTPS/TLS for all endpoints
  • Set up firewall rules (only allow necessary ports)
  • Enable AWS SES production access (out of sandbox)
  • Rotate AWS and Stripe keys regularly
  • Set up monitoring and logging
  • Configure backup strategy for MongoDB
  • Use Redis for session management
  • Set up rate limiting
  • Enable CORS only for trusted origins

Monitoring and Logs

Health Check Endpoint

The API provides a health check:
Response:

Logging

Sendook logs to stdout/stderr. Capture logs with: Docker
Production Use a logging service:
  • CloudWatch Logs (AWS)
  • Datadog
  • Loggly
  • Papertrail

Troubleshooting

  • Verify MONGO_URI is correct
  • Check MongoDB is running: docker ps or systemctl status mongod
  • Ensure network connectivity between API and MongoDB
  • Check MongoDB authentication credentials
  • Verify AWS credentials are correct
  • Check SES is enabled in your AWS region
  • Ensure you’re out of SES sandbox mode
  • Verify domain is verified in SES
  • Check CloudWatch logs for SES errors
  • Verify all Stripe environment variables are set
  • Check you’re using the correct key type (test vs live)
  • Ensure webhook secret matches your Stripe webhook
  • Verify the price ID exists in your Stripe account
  • Change PORT environment variable to an available port
  • Check for other processes: lsof -i :8006
  • Stop conflicting services
  • Ensure Docker has enough memory allocated
  • Check package.json and bun.lock are present
  • Verify Docker has internet access for dependencies
  • Try docker system prune to clear cache

Performance Optimization

Use Redis

Configure Redis for session caching and improved performance.

Database Indexing

MongoDB indexes are created by migrations. Monitor slow queries.

Connection Pooling

Mongoose handles connection pooling automatically.

Load Balancing

Deploy multiple API instances behind a load balancer for high availability.

Next Steps

Authentication

Set up API keys and access tokens

Dashboard

Learn how to use the dashboard

API Reference

Explore the API endpoints

Billing Setup

Configure Stripe billing