Project Case Study · Odoo Hackathon

TransitOps

A smart, enterprise-grade transport operations & fleet management platform featuring ACID-compliant state machines, multi-persona RBAC, and real-time operational cost analytics.

Live Demo → GitHub Repo

How It Started

Logistics and transport operations frequently suffer from fragmented spreadsheet workflows, race conditions during vehicle dispatching, and disconnected financial tracking. Fleet managers often assign vehicles that are undergoing maintenance or drivers with expired licenses because validation only happens on paper or isolated dashboards.

I co-engineered TransitOps as an end-to-end, enterprise-ready smart transport operations platform. Built on a clean 3-tier architecture with React (Vite), Node.js/Express, and local PostgreSQL 18 via Prisma ORM, TransitOps enforces strict business logic inside database transactions—guaranteeing atomic state transitions, foolproof compliance guardrails, and tailored role-based workflows for every persona across the logistics lifecycle.

Architecture & Flowchart

        graph TD
          FM((Fleet Manager)) -->|CRUD & Dispatch| UI[React SPA - Vite]
          SO((Safety Officer)) -->|Compliance & Drivers| UI
          DR((Driver)) -->|Trip Execution| UI
          FA((Financial Analyst)) -->|Fuel & ROI Analytics| UI
          
          UI -->|REST API + JWT Bearer| API[Express API Server - RBAC Middleware]
          API -->|Service Layer Transactions| Services[Trip & Maintenance Service Layer]
          Services -->|Prisma ORM Atomic Queries| DB[(PostgreSQL 18 Database)]
          
          subgraph State Enforcement
            Services --> StateRule[Atomic State Machines: AVAILABLE <--> ON_TRIP / IN_SHOP]
            Services --> Guardrail[Compliance Guards: License Validity & Cargo Weight Checks]
          end
      

Key Technical Innovations & Challenges Solved

1. Race-Safe Atomic State Machines inside DB Transactions

A critical challenge in dispatch systems is concurrent assignment—preventing a vehicle or driver from being double-booked across simultaneous trips. In TransitOps, all status transitions (`DRAFT → DISPATCHED → COMPLETED`) execute within atomic database transactions (`prisma.$transaction`). When a trip is dispatched, the system verifies availability and locks both the vehicle and driver status (`ON_TRIP`) atomically, eliminating race conditions entirely.

2. Multi-Persona Role-Based Access Control (RBAC)

Enterprise logistics teams require segregated domain ownership. TransitOps implements a 4-tier RBAC matrix covering Fleet Managers (full system governance), Safety Officers (driver compliance & license validity auditing), Drivers (trip operational lifecycle), and Financial Analysts (fuel logs, expense tracking, and ROI reporting). Security is enforced at both the API layer via JWT authorization middleware and the UI layer via contextual navigation gating.

3. Precision Financial Analytics & Compliance Guardrails

To prevent floating-point inaccuracies in financial and cargo accounting, all monetary amounts and load weights are modeled as exact `DECIMAL` types at the PostgreSQL schema level. The platform automatically calculates real-time operational KPIs including Fleet Utilization %, Fuel Efficiency (km/L), Per-Vehicle Operating Costs, and Net Fleet ROI, while actively blocking dispatch attempts for drivers with expired licenses or overweight cargo.