How azizbekadxamov-ai/dispatchsim-backend works
DispatchSim is a trucking-dispatch simulation backend. Users authenticate, enter an authorized work area, and use REST features to manage loads, drivers, fleet, finances, and operations; dispatch processing advances loads through delivery and payment. The README documents multi-role accounts and invites, while the source tree shows broader simulation capabilities such as broker/driver chat, compliance, tracking, and academy. Edges use only relationships visible in the excerpts, SOURCE INDEX, or README; several feature internals are unsampled, so their links are intentionally omitted.
Main entry points: app.js HTTP application · auth.service.js Authentication · dispatch.service.js Dispatch engine · loads.controller.js Load endpoints
Components 23
API and identity
- HTTP application
src/app.js - Authentication
src/modules/auth/auth.service.js - Accounts and roles
src/modules/auth/users.repository.js - Invite codes
src/modules/admin/invites.service.js - Administration
src/modules/admin - PostgreSQL pool
src/db/pool.js
Dispatch operations
- Load endpoints
src/modules/loads/loads.controller.js - Dispatch engine
src/modules/loads/dispatch.service.js - Load records
src/modules/loads/loads.repository.js - Load event history
src/modules/loadEvents/loadEvents.service.js - Posting refresh
src/jobs/dailyRefresh.js - Operations tick
src/modules/ops/ops.routes.js
Simulation capabilities
- Fleet management
src/modules/fleet - Compliance checks
src/modules/compliance - Finance and invoices
src/modules/finance - Live tracking
src/modules/tracking - Driver academy
src/modules/academy
Messaging
- Driver messaging
src/modules/driverChat/driverChat.service.js - Broker negotiation
src/modules/brokerChat/brokerChat.controller.js - Telegram bot
src/bot/index.js - Bot conversation state
src/bot/state.js
Other components
- API user
- Telegram
Connections 21
- API user → HTTP application: sends requests
- HTTP application → Authentication: routes auth
src/app.js - Authentication → Accounts and roles: reads and writes
src/modules/auth/auth.service.js - Authentication → Invite codes: redeems code
src/modules/auth/auth.service.js - Authentication → PostgreSQL pool: runs transaction
src/modules/auth/auth.service.js - HTTP application → Administration: routes admin
src/app.js - HTTP application → Load endpoints: routes loads
src/app.js - Load endpoints → Dispatch engine: calls dispatch
src/modules/loads/loads.controller.js - Load endpoints → Load event history: calls event service
src/modules/loads/loads.controller.js - Dispatch engine → Load records: uses repository
src/modules/loads/dispatch.service.js - Dispatch engine → Driver messaging: posts refusal
src/modules/loads/dispatch.service.js - HTTP application → Fleet management: routes fleet
src/app.js - HTTP application → Finance and invoices: routes finance
src/app.js - HTTP application → Broker negotiation: routes broker chat
src/app.js - HTTP application → Live tracking: routes tracking
src/app.js - HTTP application → Compliance checks: routes compliance
src/app.js - HTTP application → Driver academy: routes academy
src/app.js - Operations tick → Dispatch engine: runs tick
src/modules/ops/ops.routes.js - Operations tick → Posting refresh: runs refresh
src/modules/ops/ops.routes.js - Telegram bot → Bot conversation state: reads and writes
src/bot/index.js - Telegram bot → Telegram: polls and sends