AWS Builder Center

ThermaGuard : Building an Urban Heat Risk and Mitigation Planning Platform

How we built ThermaGuard , a platform for exploring urban heat indicators, evaluating mitigation scenarios under a budget, and saving action plans using React, FastAPI, and SQLAlchemy. We also explore our AWS SAM CLI workflow and the challenges of building a reliable, data-transparent prototype.

ThermaGuard: Building an Urban Heat Risk and Mitigation Planning Platform

Introduction

Urban heat is an increasingly important challenge for cities. Dense construction, limited vegetation, insufficient shade, and heat-retaining surfaces can make some neighbourhoods more exposed to heat than others.
Understanding these patterns is only the first step. Communities and planners also need practical ways to explore possible interventions, compare costs, and make informed decisions when budgets are limited.
This is the problem we are exploring with ThermaGuard, our project developed for Environmental Hacks by WeMakeDevs in the Heat and Water track.
ThermaGuard is an urban heat exploration and mitigation planning platform designed to connect available heat-related indicators with transparent, budget-aware planning.

The Problem

Urban heat information is not always easy to translate into actionable decisions. A single air-temperature reading cannot fully explain neighbourhood heat exposure, and proposed interventions must be evaluated against their costs, feasibility, and limitations.
We wanted to create a platform that helps users:
  • Explore selected urban zones through an interactive interface.
  • Understand available heat-related indicators and data limitations.
  • Evaluate potential interventions such as tree planting, cool roofs, and shade structures.
  • Compare intervention costs against a defined budget.
  • Save and review mitigation action plans.
Our goal was to build a practical prototype without presenting incomplete data or experimental calculations as established scientific conclusions.

Introducing ThermaGuard

ThermaGuard brings urban zone exploration, heat-risk assessment, and mitigation planning into a single workflow.

1. Urban Zone Exploration

Users can explore selected demonstration zones in Delhi NCR and inspect the information available for each location.
The platform distinguishes demonstration data from verified measurements. When reliable indicators are unavailable, the system communicates that limitation instead of inventing values.

2. Explainable Heat-Risk Assessment

ThermaGuard includes a deterministic risk-scoring engine that considers inputs such as air temperature, land surface temperature, vegetation coverage, shade coverage, and a vulnerability index.
The backend validates these inputs and avoids generating a numerical score when required indicators are missing.
This design helps users understand that air temperature, land surface temperature, and human heat exposure are related but different concepts.
The scoring model is experimental and has not been scientifically or publicly validated. Its output should not be treated as an official heat-risk or public-health assessment.

3. Budget-Aware Mitigation Planning

ThermaGuard allows users to evaluate intervention combinations against a budget.
The current implementation supports scenarios involving:
  • Tree planting
  • Cool roofs
  • Shade structures
The backend calculates estimated costs, checks budget feasibility, and reports the remaining budget. The benefits and limitations of interventions are communicated qualitatively rather than through unsupported claims about temperature reduction.
Users can also save action plans for later review.

Technology Stack

We chose technologies that support a clear separation between the frontend, backend application logic, and data persistence.
Component
Technology
Purpose
Frontend
React and Vite
Interactive user interface
Mapping
Leaflet
Geographic exploration
Backend
Python and FastAPI
API endpoints and business logic
Validation
Pydantic
Request and response validation
Database access
SQLAlchemy
Database models and persistence
Database
SQLite
Local persistence for action plans
Weather integration
Open-Meteo
Access to weather observations
AWS development tooling
AWS SAM CLI and Docker
Local serverless development workflow
The React frontend communicates with the FastAPI backend through HTTP APIs. The backend separates routes, schemas, services, and database models to make the codebase easier to understand, test, and maintain.

Building the Backend

We developed the backend incrementally, adding individual services and testing them as the application evolved.

Weather Integration

ThermaGuard integrates with the Open-Meteo API to retrieve available weather observations, including temperature, apparent temperature, and humidity.
External API calls can fail or return incomplete information, so the application must handle missing observations without fabricating data.
Weather observations are kept separate from neighbourhood-level indicators to avoid treating a current weather reading as a complete representation of local heat conditions.

Zone APIs

The backend provides endpoints for listing demonstration zones and retrieving details for an individual zone.
Zone information includes metadata about data availability and provenance. This distinction is important because demonstration locations do not automatically have verified measurements for every indicator required by the risk model.

Risk-Scoring Service

We implemented an explainable, deterministic scoring engine rather than relying on an opaque model or claiming that an unvalidated AI system could accurately predict neighbourhood heat risk.
The engine applies documented adjustments to available inputs and validates their permitted ranges. If required indicators are missing, the system reports insufficient data instead of returning a misleading numerical score.
This makes the model easier to inspect and test, while leaving scientific validation as a necessary future step.

Intervention Scenarios

The scenario service evaluates proposed interventions using illustrative unit costs.
For example, a user can allocate a hypothetical budget between tree planting and cool-roof coverage. The backend calculates the estimated total, checks whether the plan fits the budget, and reports the remaining amount.
These costs are planning assumptions rather than verified local market quotations. The current model also does not claim a measured cooling effect or a guaranteed reduction in heat risk.

Saving Action Plans

We integrated SQLAlchemy with SQLite to support database-backed action plans.
Before saving a plan, the backend evaluates the proposed scenario and independently checks its feasibility. This prevents the application from blindly trusting cost totals or feasibility results supplied by the frontend.
The current database configuration supports local development. A hosted production environment would require an explicit persistence strategy, appropriate database configuration, and backups.

Exploring AWS SAM CLI

An important part of our hackathon work is exploring AWS open-source development tooling.
The AWS Serverless Application Model Command Line Interface (AWS SAM CLI) is designed to help developers build, test, and locally run applications intended for AWS serverless services, including AWS Lambda.
Docker can provide the container environment used by supported SAM local workflows.
For ThermaGuard, it is important to distinguish local development tooling from cloud deployment. Our current application has not been deployed to AWS cloud infrastructure, and local execution should not be represented as a completed AWS production deployment.
Any serverless integration
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article