# abhishek-m-s-05/cascade-salvage-freshroute architecture

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

- Interactive diagram: https://gitdiagram.com/abhishek-m-s-05/cascade-salvage-freshroute
- Repository: https://github.com/abhishek-m-s-05/cascade-salvage-freshroute

## Overview

Cascade Salvage is a perishable-produce allocation and recovery decision-support app. A user views the browser dashboard, which requests current data or an optimization/disruption run from the API; the API loads sample inventory, destinations, and routes, invokes the optimizer, and returns allocation and impact metrics for display. The optimizer includes baseline comparison, shelf-life feasibility, tiered allocation, and disruption handling. The README is empty, and the frontend excerpt does not show endpoint configuration or all result views, so those API links are marked unverified.

Main entry points: [`backend/main.py`](https://github.com/abhishek-m-s-05/cascade-salvage-freshroute/blob/main/backend/main.py) (HTTP API), [`engine/optimizer.py`](https://github.com/abhishek-m-s-05/cascade-salvage-freshroute/blob/main/engine/optimizer.py) (Cascade allocation), [`frontend/app.js`](https://github.com/abhishek-m-s-05/cascade-salvage-freshroute/blob/main/frontend/app.js) (Dashboard), [`data`](https://github.com/abhishek-m-s-05/cascade-salvage-freshroute/tree/main/data) (Scenario data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Browser experience"]
  node_dashboard["Dashboard<br/>[app.js]"]
end

subgraph group_api["API and data"]
  node_api_service["HTTP API<br/>[main.py]"]
  node_api_stats["Summary statistics<br/>[main.py]"]
end

subgraph group_engine["Allocation engine"]
  node_optimizer["Cascade allocation<br/>[optimizer.py]"]
  node_baseline["Baseline model<br/>[optimizer.py]"]
  node_feasibility["Feasibility and tiers<br/>[optimizer.py]"]
  node_disruption["Disruption scenarios<br/>[optimizer.py]"]
end

subgraph group_inputs["Scenario inputs"]
  node_sample_data[("Scenario data")]
end

node_user(("Operator"))

node_user -->|"uses"| node_dashboard
node_dashboard -.->|"requests runs"| node_api_service
node_api_service -.->|"returns results"| node_dashboard
node_api_service -->|"loads inputs"| node_sample_data
node_api_service -->|"runs optimization"| node_optimizer
node_api_service -->|"simulates disruption"| node_optimizer
node_optimizer -->|"checks candidates"| node_feasibility
node_optimizer -->|"compares baseline"| node_baseline
node_disruption -->|"reruns allocation"| node_optimizer
node_api_service -->|"serves summary"| node_api_stats

click node_dashboard "https://github.com/abhishek-m-s-05/cascade-salvage-freshroute/blob/main/frontend/app.js"
click node_api_service "https://github.com/abhishek-m-s-05/cascade-salvage-freshroute/blob/main/backend/main.py"
click node_sample_data "https://github.com/abhishek-m-s-05/cascade-salvage-freshroute/tree/main/data"
click node_optimizer "https://github.com/abhishek-m-s-05/cascade-salvage-freshroute/blob/main/engine/optimizer.py"
click node_baseline "https://github.com/abhishek-m-s-05/cascade-salvage-freshroute/blob/main/engine/optimizer.py"
click node_feasibility "https://github.com/abhishek-m-s-05/cascade-salvage-freshroute/blob/main/engine/optimizer.py"
click node_disruption "https://github.com/abhishek-m-s-05/cascade-salvage-freshroute/blob/main/engine/optimizer.py"
click node_api_stats "https://github.com/abhishek-m-s-05/cascade-salvage-freshroute/blob/main/backend/main.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 toneBlue
class node_api_service,node_api_stats toneAmber
class node_optimizer,node_baseline,node_feasibility,node_disruption toneMint
class node_sample_data toneRose
class node_user toneIndigo
```

## Components

### Browser experience

- [Dashboard](https://github.com/abhishek-m-s-05/cascade-salvage-freshroute/blob/main/frontend/app.js): `frontend/app.js`

### API and data

- [HTTP API](https://github.com/abhishek-m-s-05/cascade-salvage-freshroute/blob/main/backend/main.py): `backend/main.py`
- [Summary statistics](https://github.com/abhishek-m-s-05/cascade-salvage-freshroute/blob/main/backend/main.py): `backend/main.py`

### Allocation engine

- [Cascade allocation](https://github.com/abhishek-m-s-05/cascade-salvage-freshroute/blob/main/engine/optimizer.py): `engine/optimizer.py`
- [Baseline model](https://github.com/abhishek-m-s-05/cascade-salvage-freshroute/blob/main/engine/optimizer.py): `engine/optimizer.py`
- [Feasibility and tiers](https://github.com/abhishek-m-s-05/cascade-salvage-freshroute/blob/main/engine/optimizer.py): `engine/optimizer.py`
- [Disruption scenarios](https://github.com/abhishek-m-s-05/cascade-salvage-freshroute/blob/main/engine/optimizer.py): `engine/optimizer.py`

### Scenario inputs

- [Scenario data](https://github.com/abhishek-m-s-05/cascade-salvage-freshroute/tree/main/data): `data`

### Other components

- **Operator**

## Connections

- Operator → Dashboard: uses (evidence: `frontend/app.js`)
- Dashboard → HTTP API: requests runs
- HTTP API → Dashboard: returns results
- HTTP API → Scenario data: loads inputs (evidence: `backend/main.py`)
- HTTP API → Cascade allocation: runs optimization (evidence: `backend/main.py`)
- HTTP API → Cascade allocation: simulates disruption (evidence: `backend/main.py`)
- Cascade allocation → Feasibility and tiers: checks candidates (evidence: `engine/optimizer.py`)
- Cascade allocation → Baseline model: compares baseline (evidence: `engine/optimizer.py`)
- Disruption scenarios → Cascade allocation: reruns allocation (evidence: `engine/optimizer.py`)
- HTTP API → Summary statistics: serves summary (evidence: `backend/main.py`)
