Skip to content

Fleet & Cold-Chain Logistics: Full Stack Fleet & Cold-Chain Platform

A driver-facing mobile app and backend for a Moroccan food-distribution company's fleet operations.

Role
Mobile app and API, team of 4
Status
In testing
Sector
Food distribution fleet

The problem

Before this system, the client's fleet operations ran on manual, disconnected processes. Mission and route planning was coordinated by phone and paper rather than a shared system, making it hard for dispatchers to know in real time which driver was assigned where. Vehicle condition during transport, critical for temperature-sensitive food distribution, had no live visibility; if a refrigeration unit failed or temperature drifted out of range mid-route, nobody knew until delivery and the product was already compromised. Fuel usage was self-reported by drivers with no way to catch discrepancies, leaving fuel costs and possible fraud unchecked. The client also could not confidently answer which vehicles were worth keeping once maintenance, fuel, and downtime were factored in. Together, these gaps meant the fleet manager and quality manager were reacting after the fact to spoiled product, unaccounted fuel spend, and missed deliveries instead of catching problems as they happened.

What I built

A three-part system: a React Native driver app for check-in and mission execution, a NestJS/PostgreSQL backend exposing the operational API, and an admin dashboard for dispatch, quality, and fleet-management roles. Built by a 4-person freelance team (2 designers, 2 full-stack developers); I owned the mobile app, its full backend API, and several dashboard modules.

Key features

Vehicle & Driver Operations
QR-code vehicle check-in/checkout tied to shift records; mission lifecycle enforced server-side (pending → in progress → completed) and validated against the driver's active shift and assigned vehicle.
Real-Time Cold-Chain Monitoring
Temperature and GPS/speed telemetry streamed over per-vehicle WebSocket rooms, with automatic alerts the moment a reading crosses a safe threshold. A problem that previously surfaced at delivery can now be caught mid-route.
Fuel Management & Anti-Fraud
Driver-submitted fuel reports checked for fraud signals; fuel-card and Jawaz toll-card transaction tracking, closing the gap left by unverified self-reporting.
Maintenance
A scheduled job compares each vehicle's mileage against model-specific service intervals and auto-generates maintenance recommendations, instead of relying on someone remembering to check.
Delivery & Documentation
Delivery-photo confirmation and delivery notes attached to each trip.
Roles & Access
Distinct views for admin, fleet manager ("chef parc"), quality manager ("responsable qualité"), and driver-seller ("conducteur vendeur"), modeled on the client's actual org structure rather than a generic role system.
ERP Sync
Delivery data auto-filled from the client's Sage X3 ERP via a direct SQL Server integration (built by a teammate).

Architecture

  • Backend: NestJS + Prisma + PostgreSQL (31 models, 54 migrations across the team), Redis for caching, Socket.IO for real-time events across 3 gateways (fleet, notifications, storage units).
  • Mobile: React Native 0.79 + Expo 53, Expo Router, Expo push notifications.
  • Auth: JWT with refresh-token rotation, email OTP verification, role-based guards.
  • Deploy: Dockerized services, GitHub Actions CI/CD to a VPS, with a post-deploy check that verifies the container is actually running before marking the deploy successful.

Decisions and trade-offs

  • Refresh-token rotation over a single long-lived JWT: drivers stay logged into the mobile app for long stretches, so a static long-lived token would be a standing liability if leaked from a device. Rotating the refresh token on each use narrows that exposure window, at the cost of extra bookkeeping (tracking valid tokens, handling replay) versus just checking a JWT signature.
  • Automated maintenance recommendations instead of manual scheduling: manual mileage checks are easy to miss. A scheduled job instead runs per vehicle against model-specific service intervals and raises a recommendation automatically, so overdue service becomes a visible flag.
  • Per-vehicle WebSocket rooms rather than one global broadcast channel: telemetry and alerts are scoped to the vehicle a client cares about, so a driver's mobile connection, often on cellular data, receives only its own updates.

Stack

  • NestJS
  • Prisma
  • PostgreSQL
  • Redis
  • Socket.IO
  • React Native
  • Expo
  • Expo Router
  • JWT
  • Docker
  • GitHub Actions

Where it stands

Not yet in production use. The system is complete and deployed, and the client is currently in a testing/UAT phase, entering operational data (vehicles, drivers, routes) to validate the full workflow before committing to day-to-day use. No live usage numbers to report yet.

Start a similar project

Tell me what your business runs on today and what isn’t working. A rough description is enough. I’ll reply with questions or a first idea of how I’d approach it.

Based in Agadir, Morocco

Let’s build it

Planning a platform, an internal tool or a mobile app? Tell me what your business runs on today and what isn’t working. I’ll reply with questions or a first idea of how I’d approach it.

Email me