# pilestin/livedelivery architecture

> Architecture diagram of the GitHub repository pilestin/livedelivery, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pilestin/livedelivery
- Repository: https://github.com/pilestin/livedelivery

## Overview

##### Project type and purpose
- This is a specialized simulation-and-visualization tool. It combines:
- A Python-based Streamlit frontend ("main.py") where users upload route files, start/monitor SUMO simulations, view basic stats, and export CSVs.
- A static HTML/JS vehicle-tracking frontend ("index.html") that loads CSV output and animates multi-vehicle movement.
- An external simulation engine (SUMO) that consumes XML configs and produces raw trajectory data.

##### File structure
- Top-level:
- main.py – Streamlit “backend” & UI controller
- index.html – standalone web visualization tool
- requirements.txt – Python deps (Streamlit, SUMO bindings, pandas, etc.)
- Extended_Trajectory_Data.csv/images – example data & assets
- configs/ – SUMO network and route definitions
- outputs/ – simulation result CSVs
- Notice: the code orchestrates SUMO via subprocess or API, writes outputs, and then either visualizes in Streamlit or feeds the static HTML.

##### Key insights from README
- Dual-mode UI: interactive Streamlit app + static vehicle-tracker HTML.
- SUMO is an external service—invoked at runtime with config files.
- Data flow: user → Streamlit → SUMO → CSV → Streamlit & index.html.

## Diagram (Mermaid)

```mermaid
flowchart TD
    User["User Browser"]:::UI
    Streamlit["Streamlit App (main.py)"]:::compute
    SUMO["SUMO Engine"]:::compute
    Config["Configuration Store (configs/)"]:::config
    Outputs["Data Storage (outputs/)"]:::storage
    StaticHTML["Vehicle-Tracker Frontend (index.html)"]:::UI
    ExampleCSV["Example Trajectory Data (Extended_Trajectory_Data.csv)"]:::storage
    Reqs["requirements.txt"]:::doc
    Readme["README.md"]:::doc

    User -->|"interacts"| Streamlit
    Streamlit -->|"invokes"| SUMO
    Config -.->|"read configs"| SUMO
    SUMO -.->|"writes CSV output"| Outputs
    Outputs -.->|"reads outputs"| Streamlit
    Streamlit -->|"exports data"| Outputs
    User -->|"opens"| StaticHTML
    StaticHTML -.->|"fetches trajectory CSV"| Outputs
    StaticHTML -->|"loads sample data"| ExampleCSV

    click Streamlit "https://github.com/pilestin/livedelivery/blob/master/main.py"
    click StaticHTML "https://github.com/pilestin/livedelivery/blob/master/index.html"
    click Config "https://github.com/pilestin/livedelivery/tree/master/configs/"
    click Outputs "https://github.com/pilestin/livedelivery/tree/master/outputs/"
    click ExampleCSV "https://github.com/pilestin/livedelivery/blob/master/Extended_Trajectory_Data.csv"
    click Reqs "https://github.com/pilestin/livedelivery/blob/master/requirements.txt"
    click Readme "https://github.com/pilestin/livedelivery/blob/master/README.md"

    classDef compute fill:#cce5ff,stroke:#004085,color:#004085
    classDef UI fill:#ffe5b4,stroke:#cc8400,color:#cc8400
    classDef storage fill:#d4edda,stroke:#155724,color:#155724
    classDef config fill:#e2f0d9,stroke:#3a5b1a,color:#3a5b1a
    classDef doc fill:#f8f9fa,stroke:#6c757d,color:#6c757d
```
