Skip to content

jeffryhawchab/leadmysaas

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

LeadMySaaS

A Django + React app that automates B2B cold email lead generation. Describe your SaaS and target audience β€” AI generates targeted search queries, finds matching LinkedIn profiles via Google, extracts emails using multi-strategy hunting, and scores each lead for relevance.

Features

  • Create campaigns with your SaaS description and target audience
  • AI generates targeted LinkedIn search queries optimized for email visibility
  • Finds real LinkedIn profiles via Serper.dev (Google search API)
  • Multi-strategy email extraction: Apollo.io β†’ Serper search β†’ LinkedIn page scrape β†’ domain guessing
  • AI batch-scores all leads in one call (0–100) with strict ICP rubric
  • Profiles with visible emails are prioritized and score-boosted
  • Lead status management (New β†’ Contacted β†’ Qualified β†’ Rejected)
  • Export leads to Excel (.xlsx) with one click
  • Modern React + Tailwind dark UI
  • Rate-limited AI calls with OpenRouter free models + Groq fallback

Tech Stack

Backend

  • Django 4.2+
  • Serper.dev (Google Search API β€” 2500 free queries)
  • OpenRouter free models (Llama 3.3 70B, Gemma, etc.)
  • Groq API fallback (Llama 3.3 70B β€” 14,400 free req/day)
  • openpyxl for Excel export
  • SQLite (default, swap for Postgres in production)

Frontend

  • React 18 + Vite
  • Tailwind CSS v4
  • Lucide icons

Setup

1. Clone the repo

git clone https://github.com/your-username/leadmysaas.git
cd leadmysaas

2. Create and activate a virtual environment

python -m venv env
# Windows
env\Scripts\activate
# macOS/Linux
source env/bin/activate

3. Install Python dependencies

pip install -r requirements.txt

4. Install frontend dependencies

cd frontend
npm install
cd ..

5. Configure environment variables

Copy .env.example to .env and fill in your keys:

OPENROUTER_API_KEY=your_openrouter_api_key_here
GROQ_API_KEY=your_groq_api_key_here
SERPER_API_KEY=your_serper_api_key_here
APOLLO_API_KEY=your_apollo_api_key_here
Key Where to get it Free tier
OPENROUTER_API_KEY openrouter.ai/keys Free models available
GROQ_API_KEY console.groq.com/keys 14,400 req/day
SERPER_API_KEY serper.dev 2,500 free searches
APOLLO_API_KEY app.apollo.io β†’ Settings β†’ API 50 free exports/month

6. Run migrations

python manage.py migrate

7. Build the frontend

cd frontend
npm run build
cd ..

8. Start the server

python manage.py runserver

Visit http://127.0.0.1:8000

Development (hot reload)

Run both servers simultaneously:

# Terminal 1 β€” Django API
python manage.py runserver

# Terminal 2 β€” React dev server (proxies /api to Django)
cd frontend
npm run dev

Then open http://localhost:5173

Usage

  1. Click + New Campaign
  2. Fill in your SaaS description and target audience (be specific β€” e.g. "CTOs at B2B SaaS startups with 10–100 employees")
  3. Click Run AI Scrape β€” the pipeline will:
    • Generate 5 targeted search queries optimized for email-visible profiles
    • Find up to 50 real LinkedIn profiles via Serper
    • Batch-score all profiles in one AI call
    • Hunt emails for all good fits (score β‰₯ 60)
  4. Leads appear ranked by AI score β€” email-visible profiles float to the top
  5. Click Export Excel to download the full lead list as .xlsx
  6. Update lead status as you work through outreach

How Email Hunting Works

For each good-fit profile (score β‰₯ 60) the scraper tries 4 strategies in order:

  1. Apollo.io β€” matches name + company + LinkedIn URL against 275M+ contact database (50 free exports/month)
  2. Serper search β€” searches "Name" "Company" email and "Name" "Company" contact "@" to find publicly indexed emails
  3. LinkedIn page scrape β€” fetches the public profile page and extracts any visible email
  4. Domain guessing β€” finds the company domain via Serper, then tries common formats: [email protected], [email protected], [email protected]

Project Structure

leadmysaas/
β”œβ”€β”€ leads/
β”‚   β”œβ”€β”€ models.py           # Campaign + Lead models
β”‚   β”œβ”€β”€ scraper.py          # AI + Serper search + email hunting pipeline
β”‚   β”œβ”€β”€ views.py            # REST API views + Excel export
β”‚   β”œβ”€β”€ urls.py             # URL routes
β”‚   └── templates/leads/    # SPA shell template
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ App.jsx
β”‚   β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”‚   β”œβ”€β”€ Dashboard.jsx
β”‚   β”‚   β”‚   └── CampaignDetail.jsx
β”‚   β”‚   └── components/
β”‚   β”‚       └── NewCampaignModal.jsx
β”‚   └── vite.config.js
β”œβ”€β”€ leadmysaas/
β”‚   β”œβ”€β”€ settings.py
β”‚   └── urls.py
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ .env.example
└── manage.py

Notes

  • LinkedIn blocks direct scraping β€” this app uses Google search (site:linkedin.com/in/) via Serper as a proxy
  • Email discovery rate depends on how publicly visible the person's email is β€” typically 20–40% of leads will have a confirmed email
  • AI rate limiting is built in (8 calls/min max) with automatic fallback across providers
  • Re-running a scrape on an existing campaign updates emails and scores on existing leads rather than creating duplicates

License

MIT

About

πŸš€ AI-powered B2B lead gen β€” describe your SaaS, get scored LinkedIn profiles + emails. Serper + OpenRouter/Groq free tier. React + Django.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors