A powerful SaaS platform for scraping and managing business leads with GoHighLevel CRM integration, Resend email capabilities, and Airwallex payment processing.
Production URL: https://leadforge-saas.netlify.app
- Lead Scraping - Generate leads from Google Maps by industry and city
- Lead Management - View, filter, and export all scraped leads
- Multi-city Support - Scrape multiple cities in a single operation
- Industry Categories - Support for 18+ business categories
- GoHighLevel CRM - Sync leads directly to your GHL account
- Resend Email API - Send email campaigns to your leads
- Webhook Support - Real-time notifications when leads are scraped
- n8n Automation - Optional workflow automation via n8n
- User Authentication - Secure JWT-based auth system
- Usage Tracking - Monitor leads used vs. plan limits
- Plan Management - Free, Professional ($97/mo), Enterprise ($297/mo)
- CSV Export - Export all leads to CSV format
- Frontend: Vanilla JavaScript, HTML5, CSS3
- Backend: Netlify Functions (Node.js)
- Database: PostgreSQL (Neon)
- Authentication: JWT
- Payments: Airwallex
- CRM: GoHighLevel API
- Email: Resend API
- Automation: n8n (optional)
- Hosting: Netlify
leadgen-saas/
├── index.html # Main application (SPA)
├── netlify/
│ └── functions/
│ ├── auth-login.js # User login
│ ├── auth-register.js # User registration
│ ├── get-stats.js # Dashboard statistics
│ ├── get-leads.js # Retrieve user leads
│ ├── get-settings.js # Get user settings
│ ├── update-settings.js # Save user settings
│ ├── trigger-scrape.js # Start lead scraping
│ ├── scrape-callback.js # n8n callback endpoint
│ ├── get-scraped-cities.js # Get scraped city history
│ ├── ghl-sync.js # Sync leads to GoHighLevel
│ ├── create-checkout.js # Airwallex payment checkout
│ ├── payment-webhook.js # Payment confirmation webhook
│ └── setup-db.js # Database schema setup
├── netlify.toml # Netlify configuration
├── package.json # Dependencies
└── README.md # This file
lf_users
id- Primary keyemail- User email (unique)password_hash- Bcrypt hashed passwordname- Full namecompany- Company nameplan- Subscription plan (free/professional/enterprise)leads_used- Monthly leads consumedleads_limit- Monthly leads allowedcreated_at,updated_at- Timestamps
lf_user_settings
id- Primary keyuser_id- Foreign key to usersghl_api_key- GoHighLevel API keyghl_location_id- GHL Location IDghl_auto_sync- Auto-sync toggleghl_pipeline_id- Default pipeline for leadsresend_api_key- Resend email API keywebhook_url- Custom webhook URLcreated_at,updated_at- Timestamps
lf_leads
id- Primary keyuser_id- Foreign key to usersbusiness_name- Business namephone,email,address- Contact infocity,state- Locationindustry- Business categorywebsite- Business websiterating,reviews- Google ratingsghl_synced- Sync statusghl_contact_id- GHL contact referencecreated_at- Timestamp
lf_scraped_cities
id- Primary keyuser_id- Foreign key to userscity- City nameindustry- Industry scrapedlead_count- Number of leads foundscraped_at- Timestamp
lf_subscriptions
id- Primary keyuser_id- Foreign key to users (unique)stripe_customer_id- Payment intent IDstripe_subscription_id- Not used (Airwallex)plan- Current planstatus- Subscription statuscurrent_period_end- Period end datecreated_at,updated_at- Timestamps
Required environment variables for Netlify:
# Database
DATABASE_URL=postgresql://user:pass@host/db?sslmode=require
# Authentication
JWT_SECRET=your-secure-jwt-secret
# Airwallex Payments
AIRWALLEX_CLIENT_ID=your-client-id
AIRWALLEX_API_KEY=your-api-key
AIRWALLEX_ENV=demo # or production
# n8n Integration (optional)
N8N_WEBHOOK_URL=https://your-n8n.domain/webhook/leadforge-scrape
# Site URL
URL=https://leadforge-saas.netlify.appPOST /.netlify/functions/auth-register- Create accountPOST /.netlify/functions/auth-login- Login
GET /.netlify/functions/get-stats- Dashboard statisticsGET /.netlify/functions/get-leads- Paginated leads listGET /.netlify/functions/get-scraped-cities- Scrape historyGET /.netlify/functions/get-settings- User settings
POST /.netlify/functions/trigger-scrape- Start scrapingPOST /.netlify/functions/ghl-sync- Sync to GoHighLevelPOST /.netlify/functions/update-settings- Save settingsPOST /.netlify/functions/create-checkout- Payment checkout
POST /.netlify/functions/scrape-callback- n8n resultsPOST /.netlify/functions/payment-webhook- Payment confirmation
| Plan | Price | Leads/Month | Features |
|---|---|---|---|
| Free | $0 | 50 | Basic scraping |
| Professional | $97 | 5,000 | Unlimited cities, GHL integration |
| Enterprise | $297 | Unlimited | API access, white-label exports |
- Go to Settings > GoHighLevel Integration
- Enter your GHL API Key
- Enter your Location ID
- Enable Auto-sync (optional)
- Manual: Click "Sync to GHL" on any lead list
- Automatic: Enable auto-sync in settings
- Bulk: Use "Sync All to GHL" on My Leads page
business_name→firstName,lastName,companyNameemail→emailphone→phoneaddress→address1city,state→city,stateindustry→ Tags
- Go to Settings
- Enter your Resend API Key
- Save
- Email campaigns to scraped leads
- Delivery tracking
- Custom webhook notifications
For real-time Google Maps scraping, you can connect an n8n instance:
- Install n8n on your server
- Create a workflow with HTTP trigger
- Configure Google Maps scraping nodes
- Set callback URL to LeadForge endpoint
- LeadForge sends scrape request to n8n
- n8n scrapes Google Maps
- n8n sends results back via callback
- LeadForge stores leads and updates UI
# Clone repository
git clone https://github.com/bensblueprints/leadgen-saas.git
cd leadgen-saas
# Install dependencies
npm install
# Install Netlify CLI
npm install -g netlify-cli
# Link to Netlify site
netlify link
# Start local dev server
netlify dev# Deploy to production
netlify deploy --prod
# Deploy to preview
netlify deployRun the setup endpoint to create tables:
curl https://leadforge-saas.netlify.app/.netlify/functions/setup-dbFor issues and feature requests:
- Email: Ben@JustFeatured.com
- GitHub Issues: https://github.com/bensblueprints/leadgen-saas/issues
MIT License - See LICENSE file for details.
Built with AI assistance by Claude Code