RutaLive / Engineering case study

A courier-logistics SaaS across four platforms

A multi-tenant dispatch platform for courier companies in the US and Canada — competing with Onfleet, Digital Waybill and Track-POD at a fraction of their price. Operators dispatch from web or phone, couriers run routes offline-capable, clients order and track live.

My role: co-founder & product engineer — architecture, backend, web, mobile, desktop, and ops. Nov 2025 → present.

Code

150K+ lines shipped

Platforms

Web, iOS, Android, Windows

Workspaces

5 roles, one data core

Scale

6 languages · 13 releases · 36 API modules

01 / Architecture

One core, every surface

No per-platform backends and no duplicated business logic — the same API, socket events and pricing engine feed web, mobile and desktop.

A Clients

React web app (operator · dispatcher · client · admin) — Flutter app for iOS and Android (courier · operator · client) — Electron wrapper for Windows — public pages: live tracking, in-browser demo, marketing site on Astro.

B Core

Node.js + Express API behind Nginx, with a Socket.io real-time layer. JWT auth, role guards, multi-tenant query scoping, rate limiting, the pricing engine and PDF/QR generation live here — once, for every platform.

C Data & services

MongoDB (18 models) — Mapbox for geocoding, routing and live maps — Firebase FCM push in 6 languages — QuickBooks two-way invoice sync — Lemon Squeezy subscriptions — Resend transactional email. Deployed with Docker Compose on a single VPS, memory-capped containers.

02 / Decisions

Decisions that mattered

Not a feature list — the six calls that shaped the system, and why they were made.

01 Multi-tenancy at the query layer

Every courier company is an isolated workspace. All roles live in one User collection, and every database query is scoped by operatorId — isolation is a property of the data access layer, not a per-feature promise. Couriers and clients join through a short operator code instead of invites.

Why it matters: cross-tenant leaks are impossible by construction, and new features inherit isolation for free.

02 Real-time everywhere, polling nowhere

Order state propagates through Socket.io rooms per user. Every event carries a crypto-random _eventId so clients deduplicate replays; updates ship as deltas — only changed fields cross the wire. The mobile socket layer queues emits while offline and re-registers every listener after reconnecting, surviving up to 20 reconnect attempts with backoff.

Why it matters: a dispatcher sees a courier tap "picked up" within a second — with zero polling load on the server.

03 Offline-first courier app

Couriers work in basements and dead zones. The entire delivery flow — accept, pick up, arrive, complete — runs against a local SQLite-backed action queue with connectivity-aware sync: actions execute instantly on-device and replay to the server in order when the network returns. Location tracking keeps working with the screen locked, tuned for battery.

Why it matters: the app never blocks a delivery on signal quality — the courier's day just works.

04 Immutable pricing snapshots

The pricing engine supports six modes — package, distance, weight combinations and polygon delivery zones drawn on the map with point-in-polygon detection. At the moment an order is created, the full pricing configuration and calculated breakdown freeze into the order as a pricingSnapshot.

Why it matters: prices can change tomorrow, but every historical order and invoice stays exactly as sold — pricing disputes end before they start.

05 The demo is the product

rutalive.com/demo opens the real operator dashboard with no account and no backend: in demo mode the API layer is swapped client-side for a ~1,600-line in-browser router and deterministic data store. Orders, couriers, chat, analytics — even courier routes are computed over real roads. The demo can never be down and never needs seeding.

Why it matters: a prospect reaches the full product in one click — the strongest sales asset costs zero infrastructure.

06 Privacy-first analytics, built in-house

Instead of GA4: a self-built visitor analytics pipeline with no cookies and no stored IPs — sessions are salted daily hashes, geo is derived on the fly, and server-side filters drop bots, HTTP clients, AI crawlers, prefetches and foreign-origin requests before they touch the data. Reports are shareable through revocable, expiring read-only links.

Why it matters: marketing decisions run on real humans only, and the analytics respects visitors by design.

Also in production: per-courier session invalidation · HMAC-signed webhooks · unguessable tracking links with a post-delivery privacy guard · QR / photo / signature proof of delivery · scheduled orders · PDF labels and invoices.

03 / Shipped

Shipped, not planned

Thirteen public releases so far. A few of the larger ones:

Multi-stop routesbatching with road-real optimization and one-tap navigation
Proof of deliveryconfigurable QR / photo / signature, geo-tagged
Offline modefull courier flow without signal
Public live trackingrecipient watches the courier like a taxi app, no login
Invoicing suitemulti-language invoices, partial payments, QuickBooks two-way sync with US & Canada taxes
Public APIkeys, webhooks, three integration modes for client shops
Zone pricingmap-drawn zones with per-zone rules
Money dashboardinflow → margin → payouts, per-courier settlement

04 / See it running

The live demo opens the real workspace.

Sample data, no account, no card.