Parcel Delivery Network System

Every parcel,
tracked end to end.

A full-stack courier platform — intelligent routing, a strict parcel state machine, OTP & QR-verified handovers, and a native iOS / Android rider app — orchestrating pickup to delivery across branches and warehouses.

5
User roles
9
Lifecycle states
OTP + QR
Verified delivery
iOS · Android
Native rider app
State Machine

A strict, auditable lifecycle

Nine sequential states enforced in code — no out-of-order jumps. Every transition writes to the status history with who, when and custody details.

pending_pickup
picked_up
at_origin_branch
in_transit_to_warehouse
at_warehouse
in_transit_to_branch
at_destination_branch
out_for_delivery
delivered

Cancellation is permitted at any non-terminal state before dispatch · failed deliveries branch into the return flow

Unique tracking codes

Non-repeating PCL-YYYYMMDD-XXXX numbers from an indexed daily counter.

Polymorphic custody

Holder type & id follow the parcel across business, rider, branch, warehouse and customer.

Full audit history

Every transition logs actor, timestamp, custody and notes to a dedicated history table.

Routing Engine

Geographical intelligence,
resolved on creation

PostgreSQL cube and earthdistance extensions compute straight-line distance to find the nearest active branch by the receiver's coordinates — then the route is decided in one shot.

  • Direct routing when the receiver is inside the origin branch’s coverage radius
  • Via-warehouse routing through the central hub when outside it
  • Interactive Leaflet + OpenStreetMap picker with Nominatim search — no paid geocoding
routing_typeresolveRouting()
Direct
Origin BranchDest. BranchCustomer
Via Warehouse
Origin BranchWarehouseDest. BranchCustomer
Platform

Everything the network runs on

Interlocking systems spanning the API, the web console, and both the native and PWA rider apps.

Multi-Role Auth & Security

Role-based access for 5 distinct roles, bcrypt password hashing, and stateless JWT sessions with signed expiry.

5-role RBACbcrypt + JWTForce password changeEmail OTP reset

Intelligent Routing Engine

PostgreSQL cube + earthdistance find the nearest active branch by lat/lng, then pick direct or via-warehouse routing automatically.

Nearest-branch detectionDirect vs. via-warehouseLeaflet + OSM map picker

Parcel State Machine

Strict sequential transitions prevent out-of-order execution, with unique PCL-YYYYMMDD-XXXX tracking codes and full custody audit.

9-stage forward legPolymorphic holder trackingComplete status history

Double-Factor OTP

Delivery OTPs are emailed to customers and verified in-transaction. Handover OTPs confirm rider → branch custody transfer.

Emailed delivery OTPStaff-issued handover OTPHashed & transactional
Access Control

Five roles, five dedicated portals

Role-based access control gives every actor exactly the surface they need — nothing more.

Admin

Full system control

Provisioning, global reporting, network-wide configuration and returns resolution.

Live Analytics

State counts, branch/warehouse load overviews, rider productivity ledger, transfer activity feed.

User Provisioning

Create and manage riders, branch staff and warehouse staff across the network.

Returns Resolution

Decide RETRY or RETURN TO SENDER on held failed deliveries.

Branch Staff

Inbound / outbound hub

Handles branch-level parcel flow, rider handovers, and local pickup coordination.

Multi-Leg Handovers

Entity-to-entity transfer approvals — initiated → accepted/completed or rejected — under DB transactions.

Handover OTP

Generate an on-screen code for the rider to enter, confirming physical custody transfer.

Rider & Business Management

Assign riders to pickups and manage the businesses this branch serves.

Warehouse Staff

Bulk sorting & dispatch

Manages bulk warehousing, sorting, and dispatching parcels routed through the central hub.

Via-Warehouse Routing

Receives parcels the routing engine decided couldn’t go direct to the destination branch.

Reverse Logistics

Handles the return leg back toward the origin branch when a delivery is sent back.

Inventory & Dispatch

Bin storage, inbound/outbound queues, and editable destination selection on dispatch.

Rider

Native app + PWA

A Flutter Android/iOS app (or installable offline-first PWA) for pickups, QR-verified deliveries and returns — recently upgraded with a full set of field-ready tools.

Home Dashboard

One glance at pending pickups, active deliveries, COD to collect and cash in hand.

Proximity Sorting

Pickups and deliveries sorted by live distance from the rider, not just creation order.

Batch Actions

Multi-select several parcels to pick up or hand over to the branch in one pass.

COD Reconciliation

Tracks cash collected per delivery and lets branch staff confirm settlement handovers.

Delivery History

Searchable, paginated record of every past delivered, failed, returned or cancelled parcel.

Profile & Stats

Vehicle & branch details, password change, and today-vs-lifetime performance counts.

QR + OTP Verified Delivery

Scans the customer’s order QR or enters an emailed code to confirm the right parcel, right door.

Offline Queue

Status updates (single or batch) queue in local storage and replay automatically on reconnect.

Business

Self-service sender portal

Merchants schedule pickups, track parcels in flight, and manage returns without ever calling support.

Merchant Pickup Requests

Schedule pickups with coordinates, package details and COD amounts — staff assign a rider and it becomes a tracked parcel.

Live Parcel Tracking

Follow every shipment’s branch-to-branch timeline from the same portal.

Returns Visibility

See failed-delivery and return-to-sender parcels as they make their way back.

Mobile App

A native rider app,
QR delivery built in

The rider surface ships as a Flutter app for both Android and iOS, bridging the device camera, GPS and connectivity to the underlying web app — with the same installable, offline-first PWA available on any browser.

  • Android & iOS builds from one codebase
  • Native camera bridge powers QR delivery scans
  • GPS & connectivity handed off to native APIs
  • Offline queue that replays on reconnect
delivery verification/myorder/PCL-…
1Customer opens their order QR page
2Rider scans it with the in-app camera
3Code is matched to the tracking number
4Delivery confirmed — geo-stamped
Verified Custody

OTP & QR-verified custody

Independent gates protect every moment where a parcel changes hands.

Delivery OTP

A 6-digit code is hashed & emailed to the customer, then verified in-transaction to finalize delivery.

QR delivery scan

The customer's order QR is scanned at the door and matched to the tracking number — confirming the rider is at the right parcel.

Handover OTP

Branch staff generate a code on-screen for the rider to enter — confirming the physical hand-off from rider to branch.

Rider App

Native app, built for the field

A Flutter iOS / Android app — plus an installable PWA — that keeps working when the signal doesn't.

Native camera bridge

Hardware camera drives QR scans; GPS & connectivity bridged natively.

Offline queue

Status updates queue in local storage and replay on reconnect.

Smart retries

Retains network / 5xx errors, discards permanent 4xx client errors.

GPS proof

Captures coordinates on pickup, handover, delivery and return events.

Deep links

Opens Google Maps / OSM and native tel: calls in one tap.

Follow any parcel in real time

No account needed — enter a tracking number and watch the branch-to-branch timeline, with all sensitive data masked.