A comprehensive, modern email marketing platform with AI-powered features for managing email campaigns, contact lists, and email templates. Built with Django REST API backend and Next.js frontend with full dark/light theme support.
- Features
- Tech Stack
- Architecture
- Project Structure
- Quick Start with Docker
- Manual Development Setup
- API Documentation
- License
- Create, edit, and launch email campaigns
- Multi-step campaign wizard with live preview
- Campaign analytics and tracking
- Schedule campaigns for later
- Import contacts from CSV
- Create and manage contact lists
- Contact segmentation
- Unsubscribe management
- Rich text email editor with HTML support
- AI-powered content generation
- Template categories and tags
- Preview before sending
- Voice-enabled AI assistant
- Natural language contact management
- Smart suggestions and automation
- Responsive design for all devices
- Dark/Light theme with system preference detection
- Smooth animations and transitions
- Custom styled dialogs and notifications
- JWT-based authentication
- Email verification
- Secure password reset
- Role-based permissions
| Technology | Purpose |
|---|---|
| Python 3.11+ | Core programming language |
| Django 5.2 | Web framework |
| Django REST Framework 3.15 | REST API development |
| PostgreSQL | Primary database |
| Redis | Caching & Celery broker |
| Celery 5.3 | Async task queue (email sending) |
| Celery Beat | Scheduled tasks |
| SimpleJWT | JWT authentication |
| drf-spectacular | OpenAPI documentation |
| Gunicorn/Daphne | Production WSGI/ASGI servers |
| Sentry | Error tracking |
| Technology | Purpose |
|---|---|
| Next.js 16 | React framework with App Router |
| React 19 | UI library |
| TypeScript 5 | Type-safe JavaScript |
| Tailwind CSS 4 | Utility-first CSS framework |
| Radix UI | Accessible UI primitives |
| React Hook Form + Zod | Form handling & validation |
| next-themes | Dark/Light theme management |
| Lucide React | Icon library |
| Sonner | Toast notifications |
| Axios | HTTP client |
| React Quill | Rich text editor |
| Technology | Purpose |
|---|---|
| Docker & Docker Compose | Containerization |
| Nginx | Reverse proxy (production) |
| GitHub Actions | CI/CD pipelines |
| ESLint | JavaScript/TypeScript linting |
| Black & isort | Python code formatting |
| Pytest | Python testing |
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β CLIENT LAYER β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Next.js 16 (React 19 + TypeScript) β
β βββ App Router (Server & Client Components) β
β βββ Tailwind CSS + Radix UI β
β βββ Theme Provider (Dark/Light) β
β βββ Axios HTTP Client β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ REST API (JSON)
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β API LAYER β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Django REST Framework β
β βββ JWT Authentication (SimpleJWT) β
β βββ ViewSets & Serializers β
β βββ Permission Classes β
β βββ API Versioning β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β APPLICATION LAYER β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Django 5.2 β
β βββ Authentication App (Users, JWT, Email Verification) β
β βββ Campaigns App (Campaigns, Templates, Contacts, Providers) β
β βββ Utils App (Common utilities, Base models) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββΌββββββββββββββββ
βΌ βΌ βΌ
ββββββββββββββββββββ ββββββββββββββββ ββββββββββββββββββββ
β PostgreSQL β β Redis β β Celery β
β (Database) β β (Cache) β β (Task Queue) β
ββββββββββββββββββββ ββββββββββββββββ ββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββ
β Email Services β
β (SMTP/SES/etc) β
ββββββββββββββββββββ
Email-Campaign-Management-Platform/
βββ π README.md # This documentation
βββ π LICENSE # MIT License
βββ π .gitignore # Git ignore rules
βββ π backend/ # Django REST API
βββ π frontend/ # Next.js Application
βββ π frontend-newsletter/ # Static newsletter widget
backend/
βββ π manage.py # Django management script
βββ π requirements.txt # Python dependencies
βββ π Dockerfile # Backend Docker image
βββ π docker-compose.yml # Backend services composition
βββ π docker_entrypoint.sh # Container startup script
βββ π core.py # Core utilities
β
βββ π config/ # Django Project Configuration
β βββ __init__.py
β βββ settings.py # Django settings
β βββ urls.py # Root URL configuration
β βββ wsgi.py # WSGI application
β βββ asgi.py # ASGI application
β βββ celery.py # Celery configuration
β
βββ π apps/ # Django Applications
β β
β βββ π authentication/ # User Authentication
β β βββ models.py # User, Organization models
β β βββ views.py # Auth API views
β β βββ serializers.py # DRF serializers
β β βββ urls.py # Auth endpoints
β β βββ permissions.py # Custom permissions
β β βββ signals.py # Django signals
β β βββ services/ # Business logic services
β β βββ migrations/ # Database migrations
β β
β βββ π campaigns/ # Campaign Management
β β βββ models/ # Campaign, Template, Contact models
β β βββ views/ # Campaign API views
β β βββ serializers/ # DRF serializers
β β βββ urls.py # Campaign endpoints
β β βββ tasks.py # Celery tasks
β β βββ signals.py # Django signals
β β βββ constants.py # App constants
β β βββ exceptions.py # Custom exceptions
β β βββ backends.py # Email backends
β β βββ utils/ # Helper utilities
β β βββ migrations/ # Database migrations
β β
β βββ π utils/ # Shared Utilities
β βββ base_models.py # Abstract base models
β βββ pagination.py # Custom pagination
β βββ filters.py # Query filters
β βββ responses.py # Response helpers
β βββ throttles.py # Rate limiting
β βββ mixins.py # View mixins
β βββ exceptions.py # Base exceptions
β
βββ π core/ # Core Module
β βββ utils.py # Utility functions
β βββ mixins.py # Model mixins
β βββ exceptions.py # Core exceptions
β
βββ π static/ # Static files
βββ π media/ # User uploads
βββ π media_files/ # Media storage
βββ logos/ # Organization logos
βββ profiles/ # Profile images
frontend/
βββ π package.json # Node.js dependencies
βββ π tsconfig.json # TypeScript configuration
βββ π next.config.ts # Next.js configuration
βββ π postcss.config.mjs # PostCSS configuration
βββ π eslint.config.mjs # ESLint configuration
βββ π Dockerfile # Frontend Docker image
βββ π docker-compose.yml # Frontend services composition
β
βββ π app/ # Next.js App Router
β βββ π layout.tsx # Root layout
β βββ π page.tsx # Landing page
β βββ π globals.css # Global styles & theme
β β
β βββ π login/ # Login page
β β βββ page.tsx
β βββ π signup/ # Signup page
β β βββ page.tsx
β βββ π verify-email/ # Email verification
β β βββ page.tsx
β β
β βββ π dashboard/ # Protected Dashboard
β βββ layout.tsx # Dashboard layout
β βββ page.tsx # Dashboard home
β β
β βββ π campaigns/ # Campaign Management
β β βββ page.tsx # Campaign list
β β βββ π new/ # Create campaign
β β βββ π [id]/ # Campaign details
β β
β βββ π contacts/ # Contact Management
β β βββ page.tsx # Contact list
β β βββ π new/ # Add contact
β β βββ π import/ # Import contacts
β β βββ π [id]/ # Contact details
β β
β βββ π templates/ # Template Management
β β βββ page.tsx # Template list
β β βββ π new/ # Create template
β β
β βββ π settings/ # Settings
β β βββ π providers/ # Email provider config
β β βββ page.tsx
β β βββ π new/
β β
β βββ π profile/ # User profile
β βββ page.tsx
β
βββ π components/ # React Components
β βββ π editor.tsx # Rich text editor
β βββ π providers.tsx # App providers
β β
β βββ π dashboard/ # Dashboard Components
β β βββ sidebar.tsx # Navigation sidebar
β β βββ header.tsx # Top header bar
β β βββ FloatingAgentInput.tsx # AI agent input
β β
β βββ π ui/ # UI Components (Radix-based)
β βββ alert-dialog.tsx # Alert dialogs
β βββ alert.tsx # Alert messages
β βββ avatar.tsx # User avatars
β βββ badge.tsx # Status badges
β βββ button.tsx # Buttons
β βββ card.tsx # Card containers
β βββ checkbox.tsx # Checkboxes
β βββ dialog.tsx # Modal dialogs
β βββ dropdown-menu.tsx # Dropdown menus
β βββ form.tsx # Form components
β βββ input.tsx # Text inputs
β βββ label.tsx # Form labels
β βββ select.tsx # Select dropdowns
β βββ table.tsx # Data tables
β βββ tabs.tsx # Tab navigation
β βββ textarea.tsx # Text areas
β βββ theme-toggle.tsx # Theme switcher
β βββ toast.tsx # Toast notifications
β βββ toaster.tsx # Toast container
β
βββ π contexts/ # React Contexts
β βββ AuthContext.tsx # Authentication context
β
βββ π lib/ # Utility Libraries
β βββ axios.ts # Axios HTTP client
β βββ utils.ts # Helper functions
β
βββ π public/ # Static Assets
- Docker Engine 20.10+
- Docker Compose 2.0+
# Clone the repository
git clone https://github.com/MusfiqDehan/Agentic-Email-Campaign-Management-Platform.git
cd Agentic-Email-Campaign-Management-Platform
# Create environment files
cp backend/.env.example backend/.env.local
# Start all services from root
docker-compose -f backend/docker-compose.yml up -d
docker-compose -f frontend/docker-compose.yml up -d
# Access applications
# Backend API: http://localhost:8001
# Frontend: http://localhost:3001cd backend
# Create environment file
cp .env.example .env.local
# Start backend services (Django, PostgreSQL, Redis, Celery)
docker-compose up -d
# View logs
docker-compose logs -f web
# Run migrations
docker-compose exec web python manage.py migrate
# Create superuser
docker-compose exec web python manage.py createsuperuser
# Stop services
docker-compose downcd frontend
# Start frontend service
docker-compose up -d
# View logs
docker-compose logs -f frontend
# Stop service
docker-compose down# Backend commands
docker-compose -f backend/docker-compose.yml exec web python manage.py migrate
docker-compose -f backend/docker-compose.yml exec web python manage.py createsuperuser
docker-compose -f backend/docker-compose.yml exec web python manage.py shell
# View logs
docker-compose -f backend/docker-compose.yml logs -f web
docker-compose -f frontend/docker-compose.yml logs -f frontend
# Rebuild images
docker-compose -f backend/docker-compose.yml build --no-cache
docker-compose -f frontend/docker-compose.yml build --no-cache
# Stop all
docker-compose -f backend/docker-compose.yml down
docker-compose -f frontend/docker-compose.yml downcd backend
# Create virtual environment
python -m venv .venv
source .venv/bin/activate # Linux/Mac
# .venv\Scripts\activate # Windows
# Install dependencies
pip install -r requirements.txt
# Setup environment
cp .env.example .env.local
# Edit .env.local with your settings
# Run migrations
python manage.py migrate
# Create superuser
python manage.py createsuperuser
# Start development server
python manage.py runserver
# Start Celery worker (in another terminal)
celery -A config worker -l info
# Start Celery beat (in another terminal)
celery -A config beat -l infocd frontend
# Install dependencies
npm install
# Start development server
npm run dev
# Build for production
npm run build
# Start production server
npm startOnce the backend is running, access the API documentation at:
- Swagger UI: http://localhost:8001/api/docs/
- ReDoc: http://localhost:8001/api/redoc/
- OpenAPI Schema: http://localhost:8001/api/schema/
| Endpoint | Method | Description |
|---|---|---|
/api/auth/register/ |
POST | User registration |
/api/auth/login/ |
POST | User login (JWT) |
/api/auth/token/refresh/ |
POST | Refresh JWT token |
/campaigns/ |
GET, POST | List/Create campaigns |
/campaigns/{id}/ |
GET, PUT, DELETE | Campaign CRUD |
/campaigns/{id}/launch/ |
POST | Launch campaign |
/campaigns/templates/ |
GET, POST | Email templates |
/campaigns/contact-lists/ |
GET, POST | Contact lists |
/campaigns/contacts/ |
GET, POST | Contacts |
/campaigns/org/providers/ |
GET, POST | Email providers |
The application supports both dark and light themes with:
- System preference detection
- Manual toggle switch
- Persistent preference storage
- Smooth transitions
Toggle the theme using the sun/moon icon in the header.
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature-name - Make your changes
- Run tests and linting
- Commit your changes:
git commit -m 'Add some feature' - Push to the branch:
git push origin feature/your-feature-name - Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
Musfiq Dehan
- GitHub: @MusfiqDehan
Made with β€οΈ for email marketers everywhere
