A multi-tenant lead generation platform for finding high-value, in-need clients in the US, UK, UAE, Australia, Netherlands, Ireland (and 10 more tier-2 markets) — built to be used by your agency and resold as a white-label template to other businesses (real estate, consulting, recruiting…).
| Layer | What it does |
|---|---|
| Lead engine | Searches Apollo.io's 270M+ verified B2B database by country, title, industry, company size, keywords. No fragile scrapers — real API, verified emails. |
| Scoring engine | Every lead scored 0–100 across 6 dimensions: geography tier, decision-making power, company-size sweet spot, industry fit, buying signals (hiring, funding, company age), reachability. Graded A–D, hot/warm/cold. |
| Pipeline | Leads stored forever in Postgres (Supabase), searchable, filterable, status tracking (new → contacted → replied → qualified → won), activity log, one-click enrichment (verified email + phone), CSV export. |
| Multi-tenant SaaS | Every signup gets an isolated organization (Postgres Row-Level Security — tenants can never see each other's data), a 14-day trial, and white-label branding (product name + accent color) plus an industry preset that re-targets the whole app. |
| Admin dashboard | Platform-owner-only view: MRR, annual run-rate, customer list, plan breakdown, churn (30d), per-tenant usage. Auto-synced from Stripe via webhook. |
| Feature | How it works |
|---|---|
| AI-personalized sequences | Click "Draft AI sequence" on any lead → OpenAI (gpt-4o-mini) writes a 3-email cold sequence referencing that lead's actual buying signals (hiring, funding, industry). You review/edit every word before anything sends. |
| Automatic follow-ups | Email 1 sends instantly; follow-ups go out on day 3 and day 7 — handled by a scheduled function every 15 min. No reply needed from you. |
| Reply detection + AI classification | A second scheduled job reads your Gmail inbox, matches replies to leads, and classifies them: interested / not now / wrong person / unsubscribe / out of office. Any reply stops the sequence instantly. Unsubscribes are never emailed again. |
| Deliverability protection | Per-account daily send limit (default 30/day — raise it slowly as your domain warms up), sequences pause automatically at the cap. |
- Run
supabase/migrations/002_outreach.sqlin the Supabase SQL Editor (after 001). - Get an OpenAI API key (platform.openai.com → API keys) → add
OPENAI_API_KEYto Netlify env vars. - In the app → Outreach tab → connect Gmail with an App Password: Google Account → Security → turn on 2-Step Verification → App passwords → create one for "Mail". (Normal passwords are rejected by Google.)
- Redeploy. The two scheduled functions (sequence-runner, inbox-sync) activate automatically via netlify.toml.
- Every AI draft ends with a built-in opt-out line; the classifier enforces it automatically.
- Keep daily limits low for the first 2–3 weeks on any new Gmail account (deliverability warm-up).
- Use a secondary domain (e.g. tryyouragency.com) for cold email — never your main domain.
- GDPR markets (NL/UK/IE): identify your company in the signature, honor opt-outs instantly (the system does), keep records.
React (Vite) ──> Netlify Functions ──> Apollo.io API (lead search + enrichment)
│ │
│ └──────────> Stripe (billing webhook → revenue dashboard)
└────────────────> Supabase (Postgres + Auth + RLS, multi-tenant)
- Create a project at supabase.com.
- SQL Editor → paste & run
supabase/migrations/001_init.sql. - Authentication → Providers → enable Email. (Optionally disable "Confirm email" while testing.)
- Copy: Project URL,
anonkey,service_rolekey (Settings → API).
- Sign up at apollo.io → Settings → Integrations → API → create key.
- People Search works on free/basic; email reveal (enrichment) needs a paid plan with export credits — Basic ($49/mo) is enough to start.
- Push this folder to a GitHub repo → "Import project" in Netlify.
- Site settings → Environment variables → add everything from
.env.example. - Deploy. The
/api/*redirect routes to the serverless functions automatically.
- Create 3 Products with monthly Prices; set each Price's lookup_key to
starter,growth,scale($49/$149/$399 — already seeded in the DB, change freely). - Developers → Webhooks → endpoint
https://YOURSITE.netlify.app/api/stripe-webhook, events:customer.subscription.*. Copy the signing secret. - When a customer pays, save their Stripe customer ID into
organizations.stripe_customer_id— from then on MRR/churn sync automatically.
Sign up in the app, then run in Supabase SQL Editor:
update profiles set is_super_admin = true where email = '[email protected]';The Admin · Revenue tab appears on next refresh.
- Each customer signs up → isolated tenant with trial, automatically.
- They pick an industry preset in Settings (software agency / real estate / consulting / recruiting) — this swaps default countries, titles, industries and scoring focus. Add more presets in
src/lib/core.jsx(PRESETS) + the scoring map innetlify/functions/apollo-search.mjs. - White-label: they rename the product and recolor it in Settings; you keep the admin view of all of them.
- For "their own Apollo key per tenant", add an
apollo_api_keycolumn onorganizationsand read it in the functions — 10-minute change.
- Netherlands, Ireland and the UK are GDPR/UK-GDPR territory. B2B cold email is generally workable under legitimate interest if you: contact business addresses about relevant services, identify yourself, and honor opt-outs immediately. Keep a suppression list.
- US: CAN-SPAM (real postal address + unsubscribe). Australia/UAE have their own spam laws.
- Apollo data is licensed for this use; that's another reason it beats scraping. This isn't legal advice — have a lawyer sanity-check your outreach flow before scale.
| # | Credential | Where to get it | Where it goes |
|---|---|---|---|
| 1 | VITE_SUPABASE_URL |
Supabase → Settings → API | Netlify env (build) |
| 2 | VITE_SUPABASE_ANON_KEY |
Supabase → Settings → API | Netlify env (build) |
| 3 | SUPABASE_URL |
same as #1 | Netlify env (functions) |
| 4 | SUPABASE_SERVICE_ROLE_KEY |
Supabase → Settings → API (secret — server only) | Netlify env (functions) |
| 5 | APOLLO_API_KEY |
Apollo.io → Settings → API | Netlify env (functions) |
| 6 | STRIPE_SECRET_KEY |
Stripe → Developers → API keys | Netlify env (functions) — only when selling |
| 7 | STRIPE_WEBHOOK_SECRET |
Stripe → Webhooks → your endpoint | Netlify env (functions) — only when selling |
| 8 | OPENAI_API_KEY |
platform.openai.com → API keys | Netlify env (functions) — for AI drafting + reply classification |
| 9 | Gmail App Password | Google Account → Security → App passwords | entered inside the app (Outreach tab), per tenant |
| — | GitHub repo + Netlify account | free | hosting |
Recommended upgrades when revenue starts: a custom domain, a separate email-sending tool (Instantly/Smartlead) fed by the CSV export, and Apollo Professional for more credits.