A Next.js + Canvas visualization that turns recent USGS earthquakes into a living night-sky constellation. Magnitude drives star brightness, depth controls softness, and age fades each event into the dark.
- Next.js App Router (canary) + React 19
- TypeScript
- Tailwind CSS v4
- Vercel Python Serverless Function (
api/quakes.py) - Node.js 22.x + pnpm
pnpm install
pnpm devOpen http://localhost:3000.
The serverless function normalizes USGS GeoJSON feeds:
GET /api/quakes?window=hour|day|week&minMag=1.2
Caching is configured per-window. Errors from USGS return a friendly JSON message with a 503 status.
pnpm lint
pnpm typecheck- Install the Vercel CLI:
pnpm dlx vercel@latest. - Run
vercelfrom the repo root.
The Python function is wired via vercel.json and will deploy automatically.
- Canvas caps rendering at 2,000 stars for performance.
- Hover to see detailed quake info + USGS event link.
- Polling intervals: 30s (hour), 2m (day), 5m (week).