PROJECT STUDY

Logistics Intelligent

Plan deliveries and stock around a changing day.

A dispatch and supply-planning system for delivery routes, fleet disruptions and retail replenishment across multiple warehouses.

Explore the build
Illustration of the dispatch view: a five-stop example route for Wave 03, Van A on a city street grid crossed by a river, with a dispatch draft card for an urgent stop that waits for review before it is applied.
Original interface illustration · Synthetic demo data.View larger

At a glance

Industry
Logistics
Capabilities
7
Technologies
12
Year
2026
45.6 s

Route plan for 1,000 synthetic stops and 60 vehicles

15.6 min

Replenishment plan for a synthetic network of 5,000 stores and 10 distribution centres

The challenge

A delivery plan changes throughout the day.

Urgent orders arrive, traffic builds, vehicles break down and a stop can take longer than expected. Dispatchers need to adjust the plan while keeping drivers informed and customer commitments visible.

Retail supply adds another layer: which warehouse should serve each store, what stock will run out, and when an emergency delivery or purchase order is needed.

What we built

Logistics Intelligent connects daily delivery execution with retail stock and supply planning.

A planner for real operating rules

Orders, delivery windows, vehicle capacity, driver shifts, breaks and skills feed a route-planning engine. Dispatchers can review plans, drag stops between routes and lock decisions that should be preserved

A planner for real operating rules

Orders, delivery windows, vehicle capacity, driver shifts, breaks and skills feed a route-planning engine. Dispatchers can review plans, drag stops between routes and lock decisions that should be preserved

A control tower for the day ahead

A live map, fleet status, alerts and an at-risk delivery queue help the team spot problems and choose the next action, and a plan-versus-actual replay shows where the day drifted

Changes with approval

Urgent orders, cancellations, delays and breakdowns produce concrete route-change proposals. Small changes apply automatically, while larger ones, breakdowns and driver unavailability wait for dispatcher approval. Version checks stop an older proposal from overwriting a newer plan

Driver workflows

The Flutter driver app caches the day's route, records proof of delivery and queues every event offline until it can sync. GPS is accepted only while a driver is on duty, after consent

Multi-warehouse replenishment

Forecasts, inventory freshness, store-to-warehouse selection and multi-trip truck routing work together to plan deliveries across the network

Stock and procurement

Stock-out risk, emergency requests, transfer suggestions and peak-season preparation connect to buyer-approved purchase orders. Supplier receipts update inventory and lead-time estimates

Quick commerce

Dark-store orders are allocated with substitutes or splits, riders are assigned and batched, and the delivery promise shrinks its area during peaks and rain

How it works

  1. Plan the day

    Orders, the SLA matrix, shifts, skills and restriction zones become a Google OR-Tools routing model, solved in a separate process pool so the API stays responsive. Dispatchers review the routes, lock what must stay and publish the plan to the driver app.

  2. Re-plan under change control

    Live disruptions are handled by cheapest feasible insertion and local resequencing, or by a full OR-Tools re-solve when a dispatcher asks for one. Each change arrives as a versioned proposal with a one-line explanation. It applies automatically when it touches up to 3 stops, and waits for a dispatcher when it touches more or comes from a breakdown or an unavailable driver.

  3. Predict arrivals and risk

    ETAs combine routing time with LightGBM quantile corrections, and a Monte Carlo simulation turns them into an SLA risk for every delivery. Risky deliveries feed the at-risk queue in the control tower, each with its reason and a suggested action.

  4. Replenish the store network

    LightGBM demand forecasts, weighted by an Indonesian calendar of paydays, Ramadan, Lebaran and school holidays, drive store quantities. CP-SAT models assign stores to distribution centres, multi-trip truck routing plans the deliveries, and purchase orders wait for a buyer's approval.

  5. Integrations with fallback paths

    OSRM routing, Valhalla isochrones, Nominatim geocoding, WhatsApp notifications, Traccar telematics and Gemini through LiteLLM are optional integrations, each with a fallback, so the core platform runs without any of them.

Engineering insights

The React control tower patches its TanStack Query caches from WebSocket frames, the Flutter driver app syncs over REST, and a worker claims queued jobs and runs periodic tasks such as the alert engine and the stock-out risk monitor, so the FastAPI API itself stays stateless.

Stack by layer

Frontend
  • React
  • TypeScript
  • Vite
  • React Router
  • TanStack Query
  • Tailwind CSS
  • MapLibre GL JS
  • PMTiles
  • Recharts
  • dnd kit
  • Flutter
  • Dart
