# emoss08/trenova architecture

> Architecture diagram of the GitHub repository emoss08/trenova, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/emoss08/trenova
- Repository: https://github.com/emoss08/trenova

## Overview

Trenova is a self-hostable transportation management system for U.S. trucking carriers. Its principal order-to-cash workflow starts with shipment entry, proceeds through dispatch and rating, then billing, settlement, and accounting; compliance and document automation support that lifecycle. The repository also includes web and driver-dashboard clients, a Go TMS API, and integrations. The graph uses README-documented capabilities and relationships; sampled source confirms permission-engine and document-template responsibilities, but not their wiring to the broader API.

Main entry points: [`services/tms`](https://github.com/emoss08/trenova/tree/master/services/tms) (TMS API), [`client/apps/web/src/components/command-palette/palette-model.ts`](https://github.com/emoss08/trenova/blob/master/client/apps/web/src/components/command-palette/palette-model.ts) (Web client), [`client/apps/dash/src/router.tsx`](https://github.com/emoss08/trenova/blob/master/client/apps/dash/src/router.tsx) (Driver dashboard), [`services/tms/internal/core/ports/services/rateengine.go`](https://github.com/emoss08/trenova/blob/master/services/tms/internal/core/ports/services/rateengine.go) (Rating rules)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["User applications"]
  node_web["Web client<br/>[palette-model.ts]"]
  node_driver["Driver dashboard<br/>[router.tsx]"]
end

subgraph group_operations["Transportation operations"]
  node_shipment["Shipment entry"]
  node_dispatch["Dispatch planning"]
  node_rating["Rating rules<br/>[rateengine.go]"]
  node_compliance["Compliance records"]
  node_documents["Document automation<br/>[engine.go]"]
end

subgraph group_finance["Billing and finance"]
  node_billing["Billing and invoicing"]
  node_settlement["Driver settlement"]
  node_accounting["Accounting"]
end

subgraph group_platform["TMS platform"]
  node_api["TMS API"]
  node_permissions["Access permissions<br/>[engine.go]"]
  node_database[("PostgreSQL")]
  node_search[("Meilisearch search")]
  node_realtime[("Redis updates")]
end

subgraph group_integrations["Integrations"]
  node_edi["EDI partner workflows<br/>[server.go]"]
  node_telematics["Samsara telematics<br/>[client.go]"]
  node_pcmiler["PC*MILER routing<br/>[client.go]"]
  node_fmcsa["FMCSA services<br/>[client.go]"]
end

node_carrier(("Carrier staff"))

node_carrier -->|"uses"| node_web
node_carrier -->|"uses"| node_driver
node_web -->|"submits work"| node_api
node_driver -.->|"uses"| node_api
node_api -->|"supports entry"| node_shipment
node_shipment -->|"dispatches"| node_dispatch
node_dispatch -->|"rates loads"| node_rating
node_rating -->|"informs billing"| node_billing
node_billing -->|"supports pay"| node_settlement
node_settlement -->|"feeds accounting"| node_accounting
node_api -->|"persists records"| node_database
node_api -.->|"checks access"| node_permissions
node_api -.->|"renders templates"| node_documents
node_api -->|"manages records"| node_compliance
node_api -->|"supports search"| node_search
node_api -->|"publishes updates"| node_realtime
node_dispatch -->|"integrates fleet data"| node_telematics
node_dispatch -->|"uses routing"| node_pcmiler
node_compliance -.->|"checks compliance"| node_fmcsa
node_api -->|"supports EDI"| node_edi

click node_web "https://github.com/emoss08/trenova/blob/master/client/apps/web/src/components/command-palette/palette-model.ts"
click node_driver "https://github.com/emoss08/trenova/blob/master/client/apps/dash/src/router.tsx"
click node_api "https://github.com/emoss08/trenova/tree/master/services/tms"
click node_shipment "https://github.com/emoss08/trenova/tree/master/services/tms"
click node_dispatch "https://github.com/emoss08/trenova/tree/master/services/tms"
click node_rating "https://github.com/emoss08/trenova/blob/master/services/tms/internal/core/ports/services/rateengine.go"
click node_billing "https://github.com/emoss08/trenova/tree/master/services/tms"
click node_settlement "https://github.com/emoss08/trenova/tree/master/services/tms"
click node_accounting "https://github.com/emoss08/trenova/blob/master/client/apps/web/src/components/accounting/financial-report-section.tsx"
click node_compliance "https://github.com/emoss08/trenova/tree/master/services/tms"
click node_documents "https://github.com/emoss08/trenova/blob/master/services/tms/pkg/templateengine/engine.go"
click node_permissions "https://github.com/emoss08/trenova/blob/master/services/tms/internal/core/services/permission/engine.go"
click node_edi "https://github.com/emoss08/trenova/blob/master/services/edi-partner-sim/internal/sim/server.go"
click node_telematics "https://github.com/emoss08/trenova/blob/master/shared/samsara/client.go"
click node_pcmiler "https://github.com/emoss08/trenova/blob/master/shared/pcmiler/client.go"
click node_fmcsa "https://github.com/emoss08/trenova/blob/master/shared/fmcsa/client.go"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_web,node_driver toneBlue
class node_shipment,node_dispatch,node_rating,node_compliance,node_documents toneAmber
class node_billing,node_settlement,node_accounting toneMint
class node_api,node_permissions,node_database,node_search,node_realtime toneRose
class node_edi,node_telematics,node_pcmiler,node_fmcsa,node_carrier toneIndigo
```

## Components

### User applications

- [Web client](https://github.com/emoss08/trenova/blob/master/client/apps/web/src/components/command-palette/palette-model.ts): `client/apps/web/src/components/command-palette/palette-model.ts`
- [Driver dashboard](https://github.com/emoss08/trenova/blob/master/client/apps/dash/src/router.tsx): `client/apps/dash/src/router.tsx`

### Transportation operations

- [Shipment entry](https://github.com/emoss08/trenova/tree/master/services/tms): `services/tms`
- [Dispatch planning](https://github.com/emoss08/trenova/tree/master/services/tms): `services/tms`
- [Rating rules](https://github.com/emoss08/trenova/blob/master/services/tms/internal/core/ports/services/rateengine.go): `services/tms/internal/core/ports/services/rateengine.go`
- [Compliance records](https://github.com/emoss08/trenova/tree/master/services/tms): `services/tms`
- [Document automation](https://github.com/emoss08/trenova/blob/master/services/tms/pkg/templateengine/engine.go): `services/tms/pkg/templateengine/engine.go`

### Billing and finance

- [Billing and invoicing](https://github.com/emoss08/trenova/tree/master/services/tms): `services/tms`
- [Driver settlement](https://github.com/emoss08/trenova/tree/master/services/tms): `services/tms`
- [Accounting](https://github.com/emoss08/trenova/blob/master/client/apps/web/src/components/accounting/financial-report-section.tsx): `client/apps/web/src/components/accounting/financial-report-section.tsx`

### TMS platform

- [TMS API](https://github.com/emoss08/trenova/tree/master/services/tms): `services/tms`
- [Access permissions](https://github.com/emoss08/trenova/blob/master/services/tms/internal/core/services/permission/engine.go): `services/tms/internal/core/services/permission/engine.go`
- **PostgreSQL**
- **Meilisearch search**
- **Redis updates**

### Integrations

- [EDI partner workflows](https://github.com/emoss08/trenova/blob/master/services/edi-partner-sim/internal/sim/server.go): `services/edi-partner-sim/internal/sim/server.go`
- [Samsara telematics](https://github.com/emoss08/trenova/blob/master/shared/samsara/client.go): `shared/samsara/client.go`
- [PC*MILER routing](https://github.com/emoss08/trenova/blob/master/shared/pcmiler/client.go): `shared/pcmiler/client.go`
- [FMCSA services](https://github.com/emoss08/trenova/blob/master/shared/fmcsa/client.go): `shared/fmcsa/client.go`

### Other components

- **Carrier staff**

## Connections

- Carrier staff → Web client: uses (evidence: `README.md`)
- Carrier staff → Driver dashboard: uses (evidence: `README.md`)
- Web client → TMS API: submits work (evidence: `README.md`)
- Driver dashboard → TMS API: uses
- TMS API → Shipment entry: supports entry (evidence: `README.md`)
- Shipment entry → Dispatch planning: dispatches (evidence: `README.md`)
- Dispatch planning → Rating rules: rates loads (evidence: `README.md`)
- Rating rules → Billing and invoicing: informs billing (evidence: `README.md`)
- Billing and invoicing → Driver settlement: supports pay (evidence: `README.md`)
- Driver settlement → Accounting: feeds accounting (evidence: `README.md`)
- TMS API → PostgreSQL: persists records (evidence: `README.md`)
- TMS API → Access permissions: checks access
- TMS API → Document automation: renders templates
- TMS API → Compliance records: manages records (evidence: `README.md`)
- TMS API → Meilisearch search: supports search (evidence: `README.md`)
- TMS API → Redis updates: publishes updates (evidence: `README.md`)
- Dispatch planning → Samsara telematics: integrates fleet data (evidence: `README.md`)
- Dispatch planning → PC*MILER routing: uses routing (evidence: `README.md`)
- Compliance records → FMCSA services: checks compliance
- TMS API → EDI partner workflows: supports EDI (evidence: `README.md`)
