Warehouse Workflow
- Shipment Creation
User enters:
-Destination
-Boxes (L × W × H × weight)
-Deadline
-Origin city
-System auto-calculates:
-Total volume
-Total weight
-Coordinates (via Geocoding API)
- Run Optimization
Backend does:
-Compare shipment with EVERY truck
-Reject trucks that don’t fit
-Score remaining on 5 parameters
-Sort trucks by final weighted score
-Return recommendations
-Warehouse sees the Top 10 Trucks.
- Book a Truck
Creates booking → Dealer receives request.
- Track Shipment
Once assigned:
-Simulation worker starts
-ETA is updated
-Location updates live
-Status changes from in-transit → delivered
-Final analytics generated
Dealer Workflow
Add Truck
Dealer enters:
-Dimensions
-Max weight
-Cost/km
-Service cities
-Base city
-System converts cities → coordinates.
-Booking Management
Dealer can:
-Approve/reject
-Assign truck
-View live movement
-See utilization & CO₂ savings
──────────────────────────────────────────
TruckMafia uses a multi-parameter weighted scoring model inspired by logistics optimization algorithms.
1️ Utilization Score
Calculates how efficiently shipment fills truck:
volumeUtil = shipmentVolume / truckVolume weightUtil = shipmentWeight / maxWeight avg = (volumeUtil + weightUtil) / 2
2️ Distance Score (Haversine Formula)
Real geographic distance:
distance = haversine(truckLocation, warehouseLocation) normalizedScore = ((maxDistance - distance) / maxDistance) * 100
3 Route Score
Exact match → 100 Nearby region → 70 Adjacent city → 40 No relevance → 0
4️ Cost Score
Min–max normalization:
(highestCost - truckCost) / (highestCost - lowestCost)
5️ CO₂ Score
Smaller trucks → better score Large trucks → lower score
Final Score (Weighted) finalScore = utilization * 0.40 + distance * 0.25 + route * 0.15 + cost * 0.15 + co2 * 0.05
This gives a fair, professional, real-world optimized ranking.
#6. ETA Engine & Route Simulation
TruckMafia generates:
-Checkpoints (origin → route cities → destination)
-Distances between each checkpoint
-Real ETA (based on avg speed of 40km/h)
-Simulated ETA (compressed for demo, e.g., 1 hr = 1 min)
Simulation worker:
-Wakes up every X seconds
-hecks ETA of next checkpoint
-Moves truck to that checkpoint
-Updates:
-location
-progress %
-booking status
-final delivery
This gives extremely real tracking without actual GPS.
──────────────────────────────────────────
🛰️ 7. Automated Status Transitions
System automatically transitions:
requested → approved → assigned → in_transit → delivered
No manual status updates needed.