FleetFlow is a modular full-stack platform that digitizes fleet operations: vehicle lifecycle, driver compliance, trip dispatching, maintenance, fuel/expense tracking, and ROI analytics.
Location: server/
- Node.js + Express
- MongoDB + Mongoose
- JWT authentication
- Role-based authorization
models/:User,Vehicle,Driver,Trip,MaintenanceLog,FuelLogcontrollers/: domain logic and validationsroutes/: REST endpoints per modulemiddleware/: auth + error handlingutils/: token generation, async helpers, seeding
- Vehicle dispatch blocked when status is
In Shop,Out of Service, orOn Trip - Driver dispatch blocked when suspended, expired license, or already on trip
- Trip creation blocked if
cargoWeight > vehicle.maxLoadCapacity - Trip lifecycle supports:
Draft -> Dispatched -> Completed -> Cancelled - On trip completion:
- vehicle odometer auto increments
- vehicle status returns to
Available(orOut of Serviceif flagged) - driver status moves to
On Duty
- On maintenance log creation:
- vehicle auto moves to
In Shop - vehicle is naturally excluded from available-dispatch lists
- vehicle auto moves to
- Vehicle deletion blocked if active trip exists
- Driver completion rate auto-calculated using aggregate stats
- Operational cost endpoint:
Fuel + Maintenance - Analytics formulas:
Fuel Efficiency = km / LROI = (Revenue - (Maintenance + Fuel)) / Acquisition Cost
Run seed script to generate realistic demo users, vehicles, drivers, trips, maintenance, and fuel logs.
Seed credentials:
- manager@fleetflow.io / Password123!
- dispatcher@fleetflow.io / Password123!
- safety@fleetflow.io / Password123!
- finance@fleetflow.io / Password123!
Location: client/
- React (Vite)
- JavaScript (no TypeScript)
- Tailwind CSS
- React Router
- Context API
- Axios
- Chart.js (
react-chartjs-2)
- Clean SaaS-style layout (blue/indigo/gray)
- KPI cards, status pills, responsive tables
- Smooth hover states, no heavy animation
- Toast notifications + loading spinners
- Login (JWT + role-based redirect)
- Dashboard Command Center (KPIs + filters)
- Vehicle Registry (CRUD + OOS toggle)
- Trip Dispatcher (capacity and availability validation)
- Maintenance & Service Logs (auto
In Shopstatus behavior) - Expense & Fuel Logging (operational cost computation)
- Driver Management (license compliance + completion rate view)
- Analytics (charts + CSV export)
- Start MongoDB locally (
mongodb://127.0.0.1:27017/fleetflow) or update env values. - Configure backend env using
server/.env.example. - Configure frontend env using
client/.env.example. - Seed backend data (
npm run seedinserver). - Login from frontend using seeded credentials.
cd server
npm install
copy .env.example .env
npm run seed
npm run devcd client
npm install
copy .env.example .env
npm run devFrontend URL: http://localhost:5173
Backend URL: http://localhost:5000
- Login as Fleet Manager and open Dashboard.
- Show KPI cards and filter by
Truck+On Trip. - Go to Vehicle Registry and toggle one vehicle to
Out of Service. - Go to Trip Dispatcher:
- Attempt over-capacity cargo (show validation error)
- Create valid trip and dispatch
- Open Maintenance page and add service log:
- Explain auto status to
In Shop - Show vehicle unavailable for dispatch
- Explain auto status to
- Open Expense & Fuel page and add a fuel record.
- Open Driver page and highlight completion rate + license visibility.
- Open Analytics page:
- Show Fuel Efficiency + ROI chart
- Export CSV
- Log out and log in as Financial Analyst to show role-scoped analytics access.
POST /api/auth/loginGET /api/auth/meGET/POST/PUT/DELETE /api/vehiclesPATCH /api/vehicles/:id/out-of-serviceGET/POST/PUT/DELETE /api/driversGET/POST /api/tripsPATCH /api/trips/:id/statusGET/POST /api/maintenancePATCH /api/maintenance/:id/resolveGET/POST /api/fuelGET /api/fuel/cost/:vehicleIdGET /api/dashboardGET /api/analytics