Saleto - Enterprise Fleet & Driver Settlement Platform
A full-stack fleet lifecycle and automated driver financial settlement platform built with Next.js 16 (Turbopack), NestJS 11, PostgreSQL 17, Redis 8, and Prisma v8 Contract Migrations.
Project Overview
Saleto Fleet Management is an enterprise SaaS platform engineered to manage commercial vehicle fleets, driver lease assignments, weekly financial settlements, and installment payment plans. Built on a containerized Next.js 16 and NestJS 11 architecture with PostgreSQL 17 and Redis 8, the platform tracks every vehicle and driver state transition with immutable audit histories. It features a database-driven dynamic Cron Scheduler engine that automates Sunday reserve installment deductions, short-rental penalty calculations, Monday 3-wave settlement statement email sweeps, and terminated driver debt collection workflows.
Key Features
Bi-directional Vehicle & Driver Lifecycle state machine with full audit history (VehicleStatusHistory & DriverStatusHistory)
Automated Weekly Driver Settlement ledger calculating rental days, frozen daily/weekly rates, tolls, and short-rental / over-income penalties
Driver Payment Plans & Balance Reserves with automated weekly installment deductions and ledger adjustments
Dynamic Database-Driven Cron Scheduler Engine (Sunday Reserve Deductions, Monday 3-Wave Email Statement Sweeps, Tuesday Terminated Debt Collection)
Real-time Scheduler Execution Logs dashboard with manual trigger controls and per-driver affected payout inspection modals
Prisma v8 Contract-First database architecture with deterministic hash-verified forward and rollback migrations
Enterprise security with Google OAuth, TOTP 2FA + backup codes, Email OTP, and hashed multi-device refresh token sessions
Project Gallery




Challenges & Solutions
Deterministic Weekly Financial Settlements & Penalty Snapshots
Fleet rental rates change over time, and drivers swap vehicles mid-week, making retroactive weekly payout calculations and reserve installment deductions prone to race conditions.
Designed a settlement snapshot architecture that freezes daily/weekly rental rates on each DriverWeeklySettlement record and uses an idempotent, mutex-guarded Cron engine that logs every affected driver transaction.
Zero-Drift Schema Evolution with Prisma v8 Contract Migrations
Managing complex financial ledgers, polymorphic audit trails, and foreign-key constraints across staging and production PostgreSQL 17 clusters requires strict schema verification.
Implemented Prisma v8 Contract-First workflows (contract.prisma → contract emit → hash-verified migration plan & rollback) inside Docker entrypoints for reproducible, type-safe deployments.
Synchronized Driver-Vehicle Assignment & Drop-Off Auditing
Assigning or dropping off a vehicle must atomically update the vehicle's current driver, the driver's active vehicle, close open rental contracts, and record status transitions without orphaned references.
Built a centralized FleetLifecycleService in NestJS that coordinates assignment, drop-off, rental contract closure, and dual status history logging in a single transactional workflow.