TransitOps is a smart transport operations platform for vehicle registry, driver compliance, dispatch, maintenance, fuel, expenses, vehicle documents, and operational analytics.
- Node.js and npm
- PostgreSQL
psqlcommand-line client
Create the local database from the project root:
createdb transitopsConfigure backend environment:
cd backend
cp .env.example .envUpdate backend/.env with your local Postgres credentials:
DATABASE_URL=postgresql://postgres:YOUR_PASSWORD@localhost:5432/transitops
JWT_SECRET=replace-with-a-long-random-secret
NODE_ENV=development
PORT=5001
ALLOW_PUBLIC_REGISTER=false
SAFETY_REMINDER_EMAIL=safety@transitops.local
GMAIL_USER=yourgmail@gmail.com
GMAIL_APP_PASSWORD=your-16-character-app-password
MAIL_FROM_NAME=TransitOpsLoad the database schema and seed demo data:
cd ..
psql "postgresql://postgres:YOUR_PASSWORD@localhost:5432/transitops" -f transitops.sql
cd backend
npm install
npm run db:seed
npm run db:demoStart the backend:
npm startIn a second terminal, start the frontend:
cd frontend
npm install
npm run devOpen the app:
http://127.0.0.1:5173/
Backend health check:
http://127.0.0.1:5001/health
The frontend proxies /api requests to http://localhost:5001.
| Role | Password | |
|---|---|---|
| Admin | admin@transitops.io | admin123 |
| Fleet Manager | fleet@transitops.io | manager123 |
| Dispatcher | dispatcher@transitops.io | dispatch123 |
| Safety Officer | safety@transitops.io | safety123 |
| Financial Analyst | finance@transitops.io | finance123 |
| Role | Access |
|---|---|
| Admin | Full access, user management, settings, all operational modules |
| Fleet Manager | Dashboard, vehicle registry, drivers, trips, maintenance, fuel and expenses, reports, settings |
| Dispatcher | Dashboard, vehicle registry, trip dispatching, reports |
| Safety Officer | Dashboard, driver compliance, maintenance, license reminders, reports |
| Financial Analyst | Dashboard, fuel logs, expenses, operational cost, reports, read-only operational views |
| Driver | Dashboard and trip workflow access |
Public registration is disabled by default. Create and manage users from the Settings page using the seeded Admin account.
- Open Vehicle Registry.
- Add a vehicle with registration number, model, type, region, capacity, odometer, acquisition cost, and status.
- Use filters for type, status, and region.
- Use Docs to add vehicle documents such as registration, insurance, permit, fitness, pollution, or other records.
- Retired and in-shop vehicles are excluded from dispatch availability.
- Open Drivers & Safety Profiles.
- Add a driver with license number, category, expiry date, contact number, safety score, status, and region.
- Filter by status or license expiry.
- Drivers with expired licenses or suspended status cannot be dispatched.
- Use License Reminders to send a Gmail reminder email for licenses expiring within 30 days.
- Open Trip Dispatching.
- Create a draft trip with source, destination, available vehicle, available driver, cargo weight, planned distance, and optional revenue.
- Dispatch the trip.
- The system validates vehicle status, driver status, license expiry, active assignments, and cargo capacity.
- Dispatching changes the vehicle and driver to
ON_TRIP. - Completing the trip records actual distance, fuel consumed, end odometer, and revenue, then restores vehicle and driver availability.
- Cancelling a dispatched trip restores vehicle and driver availability.
- Open Maintenance.
- Create a maintenance record for an available vehicle.
- Active maintenance changes the vehicle status to
IN_SHOP. - In-shop vehicles are hidden from dispatch selection.
- Closing maintenance restores the vehicle to
AVAILABLEunless it is retired.
- Open Fuel & Expense Management.
- Log fuel entries with vehicle, liters, cost, and date.
- Log other expenses such as tolls, insurance, maintenance, or other costs.
- Reports use fuel logs, maintenance logs, expenses, trip distance, and revenue to calculate cost and ROI.
- Open Reports & Analytics.
- Review fleet utilization, average fuel efficiency, expenses, trip completion, vehicle performance, and ROI.
- Export trip data as CSV.
- Export the operations report as PDF.
- Login as Admin.
- Open Settings & RBAC.
- Review role permissions.
- Create or update user accounts and assign roles.
- Keep public registration disabled for controlled access.
Backend:
cd backend
npm start
npm run db:seed
npm run db:demo
npm testUse deterministic demo data before a product walkthrough:
cd backend
npm run db:seed
npm run db:demoThe demo script safely replaces records with DEMO- vehicle registrations and driver licenses. It creates:
- vehicles across available, on-trip, in-shop, and retired states
- drivers with valid, expiring, expired, suspended, and off-duty profiles
- trips across draft, dispatched, completed, and cancelled states
- active and closed maintenance records
- fuel logs, tolls, insurance, maintenance, and other expenses
- vehicle documents with realistic expiry dates
- report-ready revenue, cost, utilization, fuel-efficiency, and ROI data
- Login as Admin or Fleet Manager.
- Open Dashboard and show KPIs, filters, and status charts.
- Open Vehicle Registry and inspect
DEMO-VAN-05,DEMO-TRUCK-09, documents, statuses, and filters. - Open Drivers & Safety Profiles and show expiring or blocked licenses.
- Open Trip Dispatching, create a draft trip with an available vehicle and valid driver, then dispatch it.
- Complete a dispatched trip using the inline completion panel.
- Open Maintenance and show that active maintenance moves
DEMO-TRUCK-09intoIN_SHOP. - Open Fuel & Expense Management and show fuel and expense logs filtered by vehicle.
- Open Reports & Analytics and export CSV/PDF.
- Send a license reminder email from Drivers & Safety Profiles.
- Open Settings & RBAC to explain role access.
Frontend:
cd frontend
npm run dev
npm run lint
npm run build
npm run previewIf the backend logs this error:
client password must be a string
Your DATABASE_URL probably has an empty password, such as:
DATABASE_URL=postgresql://postgres:@localhost:5432/transitopsReplace it with a valid password:
DATABASE_URL=postgresql://postgres:YOUR_PASSWORD@localhost:5432/transitopsIf vehicle types, license categories, regions, or demo users are missing, run:
cd backend
npm run db:seedIf API calls fail because tables do not exist, load the schema from the project root:
psql "postgresql://postgres:YOUR_PASSWORD@localhost:5432/transitops" -f transitops.sqlBackend default port:
5001
Frontend default port:
5173
If either port is busy, stop the existing process or configure another port.
If Vite reports a missing Rolldown native binding, refresh frontend dependencies:
cd frontend
npm installLicense reminder email delivery uses Gmail with an App Password.
- Enable 2-Step Verification on the Gmail account.
- Create an App Password in Google Account security settings.
- Add these values to
backend/.env:
SAFETY_REMINDER_EMAIL=recipient@example.com
GMAIL_USER=yourgmail@gmail.com
GMAIL_APP_PASSWORD=your-16-character-app-password
MAIL_FROM_NAME=TransitOpsUse the App Password, not your normal Gmail password.
Run these before sharing or deploying the project:
cd backend
npm test
cd ../frontend
npm run lint
npm run build- Use a strong
JWT_SECRET. - Keep
ALLOW_PUBLIC_REGISTER=false. - Configure a production PostgreSQL database.
- Run schema setup and seed required lookup data before first login.
- Configure Gmail App Password credentials for
/api/reminders/license-expiry/send.