# orkhankhalilzade/agro-food-investments architecture

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

- Interactive diagram: https://gitdiagram.com/orkhankhalilzade/agro-food-investments
- Repository: https://github.com/orkhankhalilzade/agro-food-investments

## Overview

Agro Food Investment is a Streamlit planner for orchard operations, integrated pest management programs, machinery, and operating costs. Users select an orchard and week, enter an operation’s products and inputs, review calculated time, fuel, labor, and cost results, then manage weekly operations and export workbook reports. Supporting capabilities include orchard-specific program and area data, inventory editing, bilingual labels, and save/load of application state. The excerpts show the calculation and configuration layers; some UI actions are only indicated by the source index, and no README was provided.

Main entry points: [`app.py`](https://github.com/orkhankhalilzade/agro-food-investments/blob/main/app.py) (Operation entry), [`core.py`](https://github.com/orkhankhalilzade/agro-food-investments/blob/main/core.py) (Operation validation), [`export_xlsx.py`](https://github.com/orkhankhalilzade/agro-food-investments/blob/main/export_xlsx.py) (Excel workbook export), [`calc.py`](https://github.com/orkhankhalilzade/agro-food-investments/blob/main/calc.py) (Cost calculations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Planner interface"]
  node_operation_ui["Operation entry<br/>[app.py]"]
  node_results_ui["Cost results<br/>[app.py]"]
  node_weekly_ui["Weekly operations<br/>[app.py]"]
  node_inventory_ui["Machinery inventory<br/>[app.py]"]
  node_state_ui["Save and load<br/>[app.py]"]
end

subgraph group_domain["Planning logic"]
  node_orchard_config["Orchard programs<br/>[core.py]"]
  node_orchard_data["Orchard data<br/>[orchards.json]"]
  node_operation_logic["Operation validation<br/>[core.py]"]
  node_state_logic["State serialization<br/>[core.py]"]
  node_weekly_logic["Summary and status<br/>[core.py]"]
  node_calculation["Cost calculations<br/>[calc.py]"]
end

subgraph group_reporting["Reports and language"]
  node_xlsx_export["Excel workbook export<br/>[export_xlsx.py]"]
  node_translations["English and Azerbaijani<br/>[i18n.py]"]
end

node_user(("Planner user"))

node_user -->|"enters operation"| node_operation_ui
node_operation_ui -->|"loads program data"| node_orchard_config
node_orchard_config -->|"reads"| node_orchard_data
node_operation_ui -.->|"validates operations"| node_operation_logic
node_operation_ui -->|"calculates results"| node_calculation
node_operation_ui -->|"shows results"| node_results_ui
node_operation_ui -.->|"manages operations"| node_weekly_ui
node_weekly_ui -.->|"summarizes operations"| node_weekly_logic
node_weekly_logic -->|"computes operations"| node_operation_logic
node_operation_logic -->|"calculates"| node_calculation
node_operation_ui -->|"edits inventory"| node_inventory_ui
node_operation_ui -.->|"imports and exports state"| node_state_ui
node_state_ui -.->|"serializes state"| node_state_logic
node_operation_ui -->|"translates labels"| node_translations
node_operation_ui -.->|"requests workbook"| node_xlsx_export
node_xlsx_export -->|"uses operation data"| node_operation_logic
node_xlsx_export -->|"uses calculations"| node_calculation
node_user -->|"reviews operations"| node_weekly_ui

click node_operation_ui "https://github.com/orkhankhalilzade/agro-food-investments/blob/main/app.py"
click node_results_ui "https://github.com/orkhankhalilzade/agro-food-investments/blob/main/app.py"
click node_weekly_ui "https://github.com/orkhankhalilzade/agro-food-investments/blob/main/app.py"
click node_inventory_ui "https://github.com/orkhankhalilzade/agro-food-investments/blob/main/app.py"
click node_state_ui "https://github.com/orkhankhalilzade/agro-food-investments/blob/main/app.py"
click node_orchard_config "https://github.com/orkhankhalilzade/agro-food-investments/blob/main/core.py"
click node_orchard_data "https://github.com/orkhankhalilzade/agro-food-investments/blob/main/config/orchards.json"
click node_operation_logic "https://github.com/orkhankhalilzade/agro-food-investments/blob/main/core.py"
click node_state_logic "https://github.com/orkhankhalilzade/agro-food-investments/blob/main/core.py"
click node_weekly_logic "https://github.com/orkhankhalilzade/agro-food-investments/blob/main/core.py"
click node_calculation "https://github.com/orkhankhalilzade/agro-food-investments/blob/main/calc.py"
click node_xlsx_export "https://github.com/orkhankhalilzade/agro-food-investments/blob/main/export_xlsx.py"
click node_translations "https://github.com/orkhankhalilzade/agro-food-investments/blob/main/i18n.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_operation_ui,node_results_ui,node_weekly_ui,node_inventory_ui,node_state_ui,node_user toneBlue
class node_orchard_config,node_orchard_data,node_operation_logic,node_state_logic,node_weekly_logic,node_calculation toneAmber
class node_xlsx_export,node_translations toneMint
```

## Components

### Planner interface

- [Operation entry](https://github.com/orkhankhalilzade/agro-food-investments/blob/main/app.py): `app.py`
- [Cost results](https://github.com/orkhankhalilzade/agro-food-investments/blob/main/app.py): `app.py`
- [Weekly operations](https://github.com/orkhankhalilzade/agro-food-investments/blob/main/app.py): `app.py`
- [Machinery inventory](https://github.com/orkhankhalilzade/agro-food-investments/blob/main/app.py): `app.py`
- [Save and load](https://github.com/orkhankhalilzade/agro-food-investments/blob/main/app.py): `app.py`

### Planning logic

- [Orchard programs](https://github.com/orkhankhalilzade/agro-food-investments/blob/main/core.py): `core.py`
- [Orchard data](https://github.com/orkhankhalilzade/agro-food-investments/blob/main/config/orchards.json): `config/orchards.json`
- [Operation validation](https://github.com/orkhankhalilzade/agro-food-investments/blob/main/core.py): `core.py`
- [State serialization](https://github.com/orkhankhalilzade/agro-food-investments/blob/main/core.py): `core.py`
- [Summary and status](https://github.com/orkhankhalilzade/agro-food-investments/blob/main/core.py): `core.py`
- [Cost calculations](https://github.com/orkhankhalilzade/agro-food-investments/blob/main/calc.py): `calc.py`

### Reports and language

- [Excel workbook export](https://github.com/orkhankhalilzade/agro-food-investments/blob/main/export_xlsx.py): `export_xlsx.py`
- [English and Azerbaijani](https://github.com/orkhankhalilzade/agro-food-investments/blob/main/i18n.py): `i18n.py`

### Other components

- **Planner user**

## Connections

- Planner user → Operation entry: enters operation (evidence: `app.py`)
- Operation entry → Orchard programs: loads program data (evidence: `app.py`)
- Orchard programs → Orchard data: reads (evidence: `core.py`)
- Operation entry → Operation validation: validates operations (evidence: `app.py`)
- Operation entry → Cost calculations: calculates results (evidence: `app.py`)
- Operation entry → Cost results: shows results (evidence: `app.py`)
- Operation entry → Weekly operations: manages operations (evidence: `app.py`)
- Weekly operations → Summary and status: summarizes operations (evidence: `app.py`)
- Summary and status → Operation validation: computes operations (evidence: `core.py`)
- Operation validation → Cost calculations: calculates (evidence: `core.py`)
- Operation entry → Machinery inventory: edits inventory (evidence: `app.py`)
- Operation entry → Save and load: imports and exports state (evidence: `app.py`)
- Save and load → State serialization: serializes state (evidence: `app.py`)
- Operation entry → English and Azerbaijani: translates labels (evidence: `app.py`)
- Operation entry → Excel workbook export: requests workbook (evidence: `app.py`)
- Excel workbook export → Operation validation: uses operation data (evidence: `export_xlsx.py`)
- Excel workbook export → Cost calculations: uses calculations (evidence: `export_xlsx.py`)
- Planner user → Weekly operations: reviews operations (evidence: `app.py`)
