# vv3705029/forestary architecture

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

- Interactive diagram: https://gitdiagram.com/vv3705029/forestary
- Repository: https://github.com/vv3705029/forestary

## Overview

Planetary is an environmental monitoring application with two distinct user workflows: forest assessment from coordinates or uploaded satellite imagery, and wildfire-risk prediction from a location and date. The frontend provides the entry point and result views; an Express API routes requests to satellite imagery, weather data, and separate image- and fire-model services. The forest dashboard in App.jsx also contains a simulated satellite response, so it should not be mistaken for the backend inference path. Source excerpts establish the main routes and calls; other connections are omitted where wiring was not shown.

Main entry points: [`frontend/src/services/api.js`](https://github.com/vv3705029/forestary/blob/main/frontend/src/services/api.js) (API client), [`backend/server.js`](https://github.com/vv3705029/forestary/blob/main/backend/server.js) (Satellite route), [`frontend/src/main.jsx`](https://github.com/vv3705029/forestary/blob/main/frontend/src/main.jsx) (React entry), [`frontend/src/App.jsx`](https://github.com/vv3705029/forestary/blob/main/frontend/src/App.jsx) (Monitoring dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["User interface"]
  node_entry["React entry<br/>[main.jsx]"]
  node_app["Monitoring dashboard<br/>[App.jsx]"]
  node_upload["Image upload<br/>[FileUpload.jsx]"]
  node_fireui["Fire prediction UI<br/>[FirePrediction.jsx]"]
end

subgraph group_api["API orchestration"]
  node_api_client["API client<br/>[api.js]"]
  node_express["Express API<br/>[server.js]"]
end

subgraph group_forest["Forest assessment"]
  node_sat_route["Satellite route<br/>[server.js]"]
  node_image_route["Image prediction route<br/>[server.js]"]
  node_forest_model["Image classifier<br/>[app.py]"]
  node_satellite["ESRI imagery"]
end

subgraph group_fire["Wildfire risk"]
  node_fire_route["Fire-risk route<br/>[server.js]"]
  node_weather["WeatherAPI"]
  node_fire_model["Risk model API<br/>[app.py]"]
end

node_user(("User"))

node_user -->|"opens app"| node_entry
node_entry -->|"renders"| node_app
node_app -->|"renders"| node_fireui
node_upload -->|"requests analysis"| node_api_client
node_fireui -->|"requests risk"| node_api_client
node_api_client -->|"GET tile"| node_sat_route
node_api_client -->|"uploads image"| node_image_route
node_api_client -->|"POST risk"| node_fire_route
node_sat_route -->|"fetches tile"| node_satellite
node_sat_route -->|"forwards tile"| node_image_route
node_image_route -->|"forwards image"| node_forest_model
node_fire_route -->|"fetches conditions"| node_weather
node_fire_route -->|"sends features"| node_fire_model

click node_entry "https://github.com/vv3705029/forestary/blob/main/frontend/src/main.jsx"
click node_app "https://github.com/vv3705029/forestary/blob/main/frontend/src/App.jsx"
click node_upload "https://github.com/vv3705029/forestary/blob/main/frontend/src/components/FileUpload.jsx"
click node_fireui "https://github.com/vv3705029/forestary/blob/main/frontend/src/components/FirePrediction.jsx"
click node_api_client "https://github.com/vv3705029/forestary/blob/main/frontend/src/services/api.js"
click node_express "https://github.com/vv3705029/forestary/blob/main/backend/server.js"
click node_sat_route "https://github.com/vv3705029/forestary/blob/main/backend/server.js"
click node_image_route "https://github.com/vv3705029/forestary/blob/main/backend/server.js"
click node_forest_model "https://github.com/vv3705029/forestary/blob/main/deforestModel/app.py"
click node_fire_route "https://github.com/vv3705029/forestary/blob/main/backend/server.js"
click node_fire_model "https://github.com/vv3705029/forestary/blob/main/fireModel/app.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_entry,node_app,node_upload,node_fireui,node_user toneBlue
class node_api_client,node_express toneAmber
class node_sat_route,node_image_route,node_forest_model,node_satellite toneMint
class node_fire_route,node_weather,node_fire_model toneRose
```

## Components

### User interface

- [React entry](https://github.com/vv3705029/forestary/blob/main/frontend/src/main.jsx): `frontend/src/main.jsx`
- [Monitoring dashboard](https://github.com/vv3705029/forestary/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Image upload](https://github.com/vv3705029/forestary/blob/main/frontend/src/components/FileUpload.jsx): `frontend/src/components/FileUpload.jsx`
- [Fire prediction UI](https://github.com/vv3705029/forestary/blob/main/frontend/src/components/FirePrediction.jsx): `frontend/src/components/FirePrediction.jsx`

### API orchestration

- [API client](https://github.com/vv3705029/forestary/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`
- [Express API](https://github.com/vv3705029/forestary/blob/main/backend/server.js): `backend/server.js`

### Forest assessment

- [Satellite route](https://github.com/vv3705029/forestary/blob/main/backend/server.js): `backend/server.js`
- [Image prediction route](https://github.com/vv3705029/forestary/blob/main/backend/server.js): `backend/server.js`
- [Image classifier](https://github.com/vv3705029/forestary/blob/main/deforestModel/app.py): `deforestModel/app.py`
- **ESRI imagery**

### Wildfire risk

- [Fire-risk route](https://github.com/vv3705029/forestary/blob/main/backend/server.js): `backend/server.js`
- **WeatherAPI**
- [Risk model API](https://github.com/vv3705029/forestary/blob/main/fireModel/app.py): `fireModel/app.py`

### Other components

- **User**

## Connections

- User → React entry: opens app (evidence: `frontend/src/main.jsx`)
- React entry → Monitoring dashboard: renders (evidence: `frontend/src/main.jsx`)
- Monitoring dashboard → Fire prediction UI: renders (evidence: `frontend/src/App.jsx`)
- Image upload → API client: requests analysis (evidence: `frontend/src/components/FileUpload.jsx`)
- Fire prediction UI → API client: requests risk (evidence: `frontend/src/components/FirePrediction.jsx`)
- API client → Satellite route: GET tile (evidence: `frontend/src/services/api.js`)
- API client → Image prediction route: uploads image (evidence: `frontend/src/services/api.js`)
- API client → Fire-risk route: POST risk (evidence: `frontend/src/services/api.js`)
- Satellite route → ESRI imagery: fetches tile (evidence: `backend/server.js`)
- Satellite route → Image prediction route: forwards tile (evidence: `backend/server.js`)
- Image prediction route → Image classifier: forwards image (evidence: `backend/server.js`)
- Fire-risk route → WeatherAPI: fetches conditions (evidence: `backend/server.js`)
- Fire-risk route → Risk model API: sends features (evidence: `backend/server.js`)
