# battlemasterlol/ed-multi-pather architecture

> Architecture diagram of the GitHub repository battlemasterlol/ed-multi-pather, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/battlemasterlol/ed-multi-pather
- Repository: https://github.com/battlemasterlol/ed-multi-pather

## Overview

##### Project type and purpose
- This is a lightweight full-stack Python web application (“EDSM Distance Calculator”) whose primary goal is to let users calculate and optimize distances between star systems in Elite Dangerous.
- Key functionality: web UI for inputting systems, route optimization, CSV import/export, and fetching system coordinates from the external EDSM API.

##### File structure
Top-level files:
- main.py – single entry point, contains both UI (NiceGUI) and business logic
- systems.csv – example or local data store for star system coordinates
- requirements.txt – dependency list (requests, nicegui, pandas, asyncio, etc.)
- README.md, LICENSE – documentation and legal

Architectural clues:
- No separate “frontend” or “backend” folders – UI and server code live together in main.py
- External API integration (EDSM) plus local CSV access signals a two-tier data layer
- Use of pandas/itertools/math in logic suggests a computational layer for route optimization

##### Insights from README
- The README explicitly calls out the use of NiceGUI (web front end), requests (external API), pandas (data processing), asyncio (concurrency), and CSV import/export.

##### Detail without over-splitting
- Logical groupings within main.py (UI vs. business vs. data access).

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% External Client
    Browser["Browser Client"]:::ui

    %% NiceGUI Server Subgraph
    subgraph "NiceGUI Server" 
        direction TB
        UI["UI Layer (NiceGUI)"]:::ui
        BL["Business Logic Layer"]:::logic
        DAL["Data Access Layer"]:::data
    end

    %% External Services and Data Stores
    EDSM["External EDSM API"]:::cloud
    CSV["Local CSV Storage"]:::dataStore
    Req["Project Dependencies\n(requirements.txt)"]:::docs
    Docs["Documentation & Overview\n(README.md)"]:::docs
    Lic["Licensing\n(LICENSE)"]:::docs

    %% Primary Flows
    Browser -->|"UI requests / updates"| UI
    UI -->|"invoke computation"| BL
    BL -->|"coordinate lookup"| DAL
    DAL -->|"fetch coordinates"| EDSM
    DAL -->|"provide data"| BL
    BL -->|"results"| UI
    UI -->|"render results"| Browser

    %% Secondary Flows (CSV Import/Export)
    DAL -.->|"read/write data"| CSV

    %% Component Documentation Links
    click UI "https://github.com/battlemasterlol/ed-multi-pather/blob/main/main.py"
    click BL "https://github.com/battlemasterlol/ed-multi-pather/blob/main/main.py"
    click DAL "https://github.com/battlemasterlol/ed-multi-pather/blob/main/main.py"
    click CSV "https://github.com/battlemasterlol/ed-multi-pather/blob/main/systems.csv"
    click Req "https://github.com/battlemasterlol/ed-multi-pather/blob/main/requirements.txt"
    click Docs "https://github.com/battlemasterlol/ed-multi-pather/blob/main/README.md"
    click Lic "https://github.com/battlemasterlol/ed-multi-pather/tree/main/LICENSE"

    %% Styling
    classDef ui fill:#add8e6,stroke:#333,stroke-width:1px
    classDef logic fill:#90ee90,stroke:#333,stroke-width:1px
    classDef data fill:#ffa500,stroke:#333,stroke-width:1px
    classDef dataStore fill:#ffa500,stroke:#333,stroke-width:1px
    classDef cloud fill:#d3d3d3,stroke:#333,stroke-width:1px
    classDef docs fill:#f0e68c,stroke:#333,stroke-width:1px
```
