Back to projects
CRM Platform

LeadUp CRM & Lead Management System

Real-Time Lead Distribution & Sales Performance Tracking

LaravelPHPMySQLCRMSaaSREST API
Leads Processed
3K+daily
Distribution Latency
<200ms
Agent Utilization
+30%
Call Logs Tracked
50K+records

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.

Request Flow
Lead Ingestion (Webhook/Form)
Deduplication Engine
Weighted Distribution Algorithm
Agent Queue Assignment
Call Logging & Disposition
Performance Aggregation
Agent Dashboard
  • 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

Problem

Leads needed to reach available agents instantly, but naive round-robin ignored actual agent workload and availability.

Solution

Built a weighted distribution algorithm factoring agent capacity, current active leads, and last-assigned timestamp, resolved under a database lock to avoid race conditions.

Result

Distribution latency held under 200ms, reducing agent idle time.

Duplicate Lead Submissions

Problem

The same lead often entered through multiple channels (web form, call, referral), inflating pipeline counts and confusing agents.

Solution

Implemented fingerprint-based deduplication using normalized phone and email hashing before a lead enters the distribution queue.

Result

Duplicate leads reduced by approximately 85%.

Real-Time Agent Availability

Problem

Dashboards needed to reflect agent status changes quickly without overloading the server with constant polling.

Solution

Replaced heavy polling with debounced status broadcasts triggered only on actual state changes.

Result

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

LeadDistributionService — Capacity-Aware Assignment
1<?php
2
3namespace App\Services;
4
5use App\Models\Agent;
6use App\Models\Lead;
7
8class LeadDistributionService
9{
10 public function assign(Lead $lead): Agent
11 {
12 $agent = Agent::where('status', 'available')
13 ->withCount('activeLeads')
14 ->orderBy('active_leads_count')
15 ->orderBy('last_assigned_at')
16 ->lockForUpdate()
17 ->firstOrFail();
18
19 $lead->update([
20 'agent_id' => $agent->id,
21 'assigned_at' => now(),
22 ]);
23
24 $agent->update(['last_assigned_at' => now()]);
25
26 return $agent;
27 }
28}