# tathack-tathva/supply-chainer architecture

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

- Interactive diagram: https://gitdiagram.com/tathack-tathva/supply-chainer
- Repository: https://github.com/tathack-tathva/supply-chainer

## Overview

Supplychainer is a multimodal supply-chain routing and risk-assessment platform with a React command dashboard and FastAPI backend. A user submits route criteria and an optional disruption scenario; the backend resolves locations, evaluates multimodal routes, gathers news, filters it for mode relevance, and scores risk for route recommendations. A separate supplier-intelligence workflow ranks suppliers against disruptions and inventory needs. The README documents these live capabilities; sampled excerpts do not expose every internal call, so uncertain wiring is omitted.

Main entry points: [`backend/main.py`](https://github.com/tathack-tathva/supply-chainer/blob/main/backend/main.py) (FastAPI service), [`backend/engine/route_recommender.py`](https://github.com/tathack-tathva/supply-chainer/blob/main/backend/engine/route_recommender.py) (Route recommender), [`frontend/src/App.jsx`](https://github.com/tathack-tathva/supply-chainer/blob/main/frontend/src/App.jsx) (Dashboard views), [`frontend/src/RouteRecommender.jsx`](https://github.com/tathack-tathva/supply-chainer/blob/main/frontend/src/RouteRecommender.jsx) (Route controls)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Command dashboard"]
  node_dashboard["Dashboard views<br/>[App.jsx]"]
  node_route_ui["Route controls"]
  node_supplier_ui["Supplier audit"]
  node_benchmark_ui["Benchmark charts"]
end

subgraph group_api["API orchestration"]
  node_api["FastAPI service<br/>[main.py]"]
end

subgraph group_routing["Routing and risk"]
  node_recommender["Route recommender"]
  node_network["Multimodal network"]
  node_resolver["Hub resolver<br/>[node_resolver.py]"]
  node_risk["Threat and risk model"]
end

subgraph group_intelligence["Operational intelligence"]
  node_news["News ingestion<br/>[news_ingestion.py]"]
  node_scenario["Scenario manager"]
  node_suppliers["Supplier scorer<br/>[supplier_scorer.py]"]
end

node_user(("Logistics user"))
node_rss["Google News RSS"]

node_user -->|"sets route criteria"| node_route_ui
node_user -->|"requests supplier audit"| node_supplier_ui
node_dashboard -->|"selects view"| node_route_ui
node_dashboard -->|"selects view"| node_supplier_ui
node_dashboard -->|"selects view"| node_benchmark_ui
node_dashboard -->|"fetches network"| node_api
node_dashboard -->|"opens status socket"| node_api
node_route_ui -->|"posts recommendation"| node_api
node_api -->|"requests routes"| node_recommender
node_recommender -->|"resolves endpoints"| node_resolver
node_recommender -->|"routes on graph"| node_network
node_recommender -->|"assesses route risk"| node_risk
node_risk -->|"requests news"| node_news
node_news -.->|"fetches headlines"| node_rss
node_recommender -->|"applies scenario"| node_scenario
node_recommender -->|"returns recommendations"| node_api
node_api -->|"returns routes"| node_route_ui
node_supplier_ui -->|"posts sourcing request"| node_api
node_api -->|"gets disruptions"| node_scenario
node_api -->|"ranks suppliers and advises"| node_suppliers
node_api -->|"returns supplier results"| node_supplier_ui
node_api -->|"streams status"| node_dashboard

click node_dashboard "https://github.com/tathack-tathva/supply-chainer/blob/main/frontend/src/App.jsx"
click node_route_ui "https://github.com/tathack-tathva/supply-chainer/blob/main/frontend/src/RouteRecommender.jsx"
click node_supplier_ui "https://github.com/tathack-tathva/supply-chainer/blob/main/frontend/src/SupplierIntelligence.jsx"
click node_benchmark_ui "https://github.com/tathack-tathva/supply-chainer/blob/main/frontend/src/BenchmarkCharts.jsx"
click node_api "https://github.com/tathack-tathva/supply-chainer/blob/main/backend/main.py"
click node_recommender "https://github.com/tathack-tathva/supply-chainer/blob/main/backend/engine/route_recommender.py"
click node_network "https://github.com/tathack-tathva/supply-chainer/blob/main/backend/engine/multimodal_network.py"
click node_resolver "https://github.com/tathack-tathva/supply-chainer/blob/main/backend/engine/node_resolver.py"
click node_risk "https://github.com/tathack-tathva/supply-chainer/blob/main/backend/engine/threat_intelligence.py"
click node_news "https://github.com/tathack-tathva/supply-chainer/blob/main/backend/engine/news_ingestion.py"
click node_scenario "https://github.com/tathack-tathva/supply-chainer/blob/main/backend/engine/scenario_manager.py"
click node_suppliers "https://github.com/tathack-tathva/supply-chainer/blob/main/backend/engine/supplier_scorer.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_dashboard,node_route_ui,node_supplier_ui,node_benchmark_ui,node_user toneBlue
class node_api toneAmber
class node_recommender,node_network,node_resolver,node_risk toneMint
class node_news,node_scenario,node_suppliers toneRose
class node_rss toneIndigo
```

## Components

### Command dashboard

- [Dashboard views](https://github.com/tathack-tathva/supply-chainer/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Route controls](https://github.com/tathack-tathva/supply-chainer/blob/main/frontend/src/RouteRecommender.jsx): `frontend/src/RouteRecommender.jsx`
- [Supplier audit](https://github.com/tathack-tathva/supply-chainer/blob/main/frontend/src/SupplierIntelligence.jsx): `frontend/src/SupplierIntelligence.jsx`
- [Benchmark charts](https://github.com/tathack-tathva/supply-chainer/blob/main/frontend/src/BenchmarkCharts.jsx): `frontend/src/BenchmarkCharts.jsx`

### API orchestration

- [FastAPI service](https://github.com/tathack-tathva/supply-chainer/blob/main/backend/main.py): `backend/main.py`

### Routing and risk

- [Route recommender](https://github.com/tathack-tathva/supply-chainer/blob/main/backend/engine/route_recommender.py): `backend/engine/route_recommender.py`
- [Multimodal network](https://github.com/tathack-tathva/supply-chainer/blob/main/backend/engine/multimodal_network.py): `backend/engine/multimodal_network.py`
- [Hub resolver](https://github.com/tathack-tathva/supply-chainer/blob/main/backend/engine/node_resolver.py): `backend/engine/node_resolver.py`
- [Threat and risk model](https://github.com/tathack-tathva/supply-chainer/blob/main/backend/engine/threat_intelligence.py): `backend/engine/threat_intelligence.py`

### Operational intelligence

- [News ingestion](https://github.com/tathack-tathva/supply-chainer/blob/main/backend/engine/news_ingestion.py): `backend/engine/news_ingestion.py`
- [Scenario manager](https://github.com/tathack-tathva/supply-chainer/blob/main/backend/engine/scenario_manager.py): `backend/engine/scenario_manager.py`
- [Supplier scorer](https://github.com/tathack-tathva/supply-chainer/blob/main/backend/engine/supplier_scorer.py): `backend/engine/supplier_scorer.py`

### Other components

- **Logistics user**
- **Google News RSS**

## Connections

- Logistics user → Route controls: sets route criteria
- Logistics user → Supplier audit: requests supplier audit
- Dashboard views → Route controls: selects view
- Dashboard views → Supplier audit: selects view
- Dashboard views → Benchmark charts: selects view
- Dashboard views → FastAPI service: fetches network
- Dashboard views → FastAPI service: opens status socket
- Route controls → FastAPI service: posts recommendation
- FastAPI service → Route recommender: requests routes
- Route recommender → Hub resolver: resolves endpoints
- Route recommender → Multimodal network: routes on graph
- Route recommender → Threat and risk model: assesses route risk
- Threat and risk model → News ingestion: requests news
- News ingestion → Google News RSS: fetches headlines
- Route recommender → Scenario manager: applies scenario
- Route recommender → FastAPI service: returns recommendations
- FastAPI service → Route controls: returns routes
- Supplier audit → FastAPI service: posts sourcing request
- FastAPI service → Scenario manager: gets disruptions
- FastAPI service → Supplier scorer: ranks suppliers and advises
- FastAPI service → Supplier audit: returns supplier results
- FastAPI service → Dashboard views: streams status
