Real-time geopolitical events dashboard: conflict tracking, live air and maritime traffic, markets, and curated intel — built with Next.js (App Router), React, and Leaflet.
- Global theater map: Live aircraft, maritime AIS, GDELT events, seismic activity, wildfires, orbital assets, chokepoints, and radiation sensors.
- Strategic markets & resources: Curated ETF/equity basket (gold, oil, volatility, treasuries, defense stocks, USD).
- Intel feed: NewsAPI-powered SITREP panel focused on geopolitical and military topics.
- Cyber & telecom status: IODA outage signals summarized for the last (N) hours.
- Layer freshness & health: Per-layer timestamps and API health indicators in the status bar.
- Node.js 18+ and npm.
- Accounts/API keys for the optional data providers you want to enable (see below).
git clone https://github.com/<your-user>/cognitio.git
cd cognitio
npm installCreate a .env.local file in the project root (or use Settings in the app to enter keys in the browser; see Settings (API keys)):
cp .env.example .env.local # or create it by hand using the table belowSet the variables you care about:
- Values marked required must be set for that feature to work.
- Everything else is optional; routes will degrade gracefully if a key is missing.
| Variable | Required? | Used by | Notes |
|---|---|---|---|
FINNHUB_API_KEY |
Optional | Markets | Primary quotes source. Free tier from https://finnhub.io/. |
TWELVEDATA_API_KEY |
Optional | Markets | Fallback if Finnhub is missing/failing. https://twelvedata.com/. |
NEWSAPI_KEY |
Optional | Intel feed | NewsAPI for SITREP. https://newsapi.org/. |
NASA_FIRMS_API_KEY |
Optional | Fires layer | NASA FIRMS MAP_KEY. https://firms.modaps.eosdis.nasa.gov/. |
AISSTREAM_API_KEY |
Optional | Maritime AIS | Aisstream.io websocket proxy. https://aisstream.io/. |
OPEN_SKY_ENABLED |
Optional | Flights | If set to 0, false, or off, skips OpenSky entirely and relies on ADS-B sources only. |
Data sources that do not require keys (used directly via their public APIs): OpenSky (anonymous mode), adsb.fi, ADSB.lol, TheAirTraffic, GDELT, USGS, IODA, Safecast, and CelesTrak.
npm run devThen open http://localhost:3000 in your browser.
- Map: Pan and zoom the world map. Use the layer controls to toggle aircraft, ships (AIS), conflict events (GDELT), seismic activity, wildfires, satellites, chokepoints, and radiation sensors. Data refreshes automatically as you move the map.
- Top ticker: Shows the current threat level (from GDELT) and live market snapshots (gold, oil, volatility, treasuries, defense, USD). Click SETTINGS in the ticker to manage API keys (see below).
- Left sidebar: Strategic Markets & Resources — curated ETF/equity quotes. Cyber / IODA — recent internet outage signals.
- Right panel: Intel feed — SITREP-style headlines from NewsAPI (geopolitical/military focus). Refreshes on an interval.
- Footer: System status, per-layer “last updated” timestamps, and UTC clock. Use it to see which layers are live and which APIs may be degraded.
You can provide API keys in two ways:
-
Server (recommended for development)
Put keys in.env.localas described in Configure environment. They are used by the Next.js API routes and never sent to the browser. -
In-app Settings
Click SETTINGS in the top ticker bar to open the API Keys modal. Enter keys for:- NASA FIRMS — fires/thermal layer
- NewsAPI — intel feed
- AIS Stream — maritime AIS layer
- Finnhub — markets (primary)
- Twelve Data — markets (fallback)
Behavior:
- Server-side env vars always take priority. In-app keys are only used when the server does not have a value for that provider.
- Keys are stored in session storage by default (cleared when you close the tab).
- Check “Remember in this browser” to store keys in localStorage so they persist across sessions.
- Keys are never sent to any server except your own app’s
/api/*routes; they are passed via request headers from the browser to your Next.js backend.
Use Settings when you’re running a deployed build without env vars, or when you want to try different keys without editing .env.local.
- Frontend: Single-page dashboard layout with header ticker, left sidebar (markets + cyber), center map, right intel feed, and footer status bar.
- API layer: Next.js Route Handlers under
src/app/api/*that proxy and normalize upstream APIs, with cache headers tuned to free-tier limits. - State: React state +
LayerFreshnessContextfor per-layer timestamps and aircraft API health, plus local panel state for polling and loading. - Map: Leaflet via
react-leaflet, with clustering, viewport culling, and longitude wrapping for a smooth “infinite scroll” world.
Dashboard— main layout wiring together ticker, map, intel, and side panels.ConflictMap— Leaflet map and all layers (aircraft, AIS, GDELT, seismic, fires, satellites, chokepoints, radiation).CommodityTicker— top ticker with threat level badge and market snapshots.MarketPanel— “Strategic Markets & Resources” quotes panel.IntelFeed— right-hand intel/SITREP feed from NewsAPI.CyberGrid— cyber/telecom outage summary from IODA.StatusBar— bottom strip with system status, per-layer freshness, and UTC clock.
- Flights:
/api/flightsmerges OpenSky + multiple ADS-B sources into a unified list and is polled from the client. - Markets:
/api/marketshits Finnhub first, then falls back to Twelve Data if necessary; the client polls every few minutes. - Cyber (IODA):
/api/cyberfetches recent outage signals; the cyber panel polls periodically and shows “last refresh”. - GDELT:
/api/gdeltpowers both the map conflict layer and threat-level calculations. - Seismic:
/api/seismicwraps the USGS GeoJSON feed for recent earthquakes. - Fires:
/api/firesqueries NASA FIRMS with the current map bbox for thermal anomalies. - Intel:
/api/intelcalls NewsAPI for geopolitically relevant articles. - Satellites:
/api/satellitesfetches TLE from CelesTrak once; the browser usestle.jsto propagate positions every second. - Maritime AIS:
/api/aisconnects to Aisstream.io over WebSocket, aggregates ships, and caches by bbox. - Radiation:
/api/radiationqueries Safecast for recent µSv/h measurements in the current map window.
npm run dev— Start the Next.js development server (default port 3000).npm run build— Production build.npm run start— Run the production server afterbuild.npm run lint— Run ESLint.
- Lint: Run
npm run lintbefore opening a PR. - Build: Run
npm run buildto catch type and build errors. - Manual testing:
- With keys configured, verify each panel (markets, cyber, map layers, intel) populates as expected.
- With specific keys removed, confirm error and empty states are graceful (e.g. “SIGNAL LOST”, “FEED TEMPORARILY UNAVAILABLE”) and that the rest of the dashboard still works.
- Keep your
.env.localout of version control (GitHub) — it should never be committed. - Only variables prefixed with
NEXT_PUBLIC_are exposed to the browser; this project intentionally keeps third-party keys server-side where possible. - If you open-source a fork, regenerate any keys you used during development before sharing screenshots or logs that may contain request URLs.
