A modern, scalable newsletter automation platform built with a microservices architecture using Turborepo. This monorepo contains all the services and packages needed to create, manage, and send AI-powered newsletters.
This platform allows users to create personalized newsletters with AI-generated content based on specified topics and requirements. The system handles scheduling, content generation, and email delivery through a series of coordinated microservices.
This Turborepo includes the following apps and packages:
api: An Express.js REST API server that handles user requests, newsletter management, and webhook processingweb: A Next.js frontend application with user authentication, newsletter creation/management, and dashboardqueue-worker: A worker service that monitors the queue for scheduled newsletters and triggers processingprocessor-worker: A worker service that generates newsletter content using LLMs and sends emails
@repo/db: PostgreSQL database access layer using Prisma ORM@repo/logger: Centralized logging system using Pino@repo/queue: Redis-based job queue system using BullMQ@repo/mailer: Email delivery service using Nodemailer@repo/llm: AI language model integration with LangChain (OpenAI, Groq)@repo/template-engine: Email template rendering using MJML@repo/shared: Shared types, utilities, and constants@repo/jest-presets: Jest configurations for testing@repo/config-eslint: ESLint configurations@repo/config-typescript: TypeScript configurations
- User authentication and management via Clerk
- AI-powered newsletter content generation
- Customizable newsletter topics and scheduling
- Email template rendering and delivery
- Job queue for reliable processing
- Dashboard with analytics and history
- Frontend: Next.js, React, Tailwind CSS, Radix UI
- Backend: Express.js, Node.js
- Database: PostgreSQL with Prisma ORM
- Queue: Redis with BullMQ
- AI: LangChain with OpenAI/Groq integration
- Email: Nodemailer, MJML
- Authentication: Clerk
- Deployment: Docker, Vercel
- Clone the repository
- Install dependencies with
pnpm install - Set up environment variables (see
.env.examplefiles) - Start the development server with
pnpm dev
This project uses Turborepo to manage the build system. Common commands:
# Install dependencies
pnpm install
# Start development servers
pnpm dev
# Build all packages and apps
pnpm build
# Run linting
pnpm lint
# Type checking
pnpm check-types
# Run tests
pnpm testEach app and some packages require environment variables. Check the .env files in each directory for required variables.
The project uses PostgreSQL with Prisma ORM. To set up the database:
# Generate Prisma client
pnpm -F @repo/db db:generate
# Push schema changes to database
pnpm -F @repo/db db:migrate-dev
# Seed the database
pnpm -F @repo/db db:seedThe project can be deployed using Docker with the included docker-compose.yml file or through platform-specific deployments (Vercel, etc.).