# morenolopez/fly-in architecture

> Architecture diagram of the GitHub repository morenolopez/fly-in, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/morenolopez/fly-in
- Repository: https://github.com/morenolopez/fly-in

## Overview

Fly-in parses a map into a drone network, plans capacity-aware timed routes, converts them into turn-by-turn actions, and presents them as CLI text or an optional animated GUI. The graph separates parsing, domain data, routing, and presentation. The routing and simulation relationships are supported by excerpts; README statements support the overall workflow and GUI capabilities. Unsampled implementation details are not expanded beyond documented behavior.

Main entry points: [`src/parser.py`](https://github.com/morenolopez/fly-in/blob/master/src/parser.py) (Map parser), [`src/main.py`](https://github.com/morenolopez/fly-in/blob/master/src/main.py) (CLI entry point), [`src/models/network.py`](https://github.com/morenolopez/fly-in/blob/master/src/models/network.py) (Network model), [`src/algorithms.py`](https://github.com/morenolopez/fly-in/blob/master/src/algorithms.py) (Routing manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_input["Map and model"]
  node_parser["Map parser<br/>[parser.py]"]
  node_network["Network model<br/>[network.py]"]
  node_zone["Zone model<br/>[zone.py]"]
  node_connection["Connection model<br/>[connection.py]"]
  node_drone["Drone model<br/>[drone.py]"]
end

subgraph group_routing["Cooperative routing"]
  node_manager["Routing manager<br/>[algorithms.py]"]
  node_pathfinder["Timed pathfinder<br/>[algorithms.py]"]
  node_reservations[("Reservation table<br/>[algorithms.py]")]
end

subgraph group_presentation["Simulation and views"]
  node_cli["CLI entry point<br/>[main.py]"]
  node_engine["Simulation engine<br/>[simulate.py]"]
  node_textview["Turn text output<br/>[main.py]"]
  node_visualizer["Graphical visualizer<br/>[visualizer.py]"]
end

node_operator(("Map operator"))
node_mapfile["Map file"]
node_viewer(("Simulation viewer"))

node_operator -->|"provides map"| node_mapfile
node_cli -->|"parses map"| node_parser
node_mapfile -->|"reads"| node_parser
node_parser -->|"builds"| node_network
node_parser -->|"creates"| node_zone
node_parser -->|"creates"| node_connection
node_parser -->|"creates"| node_drone
node_cli -->|"routes drones"| node_manager
node_manager -->|"finds paths"| node_pathfinder
node_manager -->|"reserves paths"| node_reservations
node_pathfinder -->|"checks capacity"| node_reservations
node_pathfinder -->|"searches network"| node_network
node_cli -->|"formats routes"| node_engine
node_engine -->|"reads occupancy"| node_reservations
node_cli -->|"prints turns"| node_textview
node_cli -.->|"launches optionally"| node_visualizer
node_visualizer -->|"animates simulation"| node_viewer
node_engine -->|"provides turn lines"| node_visualizer
node_network -->|"stores zones"| node_zone
node_network -->|"stores connections"| node_connection
node_network -->|"stores drones"| node_drone

click node_cli "https://github.com/morenolopez/fly-in/blob/master/src/main.py"
click node_parser "https://github.com/morenolopez/fly-in/blob/master/src/parser.py"
click node_network "https://github.com/morenolopez/fly-in/blob/master/src/models/network.py"
click node_zone "https://github.com/morenolopez/fly-in/blob/master/src/models/zone.py"
click node_connection "https://github.com/morenolopez/fly-in/blob/master/src/models/connection.py"
click node_drone "https://github.com/morenolopez/fly-in/blob/master/src/models/drone.py"
click node_manager "https://github.com/morenolopez/fly-in/blob/master/src/algorithms.py"
click node_pathfinder "https://github.com/morenolopez/fly-in/blob/master/src/algorithms.py"
click node_reservations "https://github.com/morenolopez/fly-in/blob/master/src/algorithms.py"
click node_engine "https://github.com/morenolopez/fly-in/blob/master/src/simulate.py"
click node_textview "https://github.com/morenolopez/fly-in/blob/master/src/main.py"
click node_visualizer "https://github.com/morenolopez/fly-in/blob/master/src/visualizer.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_parser,node_network,node_zone,node_connection,node_drone,node_viewer toneBlue
class node_manager,node_pathfinder,node_reservations toneAmber
class node_cli,node_engine,node_textview,node_visualizer toneMint
class node_operator,node_mapfile toneIndigo
```

## Components

### Map and model

- [Map parser](https://github.com/morenolopez/fly-in/blob/master/src/parser.py): `src/parser.py`
- [Network model](https://github.com/morenolopez/fly-in/blob/master/src/models/network.py): `src/models/network.py`
- [Zone model](https://github.com/morenolopez/fly-in/blob/master/src/models/zone.py): `src/models/zone.py`
- [Connection model](https://github.com/morenolopez/fly-in/blob/master/src/models/connection.py): `src/models/connection.py`
- [Drone model](https://github.com/morenolopez/fly-in/blob/master/src/models/drone.py): `src/models/drone.py`

### Cooperative routing

- [Routing manager](https://github.com/morenolopez/fly-in/blob/master/src/algorithms.py): `src/algorithms.py`
- [Timed pathfinder](https://github.com/morenolopez/fly-in/blob/master/src/algorithms.py): `src/algorithms.py`
- [Reservation table](https://github.com/morenolopez/fly-in/blob/master/src/algorithms.py): `src/algorithms.py`

### Simulation and views

- [CLI entry point](https://github.com/morenolopez/fly-in/blob/master/src/main.py): `src/main.py`
- [Simulation engine](https://github.com/morenolopez/fly-in/blob/master/src/simulate.py): `src/simulate.py`
- [Turn text output](https://github.com/morenolopez/fly-in/blob/master/src/main.py): `src/main.py`
- [Graphical visualizer](https://github.com/morenolopez/fly-in/blob/master/src/visualizer.py): `src/visualizer.py`

### Other components

- **Map operator**
- **Map file**
- **Simulation viewer**

## Connections

- Map operator → Map file: provides map (evidence: `README.md`)
- CLI entry point → Map parser: parses map (evidence: `src/main.py`)
- Map file → Map parser: reads (evidence: `README.md`)
- Map parser → Network model: builds (evidence: `src/parser.py`)
- Map parser → Zone model: creates (evidence: `src/parser.py`)
- Map parser → Connection model: creates (evidence: `src/parser.py`)
- Map parser → Drone model: creates (evidence: `src/parser.py`)
- CLI entry point → Routing manager: routes drones (evidence: `src/main.py`)
- Routing manager → Timed pathfinder: finds paths (evidence: `src/algorithms.py`)
- Routing manager → Reservation table: reserves paths (evidence: `src/algorithms.py`)
- Timed pathfinder → Reservation table: checks capacity (evidence: `README.md`)
- Timed pathfinder → Network model: searches network (evidence: `src/algorithms.py`)
- CLI entry point → Simulation engine: formats routes (evidence: `src/main.py`)
- Simulation engine → Reservation table: reads occupancy (evidence: `src/simulate.py`)
- CLI entry point → Turn text output: prints turns (evidence: `src/main.py`)
- CLI entry point → Graphical visualizer: launches optionally (evidence: `src/main.py`)
- Graphical visualizer → Simulation viewer: animates simulation (evidence: `README.md`)
- Simulation engine → Graphical visualizer: provides turn lines (evidence: `src/main.py`)
- Network model → Zone model: stores zones (evidence: `src/models/network.py`)
- Network model → Connection model: stores connections (evidence: `src/models/network.py`)
- Network model → Drone model: stores drones (evidence: `src/models/network.py`)
