A modern lead management and automation testing dashboard built with React and Node.js.
POST https://leadgenwebhook-production.up.railway.app/api/webhooks/meta
POST https://leadgenwebhook-production.up.railway.app/api/webhooks/calcom
POST https://leadgenwebhook-production.up.railway.app/api/webhooks/test
- Real-time statistics and metrics
- Recent leads overview
- Webhook activity monitoring
- Lead source distribution
- Full CRUD operations for leads
- Advanced filtering (status, source, priority, date range)
- Search across name, email, phone, company
- Sorting by any column
- Bulk actions (update, delete)
- Export to CSV
- Meta Instant Forms - Receive leads from Facebook/Instagram Lead Ads
- Cal.com - Capture booking notifications
- Custom/Test - Accept any JSON payload
- Automatic signature validation
- Comprehensive logging
- Send test webhooks
- Simulate Meta and Cal.com events
- Real-time response display
- Test history tracking
- Email campaigns table
- WhatsApp messages table
- Automation workflows table
- Activity logging
- React 18 with Vite
- TailwindCSS for styling
- React Query for data fetching
- Zustand for state management
- Framer Motion for animations
- React Router for navigation
- Express.js server
- SQLite database (easily portable to PostgreSQL)
- Zod for validation
- Helmet for security
- Rate limiting protection
- Node.js 18+
- npm or yarn
- Clone the repository:
git clone <repository-url>
cd emailpipelinesoftware- Install all dependencies:
npm run install:all- Set up environment variables:
cp env.example .env- Start development servers:
npm run devThis will start:
- Backend API at http://localhost:3001
- Frontend at http://localhost:5173
Create a .env file in the root directory:
# Server
PORT=3001
NODE_ENV=development
# Security
WEBHOOK_SECRET=your-webhook-secret
# External Services
META_APP_SECRET=your-meta-app-secret
META_VERIFY_TOKEN=lead_pipeline_verify
CALCOM_WEBHOOK_SECRET=your-calcom-secret
# Frontend URL (for CORS)
FRONTEND_URL=http://localhost:5173GET /api/health
GET /api/leads # List leads (with filtering/pagination)
GET /api/leads/stats # Get lead statistics
GET /api/leads/:id # Get single lead
GET /api/leads/:id/activities # Get lead activities
POST /api/leads # Create lead
PUT /api/leads/:id # Update lead
DELETE /api/leads/:id # Delete lead
POST /api/leads/bulk/update # Bulk update
POST /api/leads/bulk/delete # Bulk delete
GET /api/webhooks/logs # List webhook logs
GET /api/webhooks/logs/recent # Recent logs
GET /api/webhooks/stats # Webhook statistics
GET /api/webhooks/logs/:id # Single log detail
# Webhook Receivers
GET /api/webhooks/meta # Meta verification
POST /api/webhooks/meta # Meta lead webhook
POST /api/webhooks/calcom # Cal.com booking webhook
POST /api/webhooks/test # Test webhook endpoint
# Simulation
POST /api/webhooks/simulate/meta # Simulate Meta webhook
POST /api/webhooks/simulate/calcom # Simulate Cal.com webhook
- Go to Facebook Business Suite > Events Manager
- Create a new webhook subscription
- Set the callback URL to:
https://your-domain.com/api/webhooks/meta - Set the verify token to match
META_VERIFY_TOKENin your environment - Subscribe to
leadgenevents
- Go to Cal.com Settings > Webhooks
- Add a new webhook with URL:
https://your-domain.com/api/webhooks/calcom - Select events:
BOOKING_CREATED,BOOKING_RESCHEDULED - Copy the signing secret to
CALCOM_WEBHOOK_SECRET
This project is configured for one-click deployment on Railway.
- Go to railway.app
- Click New Project β Deploy from GitHub repo
- Select
thecafetron-ctrl/leadgenwebhook - Railway auto-detects the configuration from
railway.json - Set environment variables:
NODE_ENV=production - Deploy! π
Once deployed, your app will be available at:
Dashboard: https://leadgenwebhook-production.up.railway.app
Meta Instant Forms:
POST https://leadgenwebhook-production.up.railway.app/api/webhooks/meta
GET https://leadgenwebhook-production.up.railway.app/api/webhooks/meta (verification)
Verify Token: lead_pipeline_verify
Cal.com:
POST https://leadgenwebhook-production.up.railway.app/api/webhooks/calcom
Custom/Test:
POST https://leadgenwebhook-production.up.railway.app/api/webhooks/test
If you prefer Netlify for frontend:
- Deploy frontend to Netlify (it will use
netlify.toml) - Deploy backend to Railway
- Update Netlify env:
VITE_API_URL=https://your-railway-backend.up.railway.app/api
For production with high traffic, migrate from SQLite to PostgreSQL:
- Install
pgpackage - Update
DATABASE_URLenvironment variable - Modify
backend/src/database/connection.jsto usepg - Update SQL syntax in
schema.js(mainly datetime functions)
The database schema is prepared for:
// Tables: email_campaigns, email_sends
// Add email service integration (SendGrid, etc.)
// Create campaign management UI
// Implement email sending service// Table: whatsapp_messages
// Add WhatsApp Business API integration
// Create message templates
// Implement message sending service// Tables: automation_workflows, workflow_executions
// Create workflow builder UI
// Implement workflow engine
// Add trigger handlersβββ backend/
β βββ src/
β β βββ database/
β β β βββ connection.js # Database connection
β β β βββ schema.js # Table definitions
β β β βββ migrate.js # Migration script
β β βββ middleware/
β β β βββ validation.js # Request validation
β β βββ models/
β β β βββ Lead.js # Lead model
β β β βββ WebhookLog.js # Webhook log model
β β βββ routes/
β β β βββ leads.js # Lead routes
β β β βββ webhooks.js # Webhook routes
β β βββ index.js # Server entry point
β βββ package.json
β
βββ frontend/
β βββ src/
β β βββ components/
β β β βββ Layout.jsx # Main layout
β β β βββ Sidebar.jsx # Navigation
β β β βββ Header.jsx # Top bar
β β β βββ LeadModal.jsx # Create/Edit modal
β β β βββ LeadDetailModal.jsx
β β βββ pages/
β β β βββ Dashboard.jsx # Main dashboard
β β β βββ Leads.jsx # Lead management
β β β βββ WebhookLogs.jsx # Webhook viewer
β β β βββ Playground.jsx # Testing interface
β β βββ lib/
β β β βββ api.js # API client
β β β βββ store.js # State management
β β β βββ utils.js # Utility functions
β β βββ App.jsx # App component
β β βββ main.jsx # Entry point
β β βββ index.css # Global styles
β βββ index.html
β βββ tailwind.config.js
β βββ vite.config.js
β βββ package.json
β
βββ netlify.toml # Netlify config
βββ env.example # Environment template
βββ package.json # Root package
βββ README.md
MIT License - Feel free to use this for your own projects!
For questions or issues, please open a GitHub issue.