# rishu07368/logistics-platform architecture

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

- Interactive diagram: https://gitdiagram.com/rishu07368/logistics-platform
- Repository: https://github.com/rishu07368/logistics-platform

## Overview

This logistics network planner lets users manage transport networks and inspect routes by cost, distance, or time. The backend serves a browser interface and exposes APIs for network editing, graph analysis, route calculation, algorithm comparison, and benchmarks. Route requests pass through the API and routing service, which loads graph data, selects a shortest-path algorithm, and records run results. The tree and excerpts establish the backend flow, but do not show frontend-to-API calls; those links are omitted. The frontend's mapping and chart modules are retained as documented-by-tree capabilities, without inferred connections.

Main entry points: [`logistics-platform/backend/services/graph.py`](https://github.com/rishu07368/logistics-platform/blob/main/logistics-platform/backend/services/graph.py) (Graph loading and dispatch), [`logistics-platform/backend/db/repository.py`](https://github.com/rishu07368/logistics-platform/blob/main/logistics-platform/backend/db/repository.py) (Data repository), [`logistics-platform/backend/routes/api.py`](https://github.com/rishu07368/logistics-platform/blob/main/logistics-platform/backend/routes/api.py) (API endpoints), [`logistics-platform/backend/data/seed.py`](https://github.com/rishu07368/logistics-platform/blob/main/logistics-platform/backend/data/seed.py) (Built-in scenarios)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Browser interface"]
  node_webapp["Web interface<br/>[app.js]"]
  node_map["Network map<br/>[map.js]"]
  node_charts["Analytics charts<br/>[charts.js]"]
end

subgraph group_api["HTTP API"]
  node_api_server["Flask app<br/>[app.py]"]
  node_endpoints["API endpoints<br/>[api.py]"]
end

subgraph group_domain["Network and routing"]
  node_network_ops["Network management<br/>[network.py]"]
  node_route_ops["Routing and benchmarks<br/>[routing.py]"]
  node_analytics["Network analytics<br/>[analytics.py]"]
end

subgraph group_internals["Graph algorithms and storage"]
  node_graph["Graph loading and dispatch<br/>[graph.py]"]
  node_analysis["Graph properties and recommendations<br/>[analysis.py]"]
  node_dijkstra["Dijkstra<br/>[dijkstra.py]"]
  node_bellman_ford["Bellman-Ford<br/>[bellman_ford.py]"]
  node_algorithm_common["Algorithm result types<br/>[common.py]"]
  node_generator["Network generators<br/>[generators.py]"]
  node_seed["Built-in scenarios<br/>[seed.py]"]
  node_repository["Data repository<br/>[repository.py]"]
  node_sqlite[("SQLite database<br/>[database.py]")]
end

node_user(("Planner"))

node_user -.->|"uses"| node_webapp
node_api_server -->|"serves"| node_webapp
node_api_server -->|"initializes"| node_sqlite
node_api_server -->|"seeds"| node_seed
node_api_server -->|"registers"| node_endpoints
node_endpoints -->|"delegates"| node_network_ops
node_endpoints -->|"delegates"| node_route_ops
node_endpoints -->|"delegates"| node_analytics
node_endpoints -->|"loads"| node_graph
node_endpoints -->|"queries"| node_repository
node_route_ops -->|"loads and dispatches"| node_graph
node_route_ops -->|"logs runs"| node_repository
node_route_ops -->|"generates benchmark graphs"| node_generator
node_network_ops -->|"manages records"| node_repository
node_network_ops -->|"generates networks"| node_generator
node_network_ops -->|"uses scenarios"| node_seed
node_analytics -->|"analyzes"| node_graph
node_analytics -->|"reads run data"| node_repository
node_graph -->|"loads network data"| node_repository
node_graph -->|"analyzes properties"| node_analysis
node_graph -->|"dispatches"| node_dijkstra
node_graph -->|"dispatches"| node_bellman_ford
node_analysis -->|"checks negative cycles"| node_bellman_ford
node_dijkstra -->|"uses shared types"| node_algorithm_common
node_bellman_ford -->|"uses shared types"| node_algorithm_common
node_seed -->|"loads scenarios"| node_repository
node_seed -->|"builds networks"| node_generator
node_seed -->|"computes properties"| node_analysis
node_repository -->|"executes SQL"| node_sqlite

click node_webapp "https://github.com/rishu07368/logistics-platform/blob/main/logistics-platform/frontend/js/app.js"
click node_map "https://github.com/rishu07368/logistics-platform/blob/main/logistics-platform/frontend/js/map.js"
click node_charts "https://github.com/rishu07368/logistics-platform/blob/main/logistics-platform/frontend/js/charts.js"
click node_api_server "https://github.com/rishu07368/logistics-platform/blob/main/logistics-platform/backend/app.py"
click node_endpoints "https://github.com/rishu07368/logistics-platform/blob/main/logistics-platform/backend/routes/api.py"
click node_network_ops "https://github.com/rishu07368/logistics-platform/blob/main/logistics-platform/backend/services/network.py"
click node_route_ops "https://github.com/rishu07368/logistics-platform/blob/main/logistics-platform/backend/services/routing.py"
click node_analytics "https://github.com/rishu07368/logistics-platform/blob/main/logistics-platform/backend/services/analytics.py"
click node_graph "https://github.com/rishu07368/logistics-platform/blob/main/logistics-platform/backend/services/graph.py"
click node_analysis "https://github.com/rishu07368/logistics-platform/blob/main/logistics-platform/backend/algorithms/analysis.py"
click node_dijkstra "https://github.com/rishu07368/logistics-platform/blob/main/logistics-platform/backend/algorithms/dijkstra.py"
click node_bellman_ford "https://github.com/rishu07368/logistics-platform/blob/main/logistics-platform/backend/algorithms/bellman_ford.py"
click node_algorithm_common "https://github.com/rishu07368/logistics-platform/blob/main/logistics-platform/backend/algorithms/common.py"
click node_generator "https://github.com/rishu07368/logistics-platform/blob/main/logistics-platform/backend/data/generators.py"
click node_seed "https://github.com/rishu07368/logistics-platform/blob/main/logistics-platform/backend/data/seed.py"
click node_repository "https://github.com/rishu07368/logistics-platform/blob/main/logistics-platform/backend/db/repository.py"
click node_sqlite "https://github.com/rishu07368/logistics-platform/blob/main/logistics-platform/backend/db/database.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_webapp,node_map,node_charts toneBlue
class node_api_server,node_endpoints toneAmber
class node_network_ops,node_route_ops,node_analytics toneMint
class node_graph,node_analysis,node_dijkstra,node_bellman_ford,node_algorithm_common,node_generator,node_seed,node_repository,node_sqlite toneRose
class node_user toneIndigo
```

## Components

### Browser interface

- [Web interface](https://github.com/rishu07368/logistics-platform/blob/main/logistics-platform/frontend/js/app.js): `logistics-platform/frontend/js/app.js`
- [Network map](https://github.com/rishu07368/logistics-platform/blob/main/logistics-platform/frontend/js/map.js): `logistics-platform/frontend/js/map.js`
- [Analytics charts](https://github.com/rishu07368/logistics-platform/blob/main/logistics-platform/frontend/js/charts.js): `logistics-platform/frontend/js/charts.js`

### HTTP API

- [Flask app](https://github.com/rishu07368/logistics-platform/blob/main/logistics-platform/backend/app.py): `logistics-platform/backend/app.py`
- [API endpoints](https://github.com/rishu07368/logistics-platform/blob/main/logistics-platform/backend/routes/api.py): `logistics-platform/backend/routes/api.py`

### Network and routing

- [Network management](https://github.com/rishu07368/logistics-platform/blob/main/logistics-platform/backend/services/network.py): `logistics-platform/backend/services/network.py`
- [Routing and benchmarks](https://github.com/rishu07368/logistics-platform/blob/main/logistics-platform/backend/services/routing.py): `logistics-platform/backend/services/routing.py`
- [Network analytics](https://github.com/rishu07368/logistics-platform/blob/main/logistics-platform/backend/services/analytics.py): `logistics-platform/backend/services/analytics.py`

### Graph algorithms and storage

- [Graph loading and dispatch](https://github.com/rishu07368/logistics-platform/blob/main/logistics-platform/backend/services/graph.py): `logistics-platform/backend/services/graph.py`
- [Graph properties and recommendations](https://github.com/rishu07368/logistics-platform/blob/main/logistics-platform/backend/algorithms/analysis.py): `logistics-platform/backend/algorithms/analysis.py`
- [Dijkstra](https://github.com/rishu07368/logistics-platform/blob/main/logistics-platform/backend/algorithms/dijkstra.py): `logistics-platform/backend/algorithms/dijkstra.py`
- [Bellman-Ford](https://github.com/rishu07368/logistics-platform/blob/main/logistics-platform/backend/algorithms/bellman_ford.py): `logistics-platform/backend/algorithms/bellman_ford.py`
- [Algorithm result types](https://github.com/rishu07368/logistics-platform/blob/main/logistics-platform/backend/algorithms/common.py): `logistics-platform/backend/algorithms/common.py`
- [Network generators](https://github.com/rishu07368/logistics-platform/blob/main/logistics-platform/backend/data/generators.py): `logistics-platform/backend/data/generators.py`
- [Built-in scenarios](https://github.com/rishu07368/logistics-platform/blob/main/logistics-platform/backend/data/seed.py): `logistics-platform/backend/data/seed.py`
- [Data repository](https://github.com/rishu07368/logistics-platform/blob/main/logistics-platform/backend/db/repository.py): `logistics-platform/backend/db/repository.py`
- [SQLite database](https://github.com/rishu07368/logistics-platform/blob/main/logistics-platform/backend/db/database.py): `logistics-platform/backend/db/database.py`

### Other components

- **Planner**

## Connections

- Planner → Web interface: uses
- Flask app → Web interface: serves (evidence: `logistics-platform/backend/app.py`)
- Flask app → SQLite database: initializes (evidence: `logistics-platform/backend/app.py`)
- Flask app → Built-in scenarios: seeds (evidence: `logistics-platform/backend/app.py`)
- Flask app → API endpoints: registers (evidence: `logistics-platform/backend/app.py`)
- API endpoints → Network management: delegates (evidence: `logistics-platform/backend/routes/api.py`)
- API endpoints → Routing and benchmarks: delegates (evidence: `logistics-platform/backend/routes/api.py`)
- API endpoints → Network analytics: delegates (evidence: `logistics-platform/backend/routes/api.py`)
- API endpoints → Graph loading and dispatch: loads (evidence: `logistics-platform/backend/routes/api.py`)
- API endpoints → Data repository: queries (evidence: `logistics-platform/backend/routes/api.py`)
- Routing and benchmarks → Graph loading and dispatch: loads and dispatches (evidence: `logistics-platform/backend/services/routing.py`)
- Routing and benchmarks → Data repository: logs runs (evidence: `logistics-platform/backend/services/routing.py`)
- Routing and benchmarks → Network generators: generates benchmark graphs (evidence: `logistics-platform/backend/services/routing.py`)
- Network management → Data repository: manages records (evidence: `logistics-platform/backend/services/network.py`)
- Network management → Network generators: generates networks (evidence: `logistics-platform/backend/services/network.py`)
- Network management → Built-in scenarios: uses scenarios (evidence: `logistics-platform/backend/services/network.py`)
- Network analytics → Graph loading and dispatch: analyzes (evidence: `logistics-platform/backend/services/analytics.py`)
- Network analytics → Data repository: reads run data (evidence: `logistics-platform/backend/services/analytics.py`)
- Graph loading and dispatch → Data repository: loads network data (evidence: `logistics-platform/backend/services/graph.py`)
- Graph loading and dispatch → Graph properties and recommendations: analyzes properties (evidence: `logistics-platform/backend/services/graph.py`)
- Graph loading and dispatch → Dijkstra: dispatches (evidence: `logistics-platform/backend/services/graph.py`)
- Graph loading and dispatch → Bellman-Ford: dispatches (evidence: `logistics-platform/backend/services/graph.py`)
- Graph properties and recommendations → Bellman-Ford: checks negative cycles (evidence: `logistics-platform/backend/algorithms/analysis.py`)
- Dijkstra → Algorithm result types: uses shared types (evidence: `logistics-platform/backend/algorithms/dijkstra.py`)
- Bellman-Ford → Algorithm result types: uses shared types (evidence: `logistics-platform/backend/algorithms/bellman_ford.py`)
- Built-in scenarios → Data repository: loads scenarios (evidence: `logistics-platform/backend/data/seed.py`)
- Built-in scenarios → Network generators: builds networks (evidence: `logistics-platform/backend/data/seed.py`)
- Built-in scenarios → Graph properties and recommendations: computes properties (evidence: `logistics-platform/backend/data/seed.py`)
- Data repository → SQLite database: executes SQL (evidence: `logistics-platform/backend/db/repository.py`)