Backend
  • Python
  • FastAPI
  • Uvicorn
  • Pydantic
  • WebSockets
  • PyJWT
  • HTTPX
Data
  • PostgreSQL
  • SQLite
  • SQLAlchemy
  • Alembic
  • H3
  • NumPy
  • SciPy
AI
  • Google OR-Tools
  • PyVRP
  • LightGBM
  • scikit-learn
  • Google Gemini
  • LiteLLM
Infrastructure
  • Docker
  • Docker Compose
  • nginx
  • NATS
  • OSRM
  • Valhalla
  • Nominatim
  • Traccar
  1. Change control that counts only real changes

    Each disruption is drafted over a live context where completed stops, a next stop within 10 minutes of arrival and parcels already on board stay put, and touched stops are counted with a longest-increasing-subsequence diff, so one insertion does not mark every later stop as changed. Each proposal stores the route versions it was computed from and expires after 15 minutes, and one whose routes changed in the meantime is marked superseded instead of overwriting the newer plan

  2. An offline outbox the server can replay

    Every driver action is written to a local SQLite outbox and drained strictly in order, so an event that references a proof-of-delivery photo waits until that upload is acknowledged. The server treats each event as idempotent on its client event ID and answers per event with accepted, duplicate, rejected or conflict when the stop was cancelled or reassigned while the driver was offline

  3. Cluster first, route second

    A single OR-Tools model per distribution centre slows down beyond a few hundred stops, so stores are swept into angular sectors of at most 250 stops, solved in parallel and finished by a cleanup wave for leftovers at sector boundaries. Several trips per truck are planned as departure waves, each a plain capacitated routing problem with time windows

  4. Solvers run outside the API's GIL

    OR-Tools holds the Python GIL for its whole search, so solves run in a warm spawn process pool while REST and WebSocket handling stay responsive. Jobs are database rows claimed with a conditional update, and periodic tasks run only on the holder of a PostgreSQL advisory lock

  5. Probabilistic stock-out risk

    For every store and SKU, the monitor sums forecast demand until the next regular delivery and computes the probability of running out, with Normal, Poisson or negative binomial models graded per ABC class. Stale stock counts are never ordered automatically, and a partial unique index allows only one open emergency request per store and SKU

Design system

Slate operations console is a dense, light, data-first interface for dispatchers and operations staff on large screens. Slate neutrals, a navy sidebar and one blue accent keep the chrome quiet, so status colour carries the meaning.

Colour palette

  • Sidebar navy#0f172aNavigation sidebar, browser theme colour and favicon tile
  • Route blue#2563ebVehicles and stops en route, running jobs and routes in progress
  • Delivered green#16a34aCompleted stops, delivered orders, published plans and low SLA risk
  • Warning amber#f59e0bMedium SLA risk, idle vehicles and proposals awaiting approval
  • Alert red#dc2626High SLA risk, failed stops, critical alerts and over-capacity loads
  • Pending slate#94a3b8Pending stops, queued jobs and draft routes
  • Colour

    Status colours are defined once in code and shared by map layers, tables, badges and legends: blue for vehicles en route and running jobs, green for completed stops and published plans, amber for medium SLA risk and proposals awaiting approval, and red for high risk, failed stops and critical alerts

  • Typography

    A system sans stack on a dense 14 px base, with 12 px secondary text, an 11 px step for badges and tabular numerals, so KPIs, tables and times line up

  • Components

    In-house React primitives on Tailwind CSS 4 with no third-party component library: icon buttons that require an accessible label, status and risk badges, data tables, dialogs on the native dialog element, tabs, toasts and KPI cards, with Lucide icons and MapLibre map layers

  • Accessibility

    Every map selection is also possible from a keyboard-accessible list beside the map, focus moves into the panel a user opens, and focus rings and reduced motion are built in

  • Driver app

    The Flutter app uses Material 3 seeded from teal, with light and dark themes that follow the phone and one stop-status palette shared by its stop list, detail screen and map

Where this fits

Teams coordinating vehicles, stores and warehouses benefit from a shared planning workflow and clear change control. See our business systems, AI solutions and logistics work, or talk through your operation.

talk through your operation

Let’s connect the dots

Let's put these ideas to work.

Share a process, product, or problem you want to improve. We will work through the possibilities together.

Discuss your project