LeadUp CRM & Lead Management System
Real-Time Lead Distribution & Sales Performance Tracking
High-throughput lead distribution and sales funnel tracking CRM. Includes automated lead distribution, call logging, real-time agent status tracking, and performance metrics designed to keep sales teams working the freshest leads first.
Architecture & System Design
Incoming leads are deduplicated and routed through a weighted distribution algorithm that accounts for live agent capacity and status. Call activity feeds a performance aggregation layer that powers real-time dashboards.
- Weighted round-robin lead distribution factoring live agent capacity and status
- Fingerprint-based deduplication using normalized phone/email hashing
- Real-time agent availability tracking with debounced status broadcasts
- Call disposition tracking feeding directly into performance metrics
Engineering Challenges
Fair, Fast Lead Distribution
Leads needed to reach available agents instantly, but naive round-robin ignored actual agent workload and availability.
Built a weighted distribution algorithm factoring agent capacity, current active leads, and last-assigned timestamp, resolved under a database lock to avoid race conditions.
Distribution latency held under 200ms, reducing agent idle time.
Duplicate Lead Submissions
The same lead often entered through multiple channels (web form, call, referral), inflating pipeline counts and confusing agents.
Implemented fingerprint-based deduplication using normalized phone and email hashing before a lead enters the distribution queue.
Duplicate leads reduced by approximately 85%.
Real-Time Agent Availability
Dashboards needed to reflect agent status changes quickly without overloading the server with constant polling.
Replaced heavy polling with debounced status broadcasts triggered only on actual state changes.
Dashboard reflects agent state changes within seconds under normal load.
Core Features
Lead Distribution Engine
Weighted, capacity-aware assignment routing leads to the best-available agent.
Clean Code
1<?php23namespace App\Services;45use App\Models\Agent;6use App\Models\Lead;78class LeadDistributionService9{10 public function assign(Lead $lead): Agent11 {12 $agent = Agent::where('status', 'available')13 ->withCount('activeLeads')14 ->orderBy('active_leads_count')15 ->orderBy('last_assigned_at')16 ->lockForUpdate()17 ->firstOrFail();1819 $lead->update([20 'agent_id' => $agent->id,21 'assigned_at' => now(),22 ]);2324 $agent->update(['last_assigned_at' => now()]);2526 return $agent;27 }28}