Skip to content

SDOS-2025/SmartReach-AI

Repository files navigation

SmartReach-AI

SmartReach AI is an AI-powered email marketing platform that helps businesses create and manage personalized campaigns while ensuring compliance with the Digital Personal Data Protection (DPDP) Act. It automates content generation, send time optimization, and campaign analytics, enabling businesses to improve engagement while handling customer data responsibly.

Features

  • AI-Powered Email Generation - LLM-generated production-ready HTML email templates using Google Gemini, Groq, and OpenRouter with tone-specific color palettes and modern designs
  • Send Time Optimization - ML-based optimal send time prediction for maximum engagement based on historical click/open data
  • Campaign Analytics - Interactive dashboards with click rates, open rates, and engagement delay metrics via Recharts
  • Multi-User Support - User-scoped cache keys ensure data isolation between concurrent users
  • Google OAuth Integration - Secure authentication via Google accounts
  • Forgot Password Flow - OTP-based password reset via email
  • DPDP Compliance - Built-in compliance with India's Digital Personal Data Protection Act
  • Spam Detection - Automated spam score checking via Postmark API before sending
  • Real-time Processing - Celery-based async email scheduling with per-user optimal timing

Tech Stack

Frontend

  • Next.js 15.2.5 with TypeScript
  • React 19
  • Tailwind CSS
  • Radix UI components
  • Recharts for analytics
  • Sonner for toast notifications

Backend

  • Django 5.1.6 with Django REST Framework
  • PostgreSQL database
  • Redis for caching (DB 1) and Celery broker (DB 0)
  • Celery for async email scheduling
  • Gunicorn with gthread workers (4 workers x 4 threads)

AI/ML

  • Google Gemini 2.0 Flash (primary LLM)
  • OpenRouter / Gemma 3 27B (fallback)
  • Groq / LLaMA 4 Scout (fallback)
  • Scikit-learn for send time optimization
  • Pandas for engagement data analysis

Development Setup

Prerequisites

  • Python 3.10+
  • Node.js 18+
  • PostgreSQL
  • Redis

Backend Setup

# Create virtual environment
python3 -m venv venv
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt

# Configure environment
cd backend
cp .env.example .env
# Edit .env with your credentials

# Set up database
python manage.py migrate

# Create superuser
python manage.py createsuperuser

# Run development server
python manage.py runserver

Frontend Setup

cd frontend
npm install
npm run dev

The frontend will be available at http://localhost:3000 and backend at http://localhost:8000.

Running Celery Worker

cd backend
celery -A backend worker --loglevel=info --concurrency=4

Project Structure

SmartReach-AI/
├── backend/
│   ├── api/
│   │   ├── views.py                 # API endpoints
│   │   ├── models.py                # User, Organization, Campaign models
│   │   ├── tasks.py                 # Celery email tasks
│   │   ├── urls.py                  # URL routing
│   │   ├── LLM_template_generator.py  # Email generation with LLM
│   │   └── sto_model.py            # Send time optimization
│   ├── backend/
│   │   ├── settings.py             # Dev settings
│   │   ├── production_settings.py  # Production settings
│   │   └── celery.py               # Celery config
│   └── gunicorn_config.py          # Gunicorn config (4 gthread workers)
├── frontend/
│   ├── app/
│   │   ├── page.tsx                # Landing page
│   │   ├── login/                  # Login + forgot password
│   │   ├── home/                   # Dashboard
│   │   ├── write-email/            # Company email campaign builder
│   │   ├── write_email/            # Individual email builder
│   │   ├── dashboard/[id]/         # Campaign detail view
│   │   ├── admin/                  # User management
│   │   ├── about/                  # Team page
│   │   └── components/             # Shared UI components
│   └── public/images/              # Team photos, carousel assets
└── requirements.txt

Environment Variables

Backend (backend/.env)

SECRET_KEY=your-secret-key
DEBUG=False
ALLOWED_HOSTS=your-domain.com

DB_NAME=smartreach_db
DB_USER=smartreach_user
DB_PASSWORD=your-db-password
DB_HOST=localhost
DB_PORT=5432

GOOGLE_OAUTH2_CLIENT_ID=your-client-id
GOOGLE_OAUTH2_CLIENT_SECRET=your-client-secret

EMAIL_HOST_USER=your-email@gmail.com
EMAIL_HOST_PASSWORD=your-app-password

CELERY_BROKER_URL=redis://localhost:6380/0
FRONTEND_URL=https://your-domain.com

GROQ_API_KEY=your-groq-key
GOOGLE_API_KEY=your-google-ai-key

See backend/.env.example for the full list.

Team

  • Noel Abraham - Full Stack Developer
  • Rahul Omalur - Backend Engineer
  • Mehul - LLM Engineer
  • Tharun - ML Engineer

License

This project is licensed under the terms specified in the LICENSE file.

About

An intelligent email campaign platform that streamlines marketing workflows through LLM-driven content generation, predictive send-time optimization, and automated audience segmentation.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors