An open-source email automation platform built with Next.js. Create multi-step email campaigns, manage leads, view all replies in a unified inbox, and leverage AI-powered auto-responses. Think instantly.ai .. but free with an AI-powered auto-responder that matches your brand's voice.
- π§ Email Campaigns - Multi-step email sequences with Spintax support for personalization
- π A/B Testing - Test multiple email variants with configurable weights per step
- π‘ Sender - One-time bulk email campaigns without follow-up sequences
- π₯ Lead Management - Import leads, track status (pending, contacted, replied, bounced)
- π¬ Unibox - Unified inbox showing all replies across campaigns
- π€ Reply Guy - AI-powered auto-responses using Anthropic Claude
- π Analytics Dashboard - Track open rates, reply rates, and campaign performance
- π¨ Email Accounts - Connect multiple SMTP/IMAP accounts with Google OAuth support
- π Rich Text Editor - Full WYSIWYG editor with HTML source toggle for all email composition
- π« Blocklist - Manage blocked domains and email addresses
- π Templates - Save and reuse email templates
- β° Scheduling - Set campaign sending windows by day/time
| Technology | Purpose |
|---|---|
| Next.js 16 | React framework with App Router |
| TypeScript | Type safety |
| Prisma | Database ORM |
| PostgreSQL | Primary database |
| BullMQ | Job queue for email scheduling |
| Redis | Queue backend |
| Tailwind CSS | Styling |
| Tiptap | Rich text editor |
| NextAuth.js | Authentication |
| Nodemailer | Email sending |
| Anthropic Claude | AI auto-responses (Reply Guy) |
- Node.js 18+
- PostgreSQL 14+
- Redis 6+
- Google Cloud Console account (for OAuth)
git clone https://github.com/yourusername/darkzBOX.git
cd darkzBOXnpm installcp .env.example .envEdit .env with your credentials (see Environment Variables section).
docker-compose up -dThis starts PostgreSQL and Redis containers.
npx prisma generate
npx prisma db push
npx prisma db seednpm run devOpen http://localhost:3000 in your browser.
| Variable | Description | Example |
|---|---|---|
DATABASE_URL |
PostgreSQL connection string | postgresql://postgres:password@localhost:5433/darkzbox?schema=public |
REDIS_HOST |
Redis host | localhost |
REDIS_PORT |
Redis port | 6379 |
NODE_ENV |
Environment mode | development |
GOOGLE_CLIENT_ID |
Google OAuth Client ID | From Google Cloud Console |
GOOGLE_CLIENT_SECRET |
Google OAuth Client Secret | From Google Cloud Console |
NEXTAUTH_SECRET |
NextAuth encryption key | Run: openssl rand -base64 32 |
NEXTAUTH_URL |
Application URL | http://localhost:3000 |
To enable email sending via Gmail OAuth:
- Go to Google Cloud Console
- Create a new project or select an existing one
- Enable the Gmail API in APIs & Services > Library
- Go to APIs & Services > OAuth consent screen
- Choose "External" user type
- Fill in the app information:
- App name:
darkzBOX - User support email: Your email
- Developer contact: Your email
- App name:
- Add scopes:
https://mail.google.com/https://www.googleapis.com/auth/gmail.send
- Add test users if in testing mode
- Go to APIs & Services > Credentials
- Click Create Credentials > OAuth client ID
- Choose Web application
- Add authorized redirect URIs:
http://localhost:3000/api/auth/callback/google
- Copy the Client ID and Client Secret to your
.env
darkzBOX/
βββ prisma/
β βββ schema.prisma # Database schema
β βββ seed.ts # Seed data
βββ src/
β βββ actions/ # Server actions (modular)
β β βββ blocklist.ts # Blocklist actions
β β βββ leads.ts # Lead management actions
β β βββ sender.ts # Sender actions
β βββ actions.ts # Main server actions
β βββ app/ # Next.js App Router pages
β β βββ analytics/ # Analytics dashboard
β β βββ api/ # API routes
β β βββ blocklist/ # Blocklist management
β β βββ campaigns/ # Campaign management
β β βββ leads/ # Lead management
β β βββ reply-guy/ # AI auto-response config
β β βββ sender/ # One-time email sender
β β βββ settings/ # Settings pages
β β βββ unibox/ # Unified inbox
β βββ components/ # React components
β β βββ RichTextEditor.tsx # WYSIWYG editor with HTML toggle
β β βββ Sidebar.tsx # Navigation sidebar
β β βββ ...
β βββ lib/ # Utilities
β β βββ auth.ts # NextAuth config
β β βββ email-engine.ts # Email sending
β β βββ prisma.ts # Database client
β β βββ spintax.ts # Spintax parser
β βββ worker/ # Background jobs
β βββ campaign-queue.ts
β βββ imap-listener.ts
β βββ reply-guy-queue.ts
βββ docker-compose.yml # Docker services
βββ package.json
- Navigate to Campaigns > New Campaign
- Set campaign name and schedule
- Add leads (email, first name, last name, company)
- Create email steps with Spintax support:
Hi {{firstName}}, {I noticed|I saw|I found} your company {{companyName}}... - Launch the campaign
Test different email variations to optimize your campaigns:
- When creating or editing a campaign step, toggle Enable A/B Test
- Add multiple variants (A, B, C, etc.) with different subject lines and body content
- Set weight percentages for each variant (must total 100%)
- The system randomly selects a variant for each lead based on the weights
- Track performance of each variant in the campaign analytics
- View all leads in the Leads section
- Filter by status: Pending, Contacted, Replied, Bounced
- Add individual leads or import in bulk
- Go to Reply Guy settings
- Add your Anthropic API key
- Configure business context and custom prompts
- Enable auto-responses for incoming emails
The Sender feature is for sending immediate, one-time email campaigns without follow-up sequences:
- Navigate to Sender in the sidebar
- Create email templates with personalization variables (
{{firstName}},{{lastName}},{{company}}) - Create lead groups and upload CSV files with your contacts
- Create a campaign by selecting a template and lead group
- Start the campaign to send emails immediately
Note: For multi-step email sequences with automated follow-ups, use the Campaigns feature instead.
Block unwanted domains or email addresses from receiving your campaigns:
- Go to Blocklist in the sidebar
- Add domains (e.g.,
competitor.com) or specific emails - Blocked addresses are automatically excluded from all campaigns
All email composition areas include a full-featured rich text editor:
- Formatting: Bold, italic, underline, strikethrough
- Lists: Bullet and numbered lists with indentation
- Alignment: Left, center, right text alignment
- Links: Insert and edit hyperlinks
- Variables: Quick-insert personalization variables
- HTML Mode: Toggle to view/edit raw HTML source (click the
</>icon)
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
MIT License - see LICENSE for details.