# kenzojulian111/ftth-simulator architecture

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

- Interactive diagram: https://gitdiagram.com/kenzojulian111/ftth-simulator
- Repository: https://github.com/kenzojulian111/ftth-simulator

## Overview

FTTH Network Planning Simulator is a full-stack tool for designing GPON access networks on a map, checking topology and optical budgets, and producing cost and pole-span reports. The user workflow runs from project editing in the React workspace through project APIs to backend validation and engineering calculations, then returns results for map panels and reports. The tree and excerpts show both a Rust API and a FastAPI service; the README describes FastAPI as canonical, while Rust routes and Python integration endpoints indicate overlapping API responsibilities. Some branches are documented but their implementation paths are unsampled, so their internal links are omitted.

Main entry points: [`src/ui/App.tsx`](https://github.com/kenzojulian111/ftth-simulator/blob/main/src/ui/App.tsx) (Editor workspace), [`backend/app/api/routes.py`](https://github.com/kenzojulian111/ftth-simulator/blob/main/backend/app/api/routes.py) (FastAPI routes), [`backend/app/persistence/repository.py`](https://github.com/kenzojulian111/ftth-simulator/blob/main/backend/app/persistence/repository.py) (Project repository), [`src/ui/LocationSearch.tsx`](https://github.com/kenzojulian111/ftth-simulator/blob/main/src/ui/LocationSearch.tsx) (Location search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Planning workspace"]
  node_app["Editor workspace<br/>[App.tsx]"]
  node_editor["Editor state<br/>[editorReducer.ts]"]
  node_map["GIS canvas<br/>[NetworkMap.tsx]"]
  node_search["Location search<br/>[LocationSearch.tsx]"]
  node_projectapi["Project API<br/>[projectApi.ts]"]
end

subgraph group_domain["Network domain"]
  node_model["Network project model<br/>[models.py]"]
  node_validation["Topology validation<br/>[validation.py]"]
  node_routerconfig["Router configuration<br/>[routerConfig.ts]"]
end

subgraph group_services["Engineering services"]
  node_geo["Route geometry<br/>[geo.py]"]
  node_optical["Optical budget<br/>[optical.py]"]
  node_cost["Construction costs<br/>[cost.py]"]
  node_poles["Pole span analysis<br/>[pole.py]"]
  node_geocode["Geocoding service<br/>[geocoding.py]"]
end

subgraph group_backend["API and persistence"]
  node_api["FastAPI routes<br/>[routes.py]"]
  node_repo["Project repository<br/>[repository.py]"]
  node_database[("SQLite persistence<br/>[database.py]")]
  node_rustapi["Rust API routes<br/>[routes.rs]"]
  node_rustdb[("Rust project storage<br/>[db.rs]")]
end

subgraph group_outputs["Reports and exchange"]
  node_engineering["Engineering analysis"]
  node_opticalreport["Optical report"]
  node_rabreport["RAB report<br/>[RabReport.tsx]"]
  node_spanreport["Pole span report<br/>[PoleSpanReport.tsx]"]
  node_kmzimport["KMZ import<br/>[kmz_importer.py]"]
  node_kmzexport["KMZ export<br/>[kmz_exporter.py]"]
end

node_planner(("Network planner"))
node_geocoder["Nominatim-compatible provider"]

node_planner -->|"plans network"| node_app
node_app -->|"dispatches edits"| node_editor
node_app -->|"renders"| node_map
node_app -->|"saves project"| node_projectapi
node_app -->|"renders"| node_search
node_search -->|"searches locations"| node_geocoder
node_search -->|"requests results"| node_geocode
node_projectapi -.->|"sends requests"| node_api
node_api -->|"reads and saves"| node_repo
node_repo -.->|"persists projects"| node_database
node_repo -->|"validates projects"| node_validation
node_repo -->|"updates route lengths"| node_geo
node_api -.->|"validates topology"| node_validation
node_api -->|"calculates budget"| node_optical
node_api -->|"calculates costs"| node_cost
node_api -->|"calculates spans"| node_poles
node_api -->|"imports archives"| node_kmzimport
node_api -.->|"exports archives"| node_kmzexport
node_api -->|"accepts project"| node_model
node_projectapi -.->|"uses Rust API"| node_rustapi
node_rustapi -->|"loads projects"| node_rustdb
node_rustapi -->|"integrates calculations"| node_optical
node_engineering -->|"supplies analysis"| node_opticalreport
node_app -.->|"shows report"| node_opticalreport
node_app -.->|"shows report"| node_rabreport
node_app -.->|"shows report"| node_spanreport
node_opticalreport -->|"renders results"| node_engineering
node_app -->|"offers import"| node_kmzimport
node_model -.->|"models router settings"| node_routerconfig

click node_app "https://github.com/kenzojulian111/ftth-simulator/blob/main/src/ui/App.tsx"
click node_editor "https://github.com/kenzojulian111/ftth-simulator/blob/main/src/state/editorReducer.ts"
click node_map "https://github.com/kenzojulian111/ftth-simulator/blob/main/src/ui/NetworkMap.tsx"
click node_search "https://github.com/kenzojulian111/ftth-simulator/blob/main/src/ui/LocationSearch.tsx"
click node_projectapi "https://github.com/kenzojulian111/ftth-simulator/blob/main/src/api/projectApi.ts"
click node_model "https://github.com/kenzojulian111/ftth-simulator/blob/main/backend/app/domain/models.py"
click node_validation "https://github.com/kenzojulian111/ftth-simulator/blob/main/backend/app/domain/validation.py"
click node_routerconfig "https://github.com/kenzojulian111/ftth-simulator/blob/main/src/domain/routerConfig.ts"
click node_geo "https://github.com/kenzojulian111/ftth-simulator/blob/main/backend/app/engine/geo.py"
click node_optical "https://github.com/kenzojulian111/ftth-simulator/blob/main/backend/app/engine/optical.py"
click node_cost "https://github.com/kenzojulian111/ftth-simulator/blob/main/backend/app/engine/cost.py"
click node_poles "https://github.com/kenzojulian111/ftth-simulator/blob/main/backend/app/engine/pole.py"
click node_geocode "https://github.com/kenzojulian111/ftth-simulator/blob/main/backend/app/services/geocoding.py"
click node_api "https://github.com/kenzojulian111/ftth-simulator/blob/main/backend/app/api/routes.py"
click node_repo "https://github.com/kenzojulian111/ftth-simulator/blob/main/backend/app/persistence/repository.py"
click node_database "https://github.com/kenzojulian111/ftth-simulator/blob/main/backend/app/persistence/database.py"
click node_rustapi "https://github.com/kenzojulian111/ftth-simulator/blob/main/backend-rust/src/routes.rs"
click node_rustdb "https://github.com/kenzojulian111/ftth-simulator/blob/main/backend-rust/src/db.rs"
click node_engineering "https://github.com/kenzojulian111/ftth-simulator/blob/main/src/domain/engineeringReportAnalysis.ts"
click node_opticalreport "https://github.com/kenzojulian111/ftth-simulator/blob/main/src/ui/reports/OpticalEngineeringReport.tsx"
click node_rabreport "https://github.com/kenzojulian111/ftth-simulator/blob/main/src/ui/reports/RabReport.tsx"
click node_spanreport "https://github.com/kenzojulian111/ftth-simulator/blob/main/src/ui/reports/PoleSpanReport.tsx"
click node_kmzimport "https://github.com/kenzojulian111/ftth-simulator/blob/main/backend/app/services/kmz_importer.py"
click node_kmzexport "https://github.com/kenzojulian111/ftth-simulator/blob/main/backend/app/services/kmz_exporter.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_app,node_editor,node_map,node_search,node_projectapi toneBlue
class node_model,node_validation,node_routerconfig toneAmber
class node_geo,node_optical,node_cost,node_poles,node_geocode toneMint
class node_api,node_repo,node_database,node_rustapi,node_rustdb toneRose
class node_engineering,node_opticalreport,node_rabreport,node_spanreport,node_kmzimport,node_kmzexport,node_planner,node_geocoder toneIndigo
```

## Components

### Planning workspace

- [Editor workspace](https://github.com/kenzojulian111/ftth-simulator/blob/main/src/ui/App.tsx): `src/ui/App.tsx`
- [Editor state](https://github.com/kenzojulian111/ftth-simulator/blob/main/src/state/editorReducer.ts): `src/state/editorReducer.ts`
- [GIS canvas](https://github.com/kenzojulian111/ftth-simulator/blob/main/src/ui/NetworkMap.tsx): `src/ui/NetworkMap.tsx`
- [Location search](https://github.com/kenzojulian111/ftth-simulator/blob/main/src/ui/LocationSearch.tsx): `src/ui/LocationSearch.tsx`
- [Project API](https://github.com/kenzojulian111/ftth-simulator/blob/main/src/api/projectApi.ts): `src/api/projectApi.ts`

### Network domain

- [Network project model](https://github.com/kenzojulian111/ftth-simulator/blob/main/backend/app/domain/models.py): `backend/app/domain/models.py`
- [Topology validation](https://github.com/kenzojulian111/ftth-simulator/blob/main/backend/app/domain/validation.py): `backend/app/domain/validation.py`
- [Router configuration](https://github.com/kenzojulian111/ftth-simulator/blob/main/src/domain/routerConfig.ts): `src/domain/routerConfig.ts`

### Engineering services

- [Route geometry](https://github.com/kenzojulian111/ftth-simulator/blob/main/backend/app/engine/geo.py): `backend/app/engine/geo.py`
- [Optical budget](https://github.com/kenzojulian111/ftth-simulator/blob/main/backend/app/engine/optical.py): `backend/app/engine/optical.py`
- [Construction costs](https://github.com/kenzojulian111/ftth-simulator/blob/main/backend/app/engine/cost.py): `backend/app/engine/cost.py`
- [Pole span analysis](https://github.com/kenzojulian111/ftth-simulator/blob/main/backend/app/engine/pole.py): `backend/app/engine/pole.py`
- [Geocoding service](https://github.com/kenzojulian111/ftth-simulator/blob/main/backend/app/services/geocoding.py): `backend/app/services/geocoding.py`

### API and persistence

- [FastAPI routes](https://github.com/kenzojulian111/ftth-simulator/blob/main/backend/app/api/routes.py): `backend/app/api/routes.py`
- [Project repository](https://github.com/kenzojulian111/ftth-simulator/blob/main/backend/app/persistence/repository.py): `backend/app/persistence/repository.py`
- [SQLite persistence](https://github.com/kenzojulian111/ftth-simulator/blob/main/backend/app/persistence/database.py): `backend/app/persistence/database.py`
- [Rust API routes](https://github.com/kenzojulian111/ftth-simulator/blob/main/backend-rust/src/routes.rs): `backend-rust/src/routes.rs`
- [Rust project storage](https://github.com/kenzojulian111/ftth-simulator/blob/main/backend-rust/src/db.rs): `backend-rust/src/db.rs`

### Reports and exchange

- [Engineering analysis](https://github.com/kenzojulian111/ftth-simulator/blob/main/src/domain/engineeringReportAnalysis.ts): `src/domain/engineeringReportAnalysis.ts`
- [Optical report](https://github.com/kenzojulian111/ftth-simulator/blob/main/src/ui/reports/OpticalEngineeringReport.tsx): `src/ui/reports/OpticalEngineeringReport.tsx`
- [RAB report](https://github.com/kenzojulian111/ftth-simulator/blob/main/src/ui/reports/RabReport.tsx): `src/ui/reports/RabReport.tsx`
- [Pole span report](https://github.com/kenzojulian111/ftth-simulator/blob/main/src/ui/reports/PoleSpanReport.tsx): `src/ui/reports/PoleSpanReport.tsx`
- [KMZ import](https://github.com/kenzojulian111/ftth-simulator/blob/main/backend/app/services/kmz_importer.py): `backend/app/services/kmz_importer.py`
- [KMZ export](https://github.com/kenzojulian111/ftth-simulator/blob/main/backend/app/services/kmz_exporter.py): `backend/app/services/kmz_exporter.py`

### Other components

- **Network planner**
- **Nominatim-compatible provider**

## Connections

- Network planner → Editor workspace: plans network (evidence: `README.md`)
- Editor workspace → Editor state: dispatches edits (evidence: `src/ui/App.tsx`)
- Editor workspace → GIS canvas: renders (evidence: `src/ui/App.tsx`)
- Editor workspace → Project API: saves project (evidence: `src/ui/App.tsx`)
- Editor workspace → Location search: renders (evidence: `src/ui/App.tsx`)
- Location search → Nominatim-compatible provider: searches locations (evidence: `README.md`)
- Location search → Geocoding service: requests results (evidence: `src/ui/LocationSearch.tsx`)
- Project API → FastAPI routes: sends requests
- FastAPI routes → Project repository: reads and saves (evidence: `backend/app/api/routes.py`)
- Project repository → SQLite persistence: persists projects
- Project repository → Topology validation: validates projects (evidence: `backend/app/persistence/repository.py`)
- Project repository → Route geometry: updates route lengths (evidence: `backend/app/persistence/repository.py`)
- FastAPI routes → Topology validation: validates topology (evidence: `backend/app/api/routes.py`)
- FastAPI routes → Optical budget: calculates budget (evidence: `backend/app/api/routes.py`)
- FastAPI routes → Construction costs: calculates costs (evidence: `backend/app/api/routes.py`)
- FastAPI routes → Pole span analysis: calculates spans (evidence: `backend/app/api/routes.py`)
- FastAPI routes → KMZ import: imports archives (evidence: `backend/app/api/routes.py`)
- FastAPI routes → KMZ export: exports archives (evidence: `backend/app/api/routes.py`)
- FastAPI routes → Network project model: accepts project (evidence: `backend/app/api/routes.py`)
- Project API → Rust API routes: uses Rust API
- Rust API routes → Rust project storage: loads projects (evidence: `backend-rust/src/routes.rs`)
- Rust API routes → Optical budget: integrates calculations
- Engineering analysis → Optical report: supplies analysis (evidence: `src/ui/reports/OpticalEngineeringReport.tsx`)
- Editor workspace → Optical report: shows report (evidence: `src/ui/App.tsx`)
- Editor workspace → RAB report: shows report (evidence: `src/ui/App.tsx`)
- Editor workspace → Pole span report: shows report (evidence: `src/ui/App.tsx`)
- Optical report → Engineering analysis: renders results (evidence: `src/ui/reports/OpticalEngineeringReport.tsx`)
- Editor workspace → KMZ import: offers import (evidence: `README.md`)
- Network project model → Router configuration: models router settings
