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.
- 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.
npm install
npm run devnpm run test
npm run check
npm run buildnpm 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 startImport 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.
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.