AWS Builder Center
Building Arise: A Serverless Air-Quality Assistant on AWS

Building Arise: A Serverless Air-Quality Assistant on AWS

How I built Arise for Environmental Hacks: a Delhi-NCR air-quality assistant on AWS using Lambda, API Gateway, DynamoDB, EventBridge, and Gemini.

Series: My Projects (2 articles)

  1. 1
    Building Arise: A Serverless Air-Quality Assistant on AWS This article
Aspiring SDE

Building Arise: A Serverless Air-Quality

Assistant on AWS

Air-quality apps can tell us that the air is unhealthy. The harder question is what that number means for a real decision: Can a child play outside? Is a morning run a good idea? Should a school change its outdoor activity plan?
That gap between a measurement and a decision is what I wanted to work on with Arise, an environmental intelligence platform built for Delhi-NCR. I developed it for the Air track of WeMakeDevs’ Environmental Hacks, part of the Bharat Builds Tour taking place from October 8–11, 2026. The goal was not to make yet another dashboard full of charts; it was to turn environmental signals into understandable, appropriately cautious guidance.

Watch the Arise Demo

Watch the short demo to see Arise in action, explore its key features, and understand how the AWS serverless architecture brings the platform together.
Project links

The problem: a number is not a plan

An AQI number alone does not explain what someone should do next. The same conditions can call for different precautions depending on whether the person is a child, an older adult, someone with asthma, an outdoor worker, or a runner planning a high-exertion workout. A city-wide reading also cannot represent every neighbourhood equally well, and a weather forecast tells only part of the environmental story.
Arise brings these signals into one interface and presents a practical decision summary. Its Today dashboard puts the current environmental picture and recommended next step up front. The app also includes an interactive map, forecast views, pollutant details, school and personal advisories, and an Ask Arise assistant for plain-language questions.
The four core decision labels are GO, BE SMART, CUT BACK, and STAY IN. They are produced by deterministic application logic using CPCB-style National Air Quality Index breakpoints and persona-specific thresholds—not by asking a language model to invent a safety verdict.
The platform provides general environmental guidance, not medical advice, and upstream data availability can vary by source and location.

Combining ground readings, weather, and satellite signals

Arise integrates three main external data sources:
  • OpenAQ: Ground-monitoring observations used to understand regional air quality.
  • Open-Meteo: Weather and forecast information, including wind and hourly conditions that affect the context for outdoor activity.
  • NASA FIRMS: Satellite thermal-anomaly detections that can add regional fire-signal context.
Where enough station observations are available, the backend uses inverse-distance weighting (IDW) to estimate a location-aware picture from multiple monitoring stations, with a minimum three-station requirement described in the project methodology. Pollutant sub-indices are evaluated with CPCB-style breakpoints, then the verdict engine combines the resulting air-quality category with the selected persona and relevant weather and forecast information.
The fire layer is deliberately described as a signal or thermal anomaly. A satellite detection is useful context; by itself, it does not prove the source of pollution at a particular location. The interface is designed to show data provenance and distinguish fallback or demo values where those are used. The traffic and indoor-environment panels contain labelled demo data rather than being presented as comprehensive live sensor networks.

Ask Arise: language assistance, not the source of truth

Environmental information can be difficult to interpret quickly, so Arise includes Ask Arise, a conversational assistant designed to answer questions such as “Can my kid play outside?” or “Why is the AQI bad today?”
The production configuration uses Google Gemini ( gemini-3.5-flash-lite ) through the  google-genai  SDK. The backend supplies environmental context and uses structured responses, domain guardrails, and a two-stage critic/evaluation step described in the project documentation. If the model is unavailable or times out, a deterministic rule-based fallback can still return a structured environmental verdict.
One of my important design decisions was to keep the deterministic verdict engine separate from the language model. The model can help explain the available context in plain language, but the basic air-quality category and decision rules should remain testable application logic. This separation also makes provider changes less invasive than coupling the entire product to one model API.

The AWS architecture

I deployed Arise as a serverless application so that the web interface, API processing, scheduled ingestion, persistence, and identity layer could evolve independently.

The request path

  1. AWS Amplify Hosting serves the React 19/Vite single-page application over HTTPS.
  1. Amazon API Gateway HTTP API provides the public API entry point and applies the configured CORS allowlist.
  1. AWS Lambda runs the Python 3.12 backend, built with FastAPI and adapted for Lambda using Mangum.
  1. The API Lambda reads and writes environmental cache records in Amazon DynamoDB and retrieves the Gemini credential from AWS Secrets Manager when needed.
  1. The assistant calls the Google Gemini API for language synthesis, with the deterministic fallback available for resilience.

Background ingestion every 30 minutes

A second Lambda function runs the environmental ingestion pipeline. Amazon EventBridge Scheduler invokes it on a  rate(30 minutes)  schedule defined in   infra/template.yaml  .
The ingestion code requests the environmental snapshot, normalizes the result through the shared service layer, and stores a cache entry in DynamoDB with a time-to-live (TTL) value. This reduces the need to repeat the same ingestion work for every user request.

Persistence, identity, and deployment

Arise uses two DynamoDB tables with on-demand billing: one for cached environmental data, with TTL-based expiry, and another for user-profile data, with server-side encryption enabled.
Amazon Cognito supports the identity flow and access-token validation for protected profile routes. The repository contains the Google identity-provider and PKCE integration, although a complete manual end-to-end Google sign-in check remains a useful additional validation step.
The infrastructure is defined in AWS Serverless Application Model (AWS SAM) and deployed through AWS CloudFormation. SAM makes the stack repeatable; change sets provide a review point before deployment. IAM execution policies constrain service access, and AWS Lambda Powertools/CloudWatch logging support debugging and operational visibility. The Gemini API key is stored in Secrets Manager rather than committed to source code.
This is the main reason I chose a serverless design for a student project: I could build around managed services and focus on the product logic instead of maintaining a continuously running application server. Actual cost depends on traffic, storage, hosting, third-party API use, and the account’s applicable pricing or credits; I have not verified a final bill of zero, so I do not treat a zero-cost claim as a project result.

What the interface is designed to make easy

The interface organises the platform around decisions and exploration:
  • Today: A prominent AQI view, a decision label, concise precautions, and a recheck suggestion.
  • Air Map: Monitoring-station markers, AQI context, and a map experience with an SVG fallback for environments where Google Maps cannot load.
  • Forecast: Hourly and multi-day timelines, with time handling aligned to  Asia/Kolkata .
  • Pollutant details: A breakdown of key pollutants and the dominant contributor where data is available.
  • Schools and saved places: Activity guidance and profile-oriented personalisation for supported users.
  • Ask Arise: A guided question-and-answer flow grounded in environmental data. Some assistant and profile features require authentication.
Responsive behaviour mattered because the people using an air-quality tool might be checking it on a phone before leaving home, not sitting at a desktop.
The project’s responsive QA report records 78 passing browser checks across 13 viewport sizes and six routes. It also records 125 passing backend tests and 14 passing frontend unit tests. Those are results documented by the project’s own test reports, not a claim that every possible device or upstream data provider has been exhaustively tested.

The obstacles—and what they taught me

The AWS work included debugging real integration issues, not just wiring up services.

1. Amazon Bedrock access was the biggest detour

During development, calls to the Nova Lite model returned an account/model-access error that was difficult to diagnose. After checking IAM permissions and following the use-case submission process, the problem persisted.
To complete the deployed assistant, I switched its production configuration to Google Gemini and retained a deterministic fallback. The lesson was to keep the model-provider boundary small and avoid making the core product unusable when one provider cannot be reached.

2. API Gateway's named stage affected routing

Requests reached Lambda with a  /prod  stage prefix, which caused FastAPI routes to return 404 responses through Mangum. I added base-path resolution in the Lambda adapter so that the stage prefix is handled before route matching.
This was a reminder to test the actual deployed request shape, not only local routes.

3. Deployment configuration needs careful review

I learned to pay attention to CloudFormation parameter persistence,  NoEcho , and default values so that a deployment does not accidentally overwrite a working secret with an empty value.
In practice, reading a SAM change set before executing it is a useful safety habit.
These were not reasons to abandon AWS. They were the hands-on parts of learning how managed services interact: identity and permissions, deployment configuration, event-driven execution, API routing, secrets, and operational logs all have to fit together.

What I would improve next

The next iterations should focus on validation and data quality as much as new features:
  1. Complete a manual end-to-end authentication pass, including the Google-hosted sign-in journey and protected profile workflows.
  1. Improve monitoring around upstream-provider outages, stale observations, missing stations, and ingestion failures.
  1. Expand location and station coverage without implying that every neighbourhood has a directly measured AQI value.
  1. Keep generated or fallback data visibly labelled and add more end-to-end browser tests around the flows that matter most to users.
  1. Continue refining the assistant’s explanations while preserving the deterministic verdict engine as the source of the core decision.

Closing thoughts

Arise started with a practical question: how can a person turn environmental readings into a better everyday decision? Building it for Environmental Hacks pushed me to connect environmental-data processing, a responsive interface, a guarded AI assistant, and a working AWS serverless deployment into one system.
The most valuable result was not simply adding AI to an AQI screen. It was learning where each component belongs: external providers supply signals, deterministic application logic evaluates them, the assistant helps explain them, and AWS services connect the frontend, APIs, scheduled work, storage, identity, and secrets into a deployable product.
Environmental information in Arise is general guidance, not a substitute for professional medical advice. Live-data coverage and freshness depend on external provider availability and location.

Series: My Projects (2 articles)

  1. 1
    Building Arise: A Serverless Air-Quality Assistant on AWS This article
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