# fibananagucchi/terraaudittest architecture

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

- Interactive diagram: https://gitdiagram.com/fibananagucchi/terraaudittest
- Repository: https://github.com/fibananagucchi/terraaudittest

## Overview

TerraAudit is a Streamlit application for municipal land-asset auditing. A user selects or draws a parcel, reviews satellite indicators and a monetization score, compares the price corridor with auction data, and can produce a budget allocation, investment teaser, or PDF report. The dashboard also supports year comparisons and ranked multi-parcel analysis. The graph reflects documented capabilities and indexed module references; some UI-to-module calls and external-service wiring are not visible in the sampled excerpts, so those links are documented or marked unverified.

Main entry points: [`app.py`](https://github.com/fibananagucchi/terraaudittest/blob/main/app.py) (Streamlit dashboard), [`geoai_engine.py`](https://github.com/fibananagucchi/terraaudittest/blob/main/geoai_engine.py) (Satellite analysis), [`price_corridor.py`](https://github.com/fibananagucchi/terraaudittest/blob/main/price_corridor.py) (Price corridor), [`prozorro.py`](https://github.com/fibananagucchi/terraaudittest/blob/main/prozorro.py) (Auction data client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard and analysis"]
  node_dashboard["Streamlit dashboard<br/>[app.py]"]
  node_parcel_tools["Parcel mapping and batch<br/>[app.py]"]
  node_asset_scoring["Asset score and comparison<br/>[analysis.py]"]
end

subgraph group_geospatial["Satellite intelligence"]
  node_geoai["Satellite analysis<br/>[geoai_engine.py]"]
  node_gee{{"Google Earth Engine"}}
  node_nominatim{{"Nominatim geocoding"}}
end

subgraph group_markets["Market valuation"]
  node_price_corridor["Price corridor<br/>[price_corridor.py]"]
  node_prozorro_client["Auction data client<br/>[prozorro.py]"]
  node_prozorro_api{{"Prozorro.Sale API"}}
  node_nbu{{"NBU exchange rates"}}
end

subgraph group_outputs["Planning and reporting"]
  node_budget_optimizer["Budget optimizer"]
  node_teaser["Investment teaser<br/>[llm_teaser.py]"]
  node_groq{{"Groq language model"}}
  node_pdf_report["PDF report<br/>[report.py]"]
end

node_municipality_user(("Municipal user"))

node_municipality_user -->|"uses"| node_dashboard
node_dashboard -->|"renders"| node_parcel_tools
node_parcel_tools -.->|"requests parcel analysis"| node_geoai
node_dashboard -->|"requests satellite data"| node_geoai
node_geoai -->|"queries imagery"| node_gee
node_geoai -->|"geocodes addresses"| node_nominatim
node_dashboard -->|"scores parcels"| node_asset_scoring
node_dashboard -->|"requests valuation"| node_price_corridor
node_price_corridor -->|"fetches auctions"| node_prozorro_client
node_prozorro_client -->|"fetches lots"| node_prozorro_api
node_price_corridor -->|"gets exchange rate"| node_nbu
node_dashboard -->|"optimizes allocation"| node_budget_optimizer
node_dashboard -->|"generates teaser"| node_teaser
node_teaser -->|"generates text"| node_groq
node_dashboard -->|"generates report"| node_pdf_report

click node_dashboard "https://github.com/fibananagucchi/terraaudittest/blob/main/app.py"
click node_parcel_tools "https://github.com/fibananagucchi/terraaudittest/blob/main/app.py"
click node_asset_scoring "https://github.com/fibananagucchi/terraaudittest/blob/main/analysis.py"
click node_geoai "https://github.com/fibananagucchi/terraaudittest/blob/main/geoai_engine.py"
click node_price_corridor "https://github.com/fibananagucchi/terraaudittest/blob/main/price_corridor.py"
click node_prozorro_client "https://github.com/fibananagucchi/terraaudittest/blob/main/prozorro.py"
click node_budget_optimizer "https://github.com/fibananagucchi/terraaudittest/blob/main/budget_optimizer.py"
click node_teaser "https://github.com/fibananagucchi/terraaudittest/blob/main/llm_teaser.py"
click node_pdf_report "https://github.com/fibananagucchi/terraaudittest/blob/main/report.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_dashboard,node_parcel_tools,node_asset_scoring,node_municipality_user toneBlue
class node_geoai,node_gee,node_nominatim toneAmber
class node_price_corridor,node_prozorro_client,node_prozorro_api,node_nbu toneMint
class node_budget_optimizer,node_teaser,node_groq,node_pdf_report toneRose
```

## Components

### Dashboard and analysis

- [Streamlit dashboard](https://github.com/fibananagucchi/terraaudittest/blob/main/app.py): `app.py`
- [Parcel mapping and batch](https://github.com/fibananagucchi/terraaudittest/blob/main/app.py): `app.py`
- [Asset score and comparison](https://github.com/fibananagucchi/terraaudittest/blob/main/analysis.py): `analysis.py`

### Satellite intelligence

- [Satellite analysis](https://github.com/fibananagucchi/terraaudittest/blob/main/geoai_engine.py): `geoai_engine.py`
- **Google Earth Engine**
- **Nominatim geocoding**

### Market valuation

- [Price corridor](https://github.com/fibananagucchi/terraaudittest/blob/main/price_corridor.py): `price_corridor.py`
- [Auction data client](https://github.com/fibananagucchi/terraaudittest/blob/main/prozorro.py): `prozorro.py`
- **Prozorro.Sale API**
- **NBU exchange rates**

### Planning and reporting

- [Budget optimizer](https://github.com/fibananagucchi/terraaudittest/blob/main/budget_optimizer.py): `budget_optimizer.py`
- [Investment teaser](https://github.com/fibananagucchi/terraaudittest/blob/main/llm_teaser.py): `llm_teaser.py`
- **Groq language model**
- [PDF report](https://github.com/fibananagucchi/terraaudittest/blob/main/report.py): `report.py`

### Other components

- **Municipal user**

## Connections

- Municipal user → Streamlit dashboard: uses (evidence: `README.md`)
- Streamlit dashboard → Parcel mapping and batch: renders (evidence: `README.md`)
- Parcel mapping and batch → Satellite analysis: requests parcel analysis (evidence: `app.py`)
- Streamlit dashboard → Satellite analysis: requests satellite data (evidence: `app.py`)
- Satellite analysis → Google Earth Engine: queries imagery (evidence: `README.md`)
- Satellite analysis → Nominatim geocoding: geocodes addresses (evidence: `README.md`)
- Streamlit dashboard → Asset score and comparison: scores parcels (evidence: `app.py`)
- Streamlit dashboard → Price corridor: requests valuation (evidence: `app.py`)
- Price corridor → Auction data client: fetches auctions (evidence: `price_corridor.py`)
- Auction data client → Prozorro.Sale API: fetches lots (evidence: `README.md`)
- Price corridor → NBU exchange rates: gets exchange rate (evidence: `README.md`)
- Streamlit dashboard → Budget optimizer: optimizes allocation (evidence: `README.md`)
- Streamlit dashboard → Investment teaser: generates teaser (evidence: `README.md`)
- Investment teaser → Groq language model: generates text (evidence: `llm_teaser.py`)
- Streamlit dashboard → PDF report: generates report (evidence: `README.md`)
