# irfanabdul1108/linehaul_project_automation architecture

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

- Interactive diagram: https://gitdiagram.com/irfanabdul1108/linehaul_project_automation
- Repository: https://github.com/irfanabdul1108/linehaul_project_automation

## Overview

Linehaul is a warehouse-scoped freight planning and dispatch application. Operators select a warehouse, review orders and routes, assign orders manually or through recommendations and batch automation, then manage route resources and dispatch. The frontend also provides dashboard, driver/vehicle management, and a chat assistant. Backend subsystems are represented from the repository tree; their internal calls are not shown in the supplied excerpts, so those relationships are omitted.

Main entry points: [`frontend/src/App.jsx`](https://github.com/irfanabdul1108/linehaul_project_automation/blob/main/frontend/src/App.jsx) (App shell), [`backend/src/main/java/com/example/linehaul/controller`](https://github.com/irfanabdul1108/linehaul_project_automation/tree/main/backend/src/main/java/com/example/linehaul/controller) (REST controllers), [`frontend/src/services/api.js`](https://github.com/irfanabdul1108/linehaul_project_automation/blob/main/frontend/src/services/api.js) (API client), [`frontend/src/pages/Routes.jsx`](https://github.com/irfanabdul1108/linehaul_project_automation/blob/main/frontend/src/pages/Routes.jsx) (Route management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Operator app"]
  node_app["App shell<br/>[App.jsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.jsx]"]
  node_orders["Order management<br/>[Orders.jsx]"]
  node_resources["Fleet management<br/>[Drivers.jsx]"]
  node_chatui["Chat assistant<br/>[ChatAssistant.jsx]"]
end

subgraph group_workflow["Planning workflow"]
  node_routes["Route management<br/>[Routes.jsx]"]
  node_recommend["Smart assignment"]
  node_batch["Batch assignment"]
  node_automation["Assignment client<br/>[automation.js]"]
  node_routecheck["Lane validation<br/>[routeLane.js]"]
end

subgraph group_backend["Linehaul backend"]
  node_backendapi["REST controllers"]
  node_assignment["Assignment engine"]
  node_ai["AI advisor"]
  node_services["Domain services"]
  node_repositories["Data repositories"]
  node_database[("Linehaul data")]
end

subgraph group_support["Shared services"]
  node_warehouse["Warehouse scope<br/>[warehouse.js]"]
  node_chatclient["Chat client<br/>[chatService.js]"]
  node_api["API client<br/>[api.js]"]
end

node_operator(("Operator"))
node_gemini["Google Gemini"]

node_operator -->|"uses"| node_app
node_app -->|"checks scope"| node_warehouse
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_orders
node_app -->|"routes to"| node_routes
node_app -->|"routes to"| node_resources
node_app -->|"renders"| node_chatui
node_dashboard -->|"loads summary"| node_api
node_orders -->|"loads orders"| node_api
node_routes -->|"manages routes"| node_api
node_routes -->|"checks lane"| node_routecheck
node_dashboard -->|"opens assignment"| node_recommend
node_orders -->|"opens assignment"| node_recommend
node_routes -.->|"opens assignment"| node_recommend
node_recommend -->|"requests advice"| node_automation
node_batch -->|"assigns orders"| node_automation
node_chatui -->|"asks question"| node_chatclient
node_chatclient -->|"posts chat"| node_backendapi
node_api -->|"scopes requests"| node_warehouse
node_api -->|"calls REST endpoints"| node_backendapi
node_automation -.->|"calls automation endpoints"| node_backendapi
node_backendapi -.->|"delegates"| node_assignment
node_backendapi -.->|"delegates"| node_services
node_assignment -.->|"may consult"| node_ai
node_ai -.->|"requests advice"| node_gemini
node_services -.->|"uses"| node_repositories
node_repositories -.->|"reads and writes"| node_database

click node_app "https://github.com/irfanabdul1108/linehaul_project_automation/blob/main/frontend/src/App.jsx"
click node_warehouse "https://github.com/irfanabdul1108/linehaul_project_automation/blob/main/frontend/src/services/warehouse.js"
click node_dashboard "https://github.com/irfanabdul1108/linehaul_project_automation/blob/main/frontend/src/pages/Dashboard.jsx"
click node_orders "https://github.com/irfanabdul1108/linehaul_project_automation/blob/main/frontend/src/pages/Orders.jsx"
click node_routes "https://github.com/irfanabdul1108/linehaul_project_automation/blob/main/frontend/src/pages/Routes.jsx"
click node_resources "https://github.com/irfanabdul1108/linehaul_project_automation/blob/main/frontend/src/pages/Drivers.jsx"
click node_recommend "https://github.com/irfanabdul1108/linehaul_project_automation/blob/main/frontend/src/components/SmartAssignModal.jsx"
click node_batch "https://github.com/irfanabdul1108/linehaul_project_automation/blob/main/frontend/src/components/AutoAssignModal.jsx"
click node_automation "https://github.com/irfanabdul1108/linehaul_project_automation/blob/main/frontend/src/services/automation.js"
click node_routecheck "https://github.com/irfanabdul1108/linehaul_project_automation/blob/main/frontend/src/services/routeLane.js"
click node_chatui "https://github.com/irfanabdul1108/linehaul_project_automation/blob/main/frontend/src/components/ChatAssistant.jsx"
click node_chatclient "https://github.com/irfanabdul1108/linehaul_project_automation/blob/main/frontend/src/services/chatService.js"
click node_api "https://github.com/irfanabdul1108/linehaul_project_automation/blob/main/frontend/src/services/api.js"
click node_backendapi "https://github.com/irfanabdul1108/linehaul_project_automation/tree/main/backend/src/main/java/com/example/linehaul/controller"
click node_assignment "https://github.com/irfanabdul1108/linehaul_project_automation/tree/main/backend/src/main/java/com/example/linehaul/automation"
click node_ai "https://github.com/irfanabdul1108/linehaul_project_automation/tree/main/backend/src/main/java/com/example/linehaul/automation/ai"
click node_services "https://github.com/irfanabdul1108/linehaul_project_automation/tree/main/backend/src/main/java/com/example/linehaul/service"
click node_repositories "https://github.com/irfanabdul1108/linehaul_project_automation/tree/main/backend/src/main/java/com/example/linehaul/repository"

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_app,node_dashboard,node_orders,node_resources,node_chatui toneBlue
class node_routes,node_recommend,node_batch,node_automation,node_routecheck toneAmber
class node_backendapi,node_assignment,node_ai,node_services,node_repositories,node_database toneMint
class node_warehouse,node_chatclient,node_api toneRose
class node_operator,node_gemini toneIndigo
```

## Components

### Operator app

- [App shell](https://github.com/irfanabdul1108/linehaul_project_automation/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Dashboard](https://github.com/irfanabdul1108/linehaul_project_automation/blob/main/frontend/src/pages/Dashboard.jsx): `frontend/src/pages/Dashboard.jsx`
- [Order management](https://github.com/irfanabdul1108/linehaul_project_automation/blob/main/frontend/src/pages/Orders.jsx): `frontend/src/pages/Orders.jsx`
- [Fleet management](https://github.com/irfanabdul1108/linehaul_project_automation/blob/main/frontend/src/pages/Drivers.jsx): `frontend/src/pages/Drivers.jsx`
- [Chat assistant](https://github.com/irfanabdul1108/linehaul_project_automation/blob/main/frontend/src/components/ChatAssistant.jsx): `frontend/src/components/ChatAssistant.jsx`

### Planning workflow

- [Route management](https://github.com/irfanabdul1108/linehaul_project_automation/blob/main/frontend/src/pages/Routes.jsx): `frontend/src/pages/Routes.jsx`
- [Smart assignment](https://github.com/irfanabdul1108/linehaul_project_automation/blob/main/frontend/src/components/SmartAssignModal.jsx): `frontend/src/components/SmartAssignModal.jsx`
- [Batch assignment](https://github.com/irfanabdul1108/linehaul_project_automation/blob/main/frontend/src/components/AutoAssignModal.jsx): `frontend/src/components/AutoAssignModal.jsx`
- [Assignment client](https://github.com/irfanabdul1108/linehaul_project_automation/blob/main/frontend/src/services/automation.js): `frontend/src/services/automation.js`
- [Lane validation](https://github.com/irfanabdul1108/linehaul_project_automation/blob/main/frontend/src/services/routeLane.js): `frontend/src/services/routeLane.js`

### Linehaul backend

- [REST controllers](https://github.com/irfanabdul1108/linehaul_project_automation/tree/main/backend/src/main/java/com/example/linehaul/controller): `backend/src/main/java/com/example/linehaul/controller`
- [Assignment engine](https://github.com/irfanabdul1108/linehaul_project_automation/tree/main/backend/src/main/java/com/example/linehaul/automation): `backend/src/main/java/com/example/linehaul/automation`
- [AI advisor](https://github.com/irfanabdul1108/linehaul_project_automation/tree/main/backend/src/main/java/com/example/linehaul/automation/ai): `backend/src/main/java/com/example/linehaul/automation/ai`
- [Domain services](https://github.com/irfanabdul1108/linehaul_project_automation/tree/main/backend/src/main/java/com/example/linehaul/service): `backend/src/main/java/com/example/linehaul/service`
- [Data repositories](https://github.com/irfanabdul1108/linehaul_project_automation/tree/main/backend/src/main/java/com/example/linehaul/repository): `backend/src/main/java/com/example/linehaul/repository`
- **Linehaul data**

### Shared services

- [Warehouse scope](https://github.com/irfanabdul1108/linehaul_project_automation/blob/main/frontend/src/services/warehouse.js): `frontend/src/services/warehouse.js`
- [Chat client](https://github.com/irfanabdul1108/linehaul_project_automation/blob/main/frontend/src/services/chatService.js): `frontend/src/services/chatService.js`
- [API client](https://github.com/irfanabdul1108/linehaul_project_automation/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`

### Other components

- **Operator**
- **Google Gemini**

## Connections

- Operator → App shell: uses (evidence: `frontend/src/App.jsx`)
- App shell → Warehouse scope: checks scope (evidence: `frontend/src/App.jsx`)
- App shell → Dashboard: routes to (evidence: `frontend/src/App.jsx`)
- App shell → Order management: routes to (evidence: `frontend/src/App.jsx`)
- App shell → Route management: routes to (evidence: `frontend/src/App.jsx`)
- App shell → Fleet management: routes to (evidence: `frontend/src/App.jsx`)
- App shell → Chat assistant: renders (evidence: `frontend/src/App.jsx`)
- Dashboard → API client: loads summary (evidence: `frontend/src/pages/Dashboard.jsx`)
- Order management → API client: loads orders (evidence: `frontend/src/pages/Orders.jsx`)
- Route management → API client: manages routes (evidence: `frontend/src/pages/Routes.jsx`)
- Route management → Lane validation: checks lane (evidence: `frontend/src/pages/Routes.jsx`)
- Dashboard → Smart assignment: opens assignment (evidence: `frontend/src/pages/Dashboard.jsx`)
- Order management → Smart assignment: opens assignment (evidence: `frontend/src/pages/Orders.jsx`)
- Route management → Smart assignment: opens assignment (evidence: `frontend/src/pages/Routes.jsx`)
- Smart assignment → Assignment client: requests advice (evidence: `frontend/src/components/SmartAssignModal.jsx`)
- Batch assignment → Assignment client: assigns orders (evidence: `frontend/src/components/AutoAssignModal.jsx`)
- Chat assistant → Chat client: asks question (evidence: `frontend/src/components/ChatAssistant.jsx`)
- Chat client → REST controllers: posts chat (evidence: `frontend/src/services/chatService.js`)
- API client → Warehouse scope: scopes requests (evidence: `frontend/src/services/api.js`)
- API client → REST controllers: calls REST endpoints (evidence: `frontend/src/services/api.js`)
- Assignment client → REST controllers: calls automation endpoints
- REST controllers → Assignment engine: delegates
- REST controllers → Domain services: delegates
- Assignment engine → AI advisor: may consult
- AI advisor → Google Gemini: requests advice
- Domain services → Data repositories: uses
- Data repositories → Linehaul data: reads and writes
