Earth Event Atlas is an independent, map-first public explorer for NASA EONET natural-event records. It combines a searchable globe, time-range navigation, source-oriented event details, local Saved events, and a two-record comparison workspace over a typed database-backed mirror.
NASA EONET and the upstream sources listed on each record provide the data. Earth Event Atlas is not affiliated with or endorsed by NASA.
Run Postgres, apply the schema, and sync EONET before starting the app:
cp .env.example .env.local
docker compose up -d postgres
npm install
npm run db:generate
npm run db:migrate
npm run eonet:sync
npm run devOpen http://localhost:3000.
For a larger historical dataset, run:
npm run eonet:backfillUseful commands:
npm run db:generate
npm run db:migrate
npm run db:deploy
npm run lint
npm run typecheck
npm run test:run
npm run build
npm run test:e2e
npm run eonet:sync
npm run eonet:backfill-
Create a Postgres database and copy its pooled connection string into
DATABASE_URL.- Vercel Postgres integrations: https://vercel.com/docs/postgres
- Neon also works: https://neon.com/docs/connect/connect-from-any-app
-
Set Vercel environment variables:
DATABASE_URL=postgresql://...
EONET_SYNC_SECRET=<generate-a-long-random-string>
NEXT_PUBLIC_MAP_STYLE_URL=<optional-maplibre-style-url>- The included Vercel build command runs migrations before the Next.js build:
npm run db:deploy && npm run buildThe install command can stay as npm install; postinstall runs prisma generate.
- Deploy, then seed the database once:
vercel --prod
curl -X POST "https://<your-project>.vercel.app/api/cron/eonet-sync?secret=<EONET_SYNC_SECRET>"- The included vercel.json runs
/api/cron/eonet-synconce per day at 02:00 UTC, which works on Vercel Hobby. On Pro, you can change the schedule to0 */6 * * *for a six-hour sync cadence.
API keys:
- NASA EONET does not require an API key: https://eonet.gsfc.nasa.gov/docs/v3
- A map key is optional. Without
NEXT_PUBLIC_MAP_STYLE_URL, the app uses Esri World Imagery in Hybrid mode with an optional dark Atlas view. For production, you can instead provide a MapLibre-compatible style URL. - Vercel Marketplace Postgres providers or Neon provide
DATABASE_URLthrough their dashboard; no NASA key is needed.
Next.js App Routerfor the explorer, event detail, Saved, Compare, and API routes.TanStack Queryfor client-side caching and refetch behavior.Tailwind CSSplus a small token layer in src/app/globals.css.Zodfor validated event schemas at the EONET boundary.MapLibre GL JSfor the interactive map.Prismawith Postgres for the mirrored EONET dataset and sync runs.
Upstream API:
App routes:
GET /api/eventsGET /api/events/[id]GET /api/events/timelineGET /api/sync/status
The browser API reads from the mirrored database and returns event-first types:
EventEventStatusEventCategoryEventSourceEventGeometryEventListPageFavoriteEvent
The list route supports status, category, from, to, sort, search, page, and limit. Timeline buckets come from the mirrored database and the browser never needs to hit NASA directly during normal browsing.
MapLibre style is configurable through:
NEXT_PUBLIC_MAP_STYLE_URL=https://your-style-host/style.jsonIf that variable is not set, the app starts in a bundled hybrid mode using Esri World Imagery beneath the existing country boundaries, labels, and event layers. The in-map control can switch back to the night-cartography Atlas mode. Imagery attribution is displayed by the in-map attribution control.
Hybrid imagery is provided by NASA Global Imagery Browse Services (GIBS), part of NASA EOSDIS.
- Saved and compare selections persist in
localStorageunder the current EONET event shape. npm run eonet:syncrefreshes the recent mirror window;npm run eonet:backfillfills historical data in throttled windows.- Playwright coverage targets the map-first explorer, detail route, Saved, and Compare flows.