Skip to content
JayDev-27Public

About

Turn an urban PM2.5 forecast into a practical daily plan for households, outdoor workers and community groups. Prompt Wars Challenge 06.

Topics

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Airshift logo with three airflow strokes

Airshift

Turn an air-quality forecast into a plan your household can use.

Airshift live app 14 Indian cities Gemini structured output integration MIT code license

Open Airshift · Quick start · Demo · Methodology

Airshift overview showing an interactive Old Delhi model, a severe PM₂.₅ sample, hourly readings, and projected household impact

Built for Prompt Wars Challenge 06, Airshift helps families, outdoor workers, and community organizers decide what to do during urban air pollution. It turns regional PM₂.₅ and the constraints of an actual day into a plan for outdoor activity, indoor air, and travel. Prompt Wars Virtual

See it in action

The city picker changes the Delhi map to Mumbai’s city photo and updates the forecast view
Switch location and inspect the forecast
Compare 14 cities and switch between an hourly chart and exact readings.
The Airshift assistant opens and reveals a source-backed answer progressively
Ask about a real decision
Get a source-backed reply and add its actions to the daily plan.

A plan you can explain

Decision What Airshift shows
Move outdoor play indoors In the synthetic Delhi scenario, moving the sample 30-minute session indoors avoids 30 outdoor minutes.
Replace one petrol-car trip Skipping the sample 12 km drive at 14 km/L avoids about 2.0 kg of the car’s tailpipe CO₂. The model shows the fuel factor and what the estimate includes.
Improve air at home A room-by-room checklist, no-purchase options, and a purifier sizing estimate based on floor area.
Coordinate a group A briefing to copy for a school or residents’ group with current data status and a link to official readings.
More screenshots
Mumbai overview with the Bandra–Worli Sea Link, PM₂.₅ chart, and a revised daily plan
Mumbai overview
Airshift assistant responding about indoor air with practical steps and a source link
Source-backed assistant
Mobile Airshift overview with the 3D city scene and bottom navigation

Quick start

Use Node.js 22.12 or newer.

git clone https://github.com/JayDev-27/Airshift.git
cd Airshift
npm ci
npm run dev

Open localhost:5173. The demo, regional forecasts, plan, and guided assistant work without an API key.

Command Purpose
npm test Run planner, client, forecast, assistant, API, security and hosted-runtime tests
npm run test:coverage Run the tests with a coverage report
npm run lint ESLint with React Hooks and strict jsx-a11y accessibility rules
npm run check Lint, test and build, as CI does
npm run build Build the browser application
npm start Serve the production build at localhost:8080
npm run build:site Package the browser app and API as a deployable Worker

The live app runs on Render from the Dockerfile, described by render.yaml.

Copy .env.example to .env and set GEMINI_API_KEY to enable the Gemini assistant on the server. The default model is Gemini 3.5 Flash-Lite. The hosted demo currently uses guided mode. Google AI Studio keys

How it works

flowchart LR
    A["City and household settings"] --> B["Plan engine"]
    C["CAMS PM₂.₅ forecast or winter demo"] --> B
    D["Follow-up question"] --> E["Gemini or guided mode"]
    E -->|"Selected reviewed actions"| B
    B --> F["Daily plan, source links, impact estimates"]
Loading
  • Observation and prediction. The current forecast uses Open-Meteo and CAMS at regional resolution. CPCB station readings are linked for local decisions. The synthetic winter scenario is labeled throughout. Open-Meteo · CPCB
  • Grounded assistant. Gemini returns structured action IDs and practical constraints. Airshift validates them and calculates impact from explicit inputs. Gemini structured output
  • Evidence and limitations. Methodology and credits · Audit · Build narrative

Project structure

src/
  domain.mjs        Plan engine: cities, sources, profile validation, windows, actions, guided answers
  lib/              Shared forecast provider and assistant contract, client API calls, preferences and formatting
  hooks/            useForecast, useGeminiStatus, useToast
  components/       Layout, overview cards, chart, action list, dialogs, assistant drawer, 3D model
  pages/            Overview, daily plan, indoor air, community and sources views
  App.jsx           State and page composition
server/             Express and Worker adapters, shared API handler, Gemini integration, forecast cache and headers
test/               node:test suites for the engine, client helpers, forecast, API and headers

Quality

Area How it is handled
Code quality The UI and both runtimes share the planning engine and assistant contract. Express and the Worker use one API handler. Lint rules enforce the browser/server import boundary in CI.
Security Server-side key, allowlisted model output, body and length limits, rate limits, and a shared hardening header set. See SECURITY.md.
Efficiency The 3D scene is lazy-loaded behind a still preview. Hashed bundles are cached for a year, text is compressed, and forecasts are cached per city for five minutes with one shared in-flight request.
Testing node:test covers city and household plans, CPCB band edges, window selection, guided routing, forecast validation and fallback, Gemini output validation, rate limiting, and HTTP behavior across both runtimes. The coverage command reports the planner, client helpers and in-process server modules.
Accessibility Skip link, native <dialog> focus handling, keyboard-operable selectors with roving focus, a readings table alternative to the chart, prefers-reduced-motion support, live status regions, and strict jsx-a11y linting.

License

Airshift’s code is MIT licensed. The Old Delhi map data is from OpenStreetMap contributors under ODbL, and city photography retains its individual Creative Commons licenses. OpenStreetMap attribution · Photo credits

About

Turn an urban PM2.5 forecast into a practical daily plan for households, outdoor workers and community groups. Prompt Wars Challenge 06.

Topics

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages