# aashutoshsusare/-transitpilot architecture

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

- Interactive diagram: https://gitdiagram.com/aashutoshsusare/-transitpilot
- Repository: https://github.com/aashutoshsusare/-transitpilot

## Overview

TransitPilot is a supply-disruption planning copilot: it ingests public signals, identifies threatened shipments and inventory, evaluates response options, then presents proposals for planner approval. The README documents the domain stages and major UI capabilities; sampled source confirms the offline reference pipeline and parts of the live-ingestion, API, and route-planning paths. AgentMesh execution and some unsampled subsystems are represented only where documented; dashed edges mark optional or unverified integration.

Main entry points: [`backend/workflows/pipelines/reference_pipeline.py`](https://github.com/aashutoshsusare/-transitpilot/blob/main/backend/workflows/pipelines/reference_pipeline.py) (Offline reference pipeline), [`backend/api/app.py`](https://github.com/aashutoshsusare/-transitpilot/blob/main/backend/api/app.py) (HTTP API), [`backend/services/web_service.py`](https://github.com/aashutoshsusare/-transitpilot/blob/main/backend/services/web_service.py) (Shared web service), [`backend/db/postgres/pg_store.py`](https://github.com/aashutoshsusare/-transitpilot/blob/main/backend/db/postgres/pg_store.py) (PostgreSQL store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Planner experience"]
  node_frontend["TransitPilot UI<br/>[App.jsx]"]
  node_routes["Route planner screen<br/>[RoutesPage.jsx]"]
  node_api_client["API client<br/>[api.js]"]
end

subgraph group_api["Application services"]
  node_api_server["HTTP API<br/>[app.py]"]
  node_web_service["Shared web service<br/>[web_service.py]"]
  node_engine["Case engine<br/>[engine.py]"]
  node_settings["Runtime settings<br/>[settings.py]"]
end

subgraph group_signals["Signal and data"]
  node_postgres[("PostgreSQL store<br/>[pg_store.py]")]
  node_live_ingest["Live hazard ingestion<br/>[live_ingest.py]"]
  node_news_ingest["News ingestion<br/>[news_ingest.py]"]
  node_public_feeds(("Public data feeds"))
  node_network_generator["Synthetic network data<br/>[generate.py]"]
end

subgraph group_decision["Disruption decisions"]
  node_reference_pipeline["Offline reference pipeline"]
  node_signal_check["Signal confirmation<br/>[signals.py]"]
  node_exposure["Shipment exposure<br/>[geo.py]"]
  node_impact["Inventory impact<br/>[impact.py]"]
  node_mitigation["Route options<br/>[route_planner.py]"]
  node_actions["Approval actions<br/>[actions.py]"]
end

subgraph group_runtime["Agent runtime"]
  node_planner_agent["Intent planner<br/>[planner.py]"]
  node_langgraph["LangGraph orchestration<br/>[orchestration.py]"]
  node_llm["Azure OpenAI<br/>[azure_openai.py]"]
end

node_planner(("Supply planner"))

node_planner -->|"uses"| node_frontend
node_frontend -->|"routes to"| node_routes
node_routes -->|"requests through"| node_api_client
node_api_client -->|"calls"| node_api_server
node_api_server -->|"delegates to"| node_web_service
node_web_service -->|"uses"| node_engine
node_engine -->|"runs cases with"| node_reference_pipeline
node_reference_pipeline -->|"plans intent with"| node_planner_agent
node_reference_pipeline -->|"counts sources with"| node_signal_check
node_reference_pipeline -->|"matches geography with"| node_exposure
node_reference_pipeline -->|"calculates risk with"| node_impact
node_reference_pipeline -->|"prices fixes with"| node_mitigation
node_reference_pipeline -->|"proposes actions with"| node_actions
node_planner -->|"approves proposal"| node_actions
node_public_feeds -->|"provides signals"| node_live_ingest
node_public_feeds -->|"provides news events"| node_news_ingest
node_live_ingest -->|"stores hazards"| node_postgres
node_news_ingest -->|"stores events"| node_postgres
node_network_generator -->|"loads seed data"| node_postgres
node_web_service -.->|"selects optional backend"| node_langgraph
node_langgraph -->|"calls model"| node_llm
node_api_server -->|"configures server"| node_settings

click node_frontend "https://github.com/aashutoshsusare/-transitpilot/blob/main/frontend/src/App.jsx"
click node_routes "https://github.com/aashutoshsusare/-transitpilot/blob/main/frontend/src/pages/RoutesPage.jsx"
click node_api_client "https://github.com/aashutoshsusare/-transitpilot/blob/main/frontend/src/services/api.js"
click node_api_server "https://github.com/aashutoshsusare/-transitpilot/blob/main/backend/api/app.py"
click node_web_service "https://github.com/aashutoshsusare/-transitpilot/blob/main/backend/services/web_service.py"
click node_engine "https://github.com/aashutoshsusare/-transitpilot/blob/main/backend/services/engine.py"
click node_postgres "https://github.com/aashutoshsusare/-transitpilot/blob/main/backend/db/postgres/pg_store.py"
click node_live_ingest "https://github.com/aashutoshsusare/-transitpilot/blob/main/backend/workflows/pipelines/live_ingest.py"
click node_news_ingest "https://github.com/aashutoshsusare/-transitpilot/blob/main/backend/workflows/pipelines/news_ingest.py"
click node_reference_pipeline "https://github.com/aashutoshsusare/-transitpilot/blob/main/backend/workflows/pipelines/reference_pipeline.py"
click node_planner_agent "https://github.com/aashutoshsusare/-transitpilot/blob/main/backend/agents/orchestrator/planner.py"
click node_signal_check "https://github.com/aashutoshsusare/-transitpilot/blob/main/backend/tools/custom_code/signals.py"
click node_exposure "https://github.com/aashutoshsusare/-transitpilot/blob/main/backend/tools/custom_code/geo.py"
click node_impact "https://github.com/aashutoshsusare/-transitpilot/blob/main/backend/tools/custom_code/impact.py"
click node_mitigation "https://github.com/aashutoshsusare/-transitpilot/blob/main/backend/tools/custom_code/route_planner.py"
click node_actions "https://github.com/aashutoshsusare/-transitpilot/blob/main/backend/tools/custom_code/actions.py"
click node_langgraph "https://github.com/aashutoshsusare/-transitpilot/blob/main/backend/workflows/langgraph/orchestration.py"
click node_llm "https://github.com/aashutoshsusare/-transitpilot/blob/main/backend/llm/openai/azure_openai.py"
click node_settings "https://github.com/aashutoshsusare/-transitpilot/blob/main/backend/config/settings.py"
click node_network_generator "https://github.com/aashutoshsusare/-transitpilot/blob/main/backend/workflows/pipelines/generate.py"

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_frontend,node_routes,node_api_client toneBlue
class node_api_server,node_web_service,node_engine,node_settings toneAmber
class node_postgres,node_live_ingest,node_news_ingest,node_public_feeds,node_network_generator toneMint
class node_reference_pipeline,node_signal_check,node_exposure,node_impact,node_mitigation,node_actions toneRose
class node_planner_agent,node_langgraph,node_llm,node_planner toneIndigo
```

## Components

### Planner experience

- [TransitPilot UI](https://github.com/aashutoshsusare/-transitpilot/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Route planner screen](https://github.com/aashutoshsusare/-transitpilot/blob/main/frontend/src/pages/RoutesPage.jsx): `frontend/src/pages/RoutesPage.jsx`
- [API client](https://github.com/aashutoshsusare/-transitpilot/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`

### Application services

- [HTTP API](https://github.com/aashutoshsusare/-transitpilot/blob/main/backend/api/app.py): `backend/api/app.py`
- [Shared web service](https://github.com/aashutoshsusare/-transitpilot/blob/main/backend/services/web_service.py): `backend/services/web_service.py`
- [Case engine](https://github.com/aashutoshsusare/-transitpilot/blob/main/backend/services/engine.py): `backend/services/engine.py`
- [Runtime settings](https://github.com/aashutoshsusare/-transitpilot/blob/main/backend/config/settings.py): `backend/config/settings.py`

### Signal and data

- [PostgreSQL store](https://github.com/aashutoshsusare/-transitpilot/blob/main/backend/db/postgres/pg_store.py): `backend/db/postgres/pg_store.py`
- [Live hazard ingestion](https://github.com/aashutoshsusare/-transitpilot/blob/main/backend/workflows/pipelines/live_ingest.py): `backend/workflows/pipelines/live_ingest.py`
- [News ingestion](https://github.com/aashutoshsusare/-transitpilot/blob/main/backend/workflows/pipelines/news_ingest.py): `backend/workflows/pipelines/news_ingest.py`
- **Public data feeds**
- [Synthetic network data](https://github.com/aashutoshsusare/-transitpilot/blob/main/backend/workflows/pipelines/generate.py): `backend/workflows/pipelines/generate.py`

### Disruption decisions

- [Offline reference pipeline](https://github.com/aashutoshsusare/-transitpilot/blob/main/backend/workflows/pipelines/reference_pipeline.py): `backend/workflows/pipelines/reference_pipeline.py`
- [Signal confirmation](https://github.com/aashutoshsusare/-transitpilot/blob/main/backend/tools/custom_code/signals.py): `backend/tools/custom_code/signals.py`
- [Shipment exposure](https://github.com/aashutoshsusare/-transitpilot/blob/main/backend/tools/custom_code/geo.py): `backend/tools/custom_code/geo.py`
- [Inventory impact](https://github.com/aashutoshsusare/-transitpilot/blob/main/backend/tools/custom_code/impact.py): `backend/tools/custom_code/impact.py`
- [Route options](https://github.com/aashutoshsusare/-transitpilot/blob/main/backend/tools/custom_code/route_planner.py): `backend/tools/custom_code/route_planner.py`
- [Approval actions](https://github.com/aashutoshsusare/-transitpilot/blob/main/backend/tools/custom_code/actions.py): `backend/tools/custom_code/actions.py`

### Agent runtime

- [Intent planner](https://github.com/aashutoshsusare/-transitpilot/blob/main/backend/agents/orchestrator/planner.py): `backend/agents/orchestrator/planner.py`
- [LangGraph orchestration](https://github.com/aashutoshsusare/-transitpilot/blob/main/backend/workflows/langgraph/orchestration.py): `backend/workflows/langgraph/orchestration.py`
- [Azure OpenAI](https://github.com/aashutoshsusare/-transitpilot/blob/main/backend/llm/openai/azure_openai.py): `backend/llm/openai/azure_openai.py`

### Other components

- **Supply planner**

## Connections

- Supply planner → TransitPilot UI: uses (evidence: `README.md`)
- TransitPilot UI → Route planner screen: routes to (evidence: `frontend/src/App.jsx`)
- Route planner screen → API client: requests through (evidence: `frontend/src/pages/RoutesPage.jsx`)
- API client → HTTP API: calls (evidence: `README.md`)
- HTTP API → Shared web service: delegates to (evidence: `backend/api/app.py`)
- Shared web service → Case engine: uses (evidence: `backend/services/web_service.py`)
- Case engine → Offline reference pipeline: runs cases with (evidence: `backend/services/engine.py`)
- Offline reference pipeline → Intent planner: plans intent with (evidence: `backend/workflows/pipelines/reference_pipeline.py`)
- Offline reference pipeline → Signal confirmation: counts sources with (evidence: `backend/workflows/pipelines/reference_pipeline.py`)
- Offline reference pipeline → Shipment exposure: matches geography with (evidence: `backend/workflows/pipelines/reference_pipeline.py`)
- Offline reference pipeline → Inventory impact: calculates risk with (evidence: `README.md`)
- Offline reference pipeline → Route options: prices fixes with (evidence: `README.md`)
- Offline reference pipeline → Approval actions: proposes actions with (evidence: `README.md`)
- Supply planner → Approval actions: approves proposal (evidence: `README.md`)
- Public data feeds → Live hazard ingestion: provides signals (evidence: `backend/workflows/pipelines/live_ingest.py`)
- Public data feeds → News ingestion: provides news events (evidence: `backend/workflows/pipelines/news_ingest.py`)
- Live hazard ingestion → PostgreSQL store: stores hazards (evidence: `backend/workflows/pipelines/live_ingest.py`)
- News ingestion → PostgreSQL store: stores events (evidence: `backend/workflows/pipelines/news_ingest.py`)
- Synthetic network data → PostgreSQL store: loads seed data (evidence: `backend/db/postgres/pg_store.py`)
- Shared web service → LangGraph orchestration: selects optional backend
- LangGraph orchestration → Azure OpenAI: calls model (evidence: `backend/workflows/langgraph/orchestration.py`)
- HTTP API → Runtime settings: configures server (evidence: `backend/api/app.py`)
