Skip to content

Repository files navigation

Indoor Air Quality Map

A small, static web app for exploring publicly available AirGradient indoor air-quality measurements on a world map. It starts with CO2 and lets visitors switch to PM2.5, inspect a location's latest readings, and view recent history.

Prerequisites

  • Node.js 22 or later

No credentials, API keys, or accounts are required. The application includes a small read-only Node.js proxy because AirGradient currently blocks direct browser access with CORS.

Run locally

npm install
npm run dev

Verify and build

npm run test
npm run check
npm run build

npm run build writes the client files to dist/. Deploy the repository to a Node.js host and run the following command; it serves the built client and the same-origin read-only proxy on port 3000 (or PORT).

npm start

Deploy to Vercel

Import this repository in Vercel. The included vercel.json builds the Vite client to dist/, while api/airgradient/[...path].mjs runs the existing restricted proxy as a Vercel Function. No environment variables are required.

Data and map attribution

The app requests public data through a same-origin proxy to the AirGradient Map API. The map uses OpenStreetMap tiles and includes OpenStreetMap contributor attribution in the interface. Availability of these third-party services, including their browser-access policies, is outside this static app's control.

The proxy accepts only GET requests for the current indoor measurements, one indoor location, and its measurement history. It has a fixed upstream origin, restricts the permitted query parameters, does not forward cookies or credentials, and does not expose arbitrary URLs.

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages