Amine Benamrouche · Projects
← Back to projects

Send — Last-Mile Delivery Platform

Overview

Send is a last-mile delivery startup connecting local businesses with drivers. I was the sole backend developer — building a Laravel REST API for a Flutter mobile app (drivers and sellers) and a Vue.js admin dashboard, which I also built end to end.

The platform supports three user roles — administrators, sellers, and drivers — each authenticated through a dedicated Laravel Sanctum guard. Sellers submit delivery requests for one or more drop-offs; the backend plans a route, prices it, matches a driver, and tracks the delivery through to completion.

This was my first professional project, built from database design through a complete backend and dashboard — around 85 API endpoints and 15 core models. Send has not yet publicly launched, with the founder targeting a launch soon.

Multi-Stop Route Optimization

A seller can bundle several drop-offs into one delivery request. Finding the provably shortest path through all of them is the Traveling Salesman Problem — NP-hard, and overkill for the stop counts a single driver actually carries. The backend uses a nearest-neighbor heuristic instead:

Nearest-neighbor route optimization feeding into the distance-zone pricing engine

Starting from the seller’s location, it repeatedly jumps to the closest remaining stop, summing great-circle distance as it goes. That total distance matches a distance-zone pricing bracket — each zone carrying its own base fare, per-km rate, and per-stop fee — to produce the fare.

It’s a greedy approximation using straight-line distance rather than actual road distance — a deliberate cost tradeoff: at the scale this startup was operating at, integrating a paid routing service wasn’t justified.

Key Engineering Contributions

  • Multi-role API architecture: Designed and built three independently guarded API surfaces (admin, seller, driver) over Laravel Sanctum, with shared endpoints for cross-role resources like orders and delivery requests.
  • Route planning and pricing: Implemented the nearest-neighbor route optimization above, coupled to the distance-zone pricing engine.
  • Driver matching: Built nearest-available-driver matching from live driver locations, factoring in vehicle type and availability.
  • Admin dashboard: Built the full Vue 3 / Vuetify operations dashboard — driver and seller onboarding and approval queues, pricing and referral configuration, payment/settlement tracking, and KPI/analytics views — consuming the API I designed.
  • Notifications: Integrated Firebase Cloud Messaging for push notifications to drivers and sellers, and the WhatsApp Cloud API for order-confirmation, delivery-completion, and rating-request messages to sellers.
  • Referral system: Built a seller referral program with percentage-based bonuses tracked per delivery.
  • Auth and onboarding: Implemented Google OAuth login across all three user types alongside standard credential auth.

Technical Stack

ComponentTechnologies
BackendPHP, Laravel
DatabaseMySQL
AuthenticationLaravel Sanctum (multi-guard), Google OAuth
API architectureREST API
Admin dashboardVue 3, Vuetify
Push notificationsFirebase Cloud Messaging
MessagingWhatsApp Cloud API

Looking Back

Send was where I learned to own a backend end to end — schema, API, integrations, and the dashboard consuming all of it — without a senior developer to lean on.

What I’d change, looking back
  • Validation in FormRequest classes instead of inline in the controller
  • Business logic in service classes instead of fat controllers
  • Responses through API Resources
  • Driver matching as a queued job with proper locking around the assignment, instead of running it inline unguarded

That’s the lesson that now shapes how I structure every Laravel codebase I touch.