# nikogrizek/kve architecture

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

- Interactive diagram: https://gitdiagram.com/nikogrizek/kve
- Repository: https://github.com/nikogrizek/kve

## Overview

KalkulatorVetreneEnergije is a desktop wind-energy production estimator. Users choose map or manual coordinates, assign turbines to locations, retrieve archived wind observations, calculate production, review results, and export a detailed PDF; they can also maintain the turbine catalog and browse saved reports. The graph follows the visible Tkinter wiring and documented capabilities. Source excerpts show the calculation, catalog, and report-generation paths; some UI behavior is omitted, so only documented or directly evidenced relationships are drawn.

Main entry points: [`app/GUI/calculator_frame.py`](https://github.com/nikogrizek/kve/blob/main/app/GUI/calculator_frame.py) (Location calculator), [`app/gui.py`](https://github.com/nikogrizek/kve/blob/main/app/gui.py) (Window and navigation), [`app/data_manager.py`](https://github.com/nikogrizek/kve/blob/main/app/data_manager.py) (Turbine JSON storage), [`app/GUI/report_frame.py`](https://github.com/nikogrizek/kve/blob/main/app/GUI/report_frame.py) (Report browsing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_application["Desktop application"]
  node_launcher["Application launcher<br/>[main.py]"]
  node_app_shell["Window and navigation<br/>[gui.py]"]
end

subgraph group_assessment["Wind assessment"]
  node_calculator_ui["Location calculator"]
  node_location_selection["Location and turbine selection"]
  node_wind_service["Archived wind data<br/>[data.py]"]
  node_production["Production calculations<br/>[calculations.py]"]
  node_results["Calculation results"]
end

subgraph group_catalog["Turbine catalog"]
  node_turbine_ui["Turbine management<br/>[turbine_frame.py]"]
  node_turbine_storage["Turbine JSON storage<br/>[data_manager.py]"]
  node_turbine_file[("Turbine catalog file<br/>[turbines.json]")]
end

subgraph group_reporting["Reports"]
  node_pdf_export["PDF report generation<br/>[export.py]"]
  node_report_library["Report browsing<br/>[report_frame.py]"]
  node_report_files[("Saved PDF reports")]
end

node_user(("User"))
node_open_meteo["Open-Meteo archive API"]

node_user -->|"uses"| node_app_shell
node_launcher -->|"starts"| node_app_shell
node_app_shell -->|"creates"| node_calculator_ui
node_app_shell -->|"creates"| node_turbine_ui
node_app_shell -->|"creates"| node_report_library
node_user -->|"chooses locations"| node_location_selection
node_location_selection -->|"submits choices"| node_calculator_ui
node_calculator_ui -->|"loads catalog"| node_turbine_storage
node_turbine_ui -->|"loads and saves"| node_turbine_storage
node_turbine_storage -->|"reads and writes"| node_turbine_file
node_calculator_ui -->|"requests wind data"| node_wind_service
node_wind_service -->|"fetches archive"| node_open_meteo
node_calculator_ui -->|"calculates production"| node_production
node_calculator_ui -->|"displays results"| node_results
node_calculator_ui -->|"exports report"| node_pdf_export
node_pdf_export -->|"calculates report values"| node_production
node_pdf_export -->|"loads turbine data"| node_turbine_storage
node_app_shell -->|"provides report callback"| node_report_library
node_report_library -->|"lists and manages"| node_report_files
node_user -->|"browses reports"| node_report_library

click node_launcher "https://github.com/nikogrizek/kve/blob/main/main.py"
click node_app_shell "https://github.com/nikogrizek/kve/blob/main/app/gui.py"
click node_calculator_ui "https://github.com/nikogrizek/kve/blob/main/app/GUI/calculator_frame.py"
click node_location_selection "https://github.com/nikogrizek/kve/blob/main/app/GUI/calculator_frame.py"
click node_wind_service "https://github.com/nikogrizek/kve/blob/main/app/data.py"
click node_production "https://github.com/nikogrizek/kve/blob/main/app/calculations.py"
click node_results "https://github.com/nikogrizek/kve/blob/main/app/GUI/calculator_frame.py"
click node_turbine_ui "https://github.com/nikogrizek/kve/blob/main/app/GUI/turbine_frame.py"
click node_turbine_storage "https://github.com/nikogrizek/kve/blob/main/app/data_manager.py"
click node_turbine_file "https://github.com/nikogrizek/kve/blob/main/turbines.json"
click node_pdf_export "https://github.com/nikogrizek/kve/blob/main/app/export.py"
click node_report_library "https://github.com/nikogrizek/kve/blob/main/app/GUI/report_frame.py"
click node_report_files "https://github.com/nikogrizek/kve/tree/main/reports"

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_launcher,node_app_shell,node_user toneBlue
class node_calculator_ui,node_location_selection,node_wind_service,node_production,node_results toneAmber
class node_turbine_ui,node_turbine_storage,node_turbine_file,node_open_meteo toneMint
class node_pdf_export,node_report_library,node_report_files toneRose
```

## Components

### Desktop application

- [Application launcher](https://github.com/nikogrizek/kve/blob/main/main.py): `main.py`
- [Window and navigation](https://github.com/nikogrizek/kve/blob/main/app/gui.py): `app/gui.py`

### Wind assessment

- [Location calculator](https://github.com/nikogrizek/kve/blob/main/app/GUI/calculator_frame.py): `app/GUI/calculator_frame.py`
- [Location and turbine selection](https://github.com/nikogrizek/kve/blob/main/app/GUI/calculator_frame.py): `app/GUI/calculator_frame.py`
- [Archived wind data](https://github.com/nikogrizek/kve/blob/main/app/data.py): `app/data.py`
- [Production calculations](https://github.com/nikogrizek/kve/blob/main/app/calculations.py): `app/calculations.py`
- [Calculation results](https://github.com/nikogrizek/kve/blob/main/app/GUI/calculator_frame.py): `app/GUI/calculator_frame.py`

### Turbine catalog

- [Turbine management](https://github.com/nikogrizek/kve/blob/main/app/GUI/turbine_frame.py): `app/GUI/turbine_frame.py`
- [Turbine JSON storage](https://github.com/nikogrizek/kve/blob/main/app/data_manager.py): `app/data_manager.py`
- [Turbine catalog file](https://github.com/nikogrizek/kve/blob/main/turbines.json): `turbines.json`

### Reports

- [PDF report generation](https://github.com/nikogrizek/kve/blob/main/app/export.py): `app/export.py`
- [Report browsing](https://github.com/nikogrizek/kve/blob/main/app/GUI/report_frame.py): `app/GUI/report_frame.py`
- [Saved PDF reports](https://github.com/nikogrizek/kve/tree/main/reports): `reports`

### Other components

- **User**
- **Open-Meteo archive API**

## Connections

- User → Window and navigation: uses (evidence: `README.md`)
- Application launcher → Window and navigation: starts (evidence: `main.py`)
- Window and navigation → Location calculator: creates (evidence: `app/gui.py`)
- Window and navigation → Turbine management: creates (evidence: `app/gui.py`)
- Window and navigation → Report browsing: creates (evidence: `app/gui.py`)
- User → Location and turbine selection: chooses locations (evidence: `README.md`)
- Location and turbine selection → Location calculator: submits choices (evidence: `app/GUI/calculator_frame.py`)
- Location calculator → Turbine JSON storage: loads catalog (evidence: `app/GUI/calculator_frame.py`)
- Turbine management → Turbine JSON storage: loads and saves (evidence: `app/GUI/turbine_frame.py`)
- Turbine JSON storage → Turbine catalog file: reads and writes (evidence: `app/data_manager.py`)
- Location calculator → Archived wind data: requests wind data (evidence: `app/GUI/calculator_frame.py`)
- Archived wind data → Open-Meteo archive API: fetches archive (evidence: `app/data.py`)
- Location calculator → Production calculations: calculates production (evidence: `app/GUI/calculator_frame.py`)
- Location calculator → Calculation results: displays results (evidence: `README.md`)
- Location calculator → PDF report generation: exports report (evidence: `app/GUI/calculator_frame.py`)
- PDF report generation → Production calculations: calculates report values (evidence: `app/export.py`)
- PDF report generation → Turbine JSON storage: loads turbine data (evidence: `app/export.py`)
- Window and navigation → Report browsing: provides report callback (evidence: `app/gui.py`)
- Report browsing → Saved PDF reports: lists and manages (evidence: `app/GUI/report_frame.py`)
- User → Report browsing: browses reports (evidence: `README.md`)
