# indigowizard/wildfire-burn-severity architecture

> Architecture diagram of the GitHub repository indigowizard/wildfire-burn-severity, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-09-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/indigowizard/wildfire-burn-severity
- Repository: https://github.com/indigowizard/wildfire-burn-severity

## Overview

##### Project type and purpose
- This is a single-page web application built with Streamlit.

##### File structure
- Top-level:
- .github (CI/docs)
- .streamlit/config.toml (Streamlit settings)
- app.py (entry point for Streamlit UI)
- requirements.txt (Python dependencies)
- src/ (helper modules and assets, including the GIF preview)
- No separate “frontend” vs. “backend” folders—both UI and business logic live in app.py and src/.
- External configuration (.streamlit) and standard Python packaging files (.gitignore, LICENSE).

##### README for additional insights
- Confirms use of Streamlit, GEE Python API, geemap, Folium.
- Describes user workflows: upload GeoJSON or click map, select dates/cloud filter, view map layers via Layer Control.
- Mentions two versions (Streamlit is primary).

##### How to represent this architecture

a. Main components
1. Streamlit Frontend (app.py)
2. Business Logic / Data Processing (modules under src/)
3. External Service: Google Earth Engine API
4. Visualization Libraries: geemap, Folium
5. Environment / Runtime: Python 3.x container or VM (with dependencies from requirements.txt)
6. (Optional) Configuration: .streamlit/config.toml

b. Relationships & data flows
- User interacts with the Streamlit UI →
- UI passes parameters to processing modules →
- Processing modules call GEE API →
- GEE returns satellite imagery (ImageCollections) →
- Modules compute NBR/NDWI indices →
- Modules feed results to geemap/Folium to build map layers →
- Streamlit renders the interactive map back to the user

c. Architectural patterns & design principles
- Monolithic single‐process application (no microservices).
- Clear separation of concerns:
- Presentation layer (Streamlit)
- Domain layer (NBR/NDWI calculations in src/)
- External data layer (GEE API)
- Dependency management via requirements.txt

d. Key technologies & frameworks
- Frontend/UI: Streamlit
- Mapping/Visualization: geemap, Folium
- Data service: Google Earth Engine Python API
- Supporting libs: geopandas (for GeoJSON), numpy, pandas (if used)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User and UI
    User["User Browser"]:::external
    subgraph "UI Layer"
        UI["Streamlit UI (app.py)"]:::ui
        Config["Streamlit Config (.streamlit/config.toml)"]:::config
    end

    %% Application Processing Layer
    subgraph "Application Layer"
        Input["Input Handler (GeoJSON upload/map click)"]:::processing
        Params["Parameter Processor (dates, cloud threshold)"]:::processing
        GEEWrapper["GEE Client Wrapper (src/)"]:::processing
        IndexCalc["Index Calculator (NBR & NDWI)"]:::processing
        MapCompose["Map Composer (geemap & Folium)"]:::processing
    end

    %% External Services
    ExternalService["Google Earth Engine API"]:::external

    %% Environment and Dependencies
    subgraph "Environment & Dependencies"
        Env["Python 3.x Env (requirements.txt)"]:::config
    end

    %% Documentation & CI
    subgraph "Documentation & CI"
        Readme["README.md"]:::docs
        CI[".github/"]:::docs
        License["LICENSE"]:::docs
    end

    %% Data Flow
    User --> UI
    UI --> Input
    Input --> Params
    Params --> GEEWrapper
    GEEWrapper --> ExternalService
    ExternalService --> GEEWrapper
    GEEWrapper --> IndexCalc
    IndexCalc --> MapCompose
    MapCompose --> UI

    %% Auxiliary Connections
    UI --- Config
    Env --> UI
    Env --> Input
    Env --> Params
    Env --> GEEWrapper
    Env --> IndexCalc
    Env --> MapCompose
    Readme -.-> UI
    CI -.-> UI
    License -.-> UI

    %% Click Events
    click UI "https://github.com/indigowizard/wildfire-burn-severity/blob/streamlit-app/app.py"
    click GEEWrapper "https://github.com/indigowizard/wildfire-burn-severity/tree/streamlit-app/src/"
    click Config "https://github.com/indigowizard/wildfire-burn-severity/blob/streamlit-app/.streamlit/config.toml"
    click Env "https://github.com/indigowizard/wildfire-burn-severity/blob/streamlit-app/requirements.txt"
    click Readme "https://github.com/indigowizard/wildfire-burn-severity/blob/streamlit-app/README.md"
    click CI "https://github.com/indigowizard/wildfire-burn-severity/tree/streamlit-app/.github/"
    click License "https://github.com/indigowizard/wildfire-burn-severity/tree/streamlit-app/LICENSE"

    %% Styles
    classDef ui fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef processing fill:#90EE90,stroke:#000,stroke-width:1px
    classDef external fill:#FFA500,stroke:#000,stroke-width:1px
    classDef config fill:#D3D3D3,stroke:#000,stroke-width:1px
    classDef docs fill:#DDA0DD,stroke:#000,stroke-width:1px
```
