Lead Management CRM
Full-featured CRM for service contractors with Twilio integration, lead distribution, and call tracking. Built with React, Node.js, PostgreSQL, and Twilio API.
The Problem
Marketing company was running Google Ads for service contractors (plumbers, electricians, HVAC). They needed to:
- Track which ads generated calls
- Automatically log every incoming call
- Distribute leads to multiple contractors
- Prove ROI to clients
- Give contractors a simple dashboard to view their leads
They were using spreadsheets and manual call logging. Contractors complained about missed leads. The agency couldn't prove which ads worked. Everyone was frustrated.
Previous attempts at solving this failed because:
- Off-the-shelf CRMs like Salesforce were too expensive and complex
- Simple lead capture forms didn't include call tracking
- No system integrated with their existing Twilio phone numbers
The Solution
Built a custom CRM from scratch with Twilio webhook integration. Every incoming call automatically creates a lead record with caller ID, timestamp, duration, and which ad campaign generated it.
Architecture
Three main components:
- Twilio Integration: Webhooks capture every call, log details to database
- Lead Distribution Engine: Routes leads to contractors based on service type, location, and availability
- Contractor Dashboard: Simple interface where contractors view leads, mark them as contacted, and track conversion
React frontend for the dashboard. Node.js/Express backend handling webhooks and API requests. PostgreSQL for data storage. Everything hosted on AWS EC2.
Call Tracking Flow
When a customer calls:
- Twilio webhook hits our endpoint with call details
- System logs call to database (caller ID, time, source campaign)
- Routes call to appropriate contractor
- Sends SMS to contractor with caller info
- Updates dashboard in real-time
Contractors see leads instantly. Marketing agency can track ROI by campaign. Everyone has the data they need.
The ROI Tracking Problem
Google Ads shows impressions and clicks. But contractors care about calls and conversions. This system bridges that gap.
Marketing agency can now show: "Your $2,000 ad spend generated 47 calls, 23 jobs, $18,000 revenue." That's a compelling case for continued service.
Results
Features Built
For Marketing Agency
- Campaign tracking and ROI reporting
- Contractor management (add, edit, assign campaigns)
- Call logs with recordings (stored in Twilio)
- Lead distribution rules
- Client billing reports
For Contractors
- Real-time lead notifications (SMS + dashboard)
- Lead history and status tracking
- Conversion tracking (which leads became jobs)
- Monthly reports (leads received, conversion rate)
- Simple mobile-friendly interface
Automated Features
- Automatic call logging (no manual entry)
- SMS notifications on new leads
- Daily summary emails
- Reminder notifications for uncontacted leads
- Monthly invoice generation
Technical Challenges
Real-Time Updates
Contractors needed to see new leads instantly. Implemented WebSocket connection for real-time dashboard updates. When Twilio webhook fires, everyone watching gets the update immediately.
Call Recording Storage
Initially planned to store recordings on our server. Then realized Twilio already stores them for 30 days. Just link to Twilio's hosted recording. Saved storage costs and development time.
Lead Distribution Logic
Complex business rules: "Route plumbing calls to contractor A during business hours, contractor B after hours. If both unavailable, send to overflow list."
Built flexible rule engine that marketing agency can configure without code changes. Rules stored in database, evaluated on each incoming call.
"We went from manually logging calls in spreadsheets to having everything automated. Our contractors are happier because they don't miss leads, and we can finally prove ROI to our clients. This system paid for itself in the first month."
Ongoing Maintenance
Client is on a monthly retainer ($1,200/month) for hosting, monitoring, and updates. Includes:
- Server monitoring and maintenance
- Adding new contractors as needed
- Tweaking lead distribution rules
- Monthly feature additions based on feedback
- Priority support (usually respond within 2 hours)
Recent improvements:
- Added bulk SMS capability for announcements
- Built contractor performance dashboard
- Implemented automatic billing for missed call fees
- Added integration with their accounting software
What I Learned
Build for the problem, not the ideal solution. Initially planned elaborate features like ML-based lead scoring and predictive analytics. Client just needed reliable call logging and simple distribution. Shipped that first, added features later based on actual usage.
Webhooks are better than polling. Twilio's webhook approach is clean and efficient. No need to constantly poll for new calls. They ping us, we log it, done.
Simple UI wins for non-technical users. Contractors don't want fancy dashboards. They want: "Here are your leads. Click to call. Mark as contacted." Keep it simple.
Real-time updates matter. The WebSocket implementation added complexity but made a huge difference in user experience. Contractors love seeing leads appear instantly.
Tech Stack Details
- Frontend: React 18 with React Router, styled-components
- Backend: Node.js with Express, WebSocket for real-time
- Database: PostgreSQL with connection pooling
- API Integration: Twilio Voice, SMS, and Call Recording APIs
- Authentication: JWT with refresh tokens, role-based access control
- Hosting: AWS EC2 t3.medium instance, RDS for database
- Monitoring: Custom logging with PM2 for process management
- Backups: Automated daily database backups to S3
Total codebase: around 8,000 lines of code (frontend and backend combined). Built over 6 weeks working part-time.