← Projects / Dispatch
📦

Dispatch

Full Stack Production Microservice

Overview

Dispatch is a full-stack fulfillment routing and warehouse assignment system built to automate the conversion of incoming orders into fulfillable parcels. It selects the optimal warehouse for each parcel based on real-time stock availability, shipping cost, and order priority — then tracks each shipment through to delivery via third-party tracking integrations.

The system runs as part of a broader microservices platform and handles high-volume concurrent queue processing while maintaining strict stock consistency across multiple warehouses. It replaced a largely manual fulfillment workflow and scaled to 200,000+ parcels per month.

Order routing & warehouse fulfillment flow

Features

  • Order priority-based queue — ensures high-value and time-sensitive orders are processed first
  • Warehouse placement engine — selects the optimal warehouse per parcel based on stock availability and shipping cost
  • Stock forecasting and cross-warehouse synchronization to prevent overselling
  • Per-parcel and per-order cost calculation for operations reporting
  • API and internal UI for manual operations and fulfillment adjustments by logistics teams
  • Real-time tracking updates via third-party tracking system integrations
  • Automated concurrent queue processing to handle high order volumes while keeping stock consistent

Architecture

Part of a broader microservices ecosystem. Dispatch receives order events from upstream services and emits parcel and tracking events consumed by other services in the platform.

Frontend
Internal operations UI for logistics and warehouse teams to handle manual overrides, monitor queue status, and adjust assignments.
API
Receives requests from the frontend and upstream services. Exposes endpoints for order ingestion, stock queries, and manual operations.
Workers
Inngest functions handle the core routing logic asynchronously — warehouse selection, cost calculation, and tracking update ingestion — with retry logic and concurrency controls.
Database
PostgreSQL stores orders, parcels, warehouse stock levels, shipping costs, and tracking events with transactional guarantees for stock consistency.

Tech Stack

Frontend
Next.js React Tailwind CSS shadcn/ui
Backend
TypeScript Bun Elysia.js Inngest PostgreSQL Docker GCP