# hissyam90/kalimantan-wildfire-hotspot-detection architecture

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

- Interactive diagram: https://gitdiagram.com/hissyam90/kalimantan-wildfire-hotspot-detection
- Repository: https://github.com/hissyam90/kalimantan-wildfire-hotspot-detection

## Overview

Wildfire WebGIS supports two user workflows: viewing regional hotspot, weather and wind context on an interactive map, and uploading an image for CNN-based verification. The map view also summarizes hotspot confidence and hourly distribution, and visualizes smoke movement using wind data. The backend fetches NASA FIRMS and OpenWeatherMap data and serves both endpoints; image prediction is dispatched to a Python inference script. The evidence shows these main calls and data flows, but not every deployment or runtime detail.

Main entry points: [`frontend/src/HotspotMap.jsx`](https://github.com/hissyam90/kalimantan-wildfire-hotspot-detection/blob/main/frontend/src/HotspotMap.jsx) (Map and statistics), [`backend/server.js`](https://github.com/hissyam90/kalimantan-wildfire-hotspot-detection/blob/main/backend/server.js) (API server), [`backend/python/infer.py`](https://github.com/hissyam90/kalimantan-wildfire-hotspot-detection/blob/main/backend/python/infer.py) (CNN inference), [`frontend/src/App.jsx`](https://github.com/hissyam90/kalimantan-wildfire-hotspot-detection/blob/main/frontend/src/App.jsx) (Application shell)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web interface"]
  node_app["Application shell<br/>[App.jsx]"]
  node_hotspot_map["Map and statistics<br/>[HotspotMap.jsx]"]
  node_smoke_overlay["Smoke overlay<br/>[SmokeOverlay.jsx]"]
  node_image_verification["Image verification"]
end

subgraph group_backend["API services"]
  node_api_server["API server<br/>[server.js]"]
  node_hotspots_api["Hotspot endpoint<br/>[hotspots.js]"]
  node_wind_api["Wind endpoint<br/>[wind.js]"]
end

subgraph group_inference["Image inference"]
  node_inference_script["CNN inference<br/>[infer.py]"]
  node_cnn_model["Wildfire model<br/>[wildfire_model.h5]"]
  node_class_labels["Class labels<br/>[labels.json]"]
end

subgraph group_external["External data"]
  node_nasa_firms["NASA FIRMS"]
  node_open_weather["OpenWeatherMap"]
  node_open_street_map["OpenStreetMap tiles"]
end

node_user(("Web user"))

node_user -->|"uses"| node_app
node_app -->|"renders"| node_hotspot_map
node_app -->|"renders"| node_image_verification
node_hotspot_map -->|"requests hotspots"| node_hotspots_api
node_hotspot_map -->|"requests wind"| node_wind_api
node_hotspot_map -->|"renders overlay"| node_smoke_overlay
node_hotspot_map -->|"loads tiles"| node_open_street_map
node_image_verification -->|"uploads image"| node_api_server
node_api_server -->|"routes request"| node_hotspots_api
node_api_server -->|"routes request"| node_wind_api
node_hotspots_api -->|"fetches detections"| node_nasa_firms
node_wind_api -->|"fetches weather"| node_open_weather
node_api_server -->|"spawns process"| node_inference_script
node_inference_script -->|"loads model"| node_cnn_model
node_inference_script -->|"reads labels"| node_class_labels
node_inference_script -->|"returns prediction"| node_api_server

click node_app "https://github.com/hissyam90/kalimantan-wildfire-hotspot-detection/blob/main/frontend/src/App.jsx"
click node_hotspot_map "https://github.com/hissyam90/kalimantan-wildfire-hotspot-detection/blob/main/frontend/src/HotspotMap.jsx"
click node_smoke_overlay "https://github.com/hissyam90/kalimantan-wildfire-hotspot-detection/blob/main/frontend/src/SmokeOverlay.jsx"
click node_image_verification "https://github.com/hissyam90/kalimantan-wildfire-hotspot-detection/blob/main/frontend/src/ImageVerification.jsx"
click node_api_server "https://github.com/hissyam90/kalimantan-wildfire-hotspot-detection/blob/main/backend/server.js"
click node_hotspots_api "https://github.com/hissyam90/kalimantan-wildfire-hotspot-detection/blob/main/backend/routes/hotspots.js"
click node_wind_api "https://github.com/hissyam90/kalimantan-wildfire-hotspot-detection/blob/main/backend/routes/wind.js"
click node_inference_script "https://github.com/hissyam90/kalimantan-wildfire-hotspot-detection/blob/main/backend/python/infer.py"
click node_cnn_model "https://github.com/hissyam90/kalimantan-wildfire-hotspot-detection/blob/main/backend/model/wildfire_model.h5"
click node_class_labels "https://github.com/hissyam90/kalimantan-wildfire-hotspot-detection/blob/main/backend/model/labels.json"

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_hotspot_map,node_smoke_overlay,node_image_verification,node_user toneBlue
class node_api_server,node_hotspots_api,node_wind_api toneAmber
class node_inference_script,node_cnn_model,node_class_labels toneMint
class node_nasa_firms,node_open_weather,node_open_street_map toneRose
```

## Components

### Web interface

- [Application shell](https://github.com/hissyam90/kalimantan-wildfire-hotspot-detection/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Map and statistics](https://github.com/hissyam90/kalimantan-wildfire-hotspot-detection/blob/main/frontend/src/HotspotMap.jsx): `frontend/src/HotspotMap.jsx`
- [Smoke overlay](https://github.com/hissyam90/kalimantan-wildfire-hotspot-detection/blob/main/frontend/src/SmokeOverlay.jsx): `frontend/src/SmokeOverlay.jsx`
- [Image verification](https://github.com/hissyam90/kalimantan-wildfire-hotspot-detection/blob/main/frontend/src/ImageVerification.jsx): `frontend/src/ImageVerification.jsx`

### API services

- [API server](https://github.com/hissyam90/kalimantan-wildfire-hotspot-detection/blob/main/backend/server.js): `backend/server.js`
- [Hotspot endpoint](https://github.com/hissyam90/kalimantan-wildfire-hotspot-detection/blob/main/backend/routes/hotspots.js): `backend/routes/hotspots.js`
- [Wind endpoint](https://github.com/hissyam90/kalimantan-wildfire-hotspot-detection/blob/main/backend/routes/wind.js): `backend/routes/wind.js`

### Image inference

- [CNN inference](https://github.com/hissyam90/kalimantan-wildfire-hotspot-detection/blob/main/backend/python/infer.py): `backend/python/infer.py`
- [Wildfire model](https://github.com/hissyam90/kalimantan-wildfire-hotspot-detection/blob/main/backend/model/wildfire_model.h5): `backend/model/wildfire_model.h5`
- [Class labels](https://github.com/hissyam90/kalimantan-wildfire-hotspot-detection/blob/main/backend/model/labels.json): `backend/model/labels.json`

### External data

- **NASA FIRMS**
- **OpenWeatherMap**
- **OpenStreetMap tiles**

### Other components

- **Web user**

## Connections

- Web user → Application shell: uses (evidence: `frontend/src/App.jsx`)
- Application shell → Map and statistics: renders (evidence: `frontend/src/App.jsx`)
- Application shell → Image verification: renders (evidence: `frontend/src/App.jsx`)
- Map and statistics → Hotspot endpoint: requests hotspots (evidence: `frontend/src/HotspotMap.jsx`)
- Map and statistics → Wind endpoint: requests wind (evidence: `frontend/src/HotspotMap.jsx`)
- Map and statistics → Smoke overlay: renders overlay (evidence: `frontend/src/HotspotMap.jsx`)
- Map and statistics → OpenStreetMap tiles: loads tiles (evidence: `frontend/src/HotspotMap.jsx`)
- Image verification → API server: uploads image (evidence: `frontend/src/ImageVerification.jsx`)
- API server → Hotspot endpoint: routes request (evidence: `backend/server.js`)
- API server → Wind endpoint: routes request (evidence: `backend/server.js`)
- Hotspot endpoint → NASA FIRMS: fetches detections (evidence: `backend/routes/hotspots.js`)
- Wind endpoint → OpenWeatherMap: fetches weather (evidence: `backend/routes/wind.js`)
- API server → CNN inference: spawns process (evidence: `backend/server.js`)
- CNN inference → Wildfire model: loads model (evidence: `backend/python/infer.py`)
- CNN inference → Class labels: reads labels (evidence: `backend/python/infer.py`)
- CNN inference → API server: returns prediction (evidence: `backend/server.js`)
