How subham8838/optifleet-tms works
OptiFleet is a multi-tenant transport-management application. Company users sign in, then manage fleet records and trips; trip data supports consignment documents and invoicing, while the dashboard summarizes operations. Owners also manage plans and payment submissions, and a platform administrator verifies subscriptions. Vehicle-document expiry and subscription lifecycle events feed notifications. The graph shows the major documented product areas, but several route/controller connections are supported only by the source index or README; unsampled implementation details are not inferred.
Main entry points: user.js Company accounts · subscriptionAdmin.js Platform subscriptions · app.js Express application · subscription.js Plan access limits
Components 34
Access and tenancy
- Company accounts
backend/controllers/user.js - User records
backend/models/user.js - Role access
backend/middlewares/users.js - Express application
app.js - Account routes
backend/routes/user.js - Company records
backend/models/tms.js
Fleet operations
- Driver management
backend/controllers/driver.js - Driver records
backend/models/driver.js - Vehicle management
backend/controllers/vehicle.js - Vehicle records
backend/models/vehicle.js - Vehicle routes
backend/routes/vehicle.js - Trip lifecycle
backend/controllers/trip.js - Trip records
backend/models/trip.js - Trip routes
backend/routes/trip.js - Parties and invoices
backend/controllers/logistics.js - Logistics routes
backend/routes/logistics.js - Operational dashboard
backend/controllers/dashboard.js
Billing and subscriptions
- Company billing
backend/controllers/billing.js - Platform subscriptions
backend/controllers/subscriptionAdmin.js - Subscription records
backend/models/Subscription.js - Plan catalog
backend/models/plan.js - Plan access limits
backend/middlewares/subscription.js
Shared services
- In-app notifications
backend/controllers/notification.js - Notification creation
backend/utils/notify.js - Scheduled checks
backend/utils/Crons.js - Email delivery
backend/controllers/mailer.js - PDF rendering
backend/utils/browser.js - Dashboard cache
backend/utils/Cache.js - Request validation
backend/middlewares/validate.js - Document upload
backend/middlewares/upload.js - MongoDB
- Redis
backend/utils/RedisClient.js - ImageKit
Other components
- Company user
Connections 48
- Company user → Express application: uses
app.js - Express application → Account routes: mounts
app.js - Express application → Trip routes: mounts
app.js - Express application → Vehicle routes: mounts
app.js - Express application → Logistics routes: mounts
app.js - Express application → Scheduled checks: starts
app.js - Account routes → Company accounts: routes to
backend/routes/user.js - Company accounts → User records: reads and writes
backend/controllers/user.js - Company accounts → Company records: creates and finds
backend/controllers/user.js - Company accounts → Subscription records: checks plan
backend/controllers/user.js - Company accounts → Driver records: links profile
backend/controllers/user.js - Company accounts → Email delivery: sends email
backend/controllers/user.js - Company accounts → Notification creation: creates alert
backend/controllers/user.js - Trip routes → Trip lifecycle: routes to
backend/routes/trip.js - Trip lifecycle → Trip records: creates and updates
backend/controllers/trip.js - Trip lifecycle → Driver records: checks assignment
backend/controllers/trip.js - Trip lifecycle → Vehicle records: checks vehicle
backend/controllers/trip.js - Trip lifecycle → Notification creation: creates alert
backend/controllers/trip.js - Vehicle routes → Vehicle management: routes to
backend/routes/vehicle.js - Vehicle routes → Plan access limits: gates creation
backend/routes/vehicle.js - Vehicle routes → Request validation: validates input
backend/routes/vehicle.js - Vehicle routes → Document upload: accepts documents
backend/routes/vehicle.js - Vehicle management → Vehicle records: manages records
backend/controllers/vehicle.js - Vehicle management → Driver records: updates assignment
backend/controllers/vehicle.js - Vehicle management → ImageKit: stores documents
- Logistics routes → Parties and invoices: routes to
backend/routes/logistics.js - Parties and invoices → PDF rendering: renders documents
backend/controllers/logistics.js - Parties and invoices → Trip records: finds unbilled trips
backend/controllers/logistics.js - Operational dashboard → Trip records: aggregates
backend/controllers/dashboard.js - Operational dashboard → Driver records: aggregates
backend/controllers/dashboard.js - Operational dashboard → Vehicle records: aggregates
backend/controllers/dashboard.js - Operational dashboard → Dashboard cache: caches results
backend/controllers/dashboard.js - Dashboard cache → Redis: uses
backend/utils/Cache.js - Platform subscriptions → Subscription records: manages lifecycle
backend/controllers/subscriptionAdmin.js - Platform subscriptions → Plan catalog: uses plans
backend/controllers/subscriptionAdmin.js - Platform subscriptions → User records: checks accounts
backend/controllers/subscriptionAdmin.js - Platform subscriptions → Company records: manages company billing
backend/controllers/subscriptionAdmin.js - Platform subscriptions → Notification creation: creates alert
backend/controllers/subscriptionAdmin.js - Platform subscriptions → Email delivery: sends email
backend/controllers/subscriptionAdmin.js - Plan access limits → Subscription records: checks status
backend/middlewares/subscription.js - Plan access limits → Plan catalog: checks limits
backend/middlewares/subscription.js - Plan access limits → Vehicle records: counts vehicles
backend/middlewares/subscription.js - Plan access limits → Driver records: counts drivers
backend/middlewares/subscription.js - Plan access limits → Trip records: counts trips
backend/middlewares/subscription.js - Scheduled checks → Vehicle records: checks expiry
backend/utils/Crons.js - Scheduled checks → Subscription records: checks trials
backend/utils/Crons.js - Scheduled checks → Notification creation: raises alerts
backend/utils/Crons.js - Notification creation → In-app notifications: persists alerts
backend/utils/notify.js