Skip to content

QuantumDrizzy/spain-situation-room

Repository files navigation

🇪🇸 Spain Situation Room

Real-time operational intelligence dashboard for Spain
Live flight tracking · Electricity grid monitoring · Weather radar — all in one map


Stack TypeScript DeckGL MapLibre Python Kafka


Overview

Spain Situation Room is a real-time geospatial intelligence dashboard that aggregates live data from multiple public APIs into a single interactive 3D map. Inspired by operational control centers, it provides a unified view of air traffic, electrical grid status, and meteorological conditions over the Iberian Peninsula.

Built from scratch using Google AI Studio + Gemini.


Live Data Sources

Layer Source Update frequency
✈️ Flight tracking OpenSky Network API Every 10 seconds
⚡ Electricity price E·SIOS (Red Eléctrica España) Real-time
🌧️ Weather radar RainViewer API Every 10 minutes

Features

  • Real-time flight tracking — live aircraft positions over Spain with callsign, altitude, velocity and heading. Auto-fallback to simulation mode when OpenSky rate limits are reached
  • Power grid visualization — 400kV and 220kV transmission line network with live electricity spot price from E·SIOS
  • Weather radar overlay — precipitation radar tiles updated every 10 minutes via RainViewer
  • 3D map — Deck.GL with pitch and bearing for immersive spatial awareness
  • Layer controls — toggle flights, grid, and weather independently
  • Emergency alerts — EMG counter for anomalous flight states
  • NAC/INT counters — domestic vs international flight separation

Architecture

┌─────────────────────────────────────────────────────┐
│                    FRONTEND                          │
│  Next.js 14 + TypeScript + Deck.GL + MapLibre       │
│                                                      │
│  SituationRoom.tsx                                   │
│    ├── FlightLayer (IconLayer + LineLayer)           │
│    ├── PowerGridLayer (LineLayer)                    │
│    └── WeatherLayer (BitmapLayer + TileLayer)        │
│                                                      │
│  /api/flights (Next.js API Route)                    │
│    ├── OpenSky Network → real flight data           │
│    └── Mock generator → fallback simulation         │
└─────────────────────────────────────────────────────┘

┌─────────────────────────────────────────────────────┐
│              BACKEND EXPORT (Optional)               │
│  Python + Kafka/Redpanda + Docker                   │
│                                                      │
│  producer.py → fetches OpenSky every 10s            │
│             → publishes to Kafka topic              │
│  server.py  → FastAPI WebSocket consumer            │
│  docker-compose.yml → Redpanda + services           │
└─────────────────────────────────────────────────────┘

Tech Stack

Layer Technology
Framework Next.js 14 (App Router)
Language TypeScript
3D Maps Deck.GL + MapLibre GL
Map tiles CARTO Dark Matter (free)
Styling Tailwind CSS
Icons Lucide React
Flight API OpenSky Network (free tier)
Weather API RainViewer (free tier)
Electricity E·SIOS / Red Eléctrica España
Streaming (opt.) Apache Kafka / Redpanda
Backend (opt.) Python + aiohttp + FastAPI
Deployment Google AI Studio / Vercel

Getting Started

Prerequisites

node >= 18
npm >= 9

Installation

git clone https://github.com/QuantumDrizzy/spain-situation-room
cd spain-situation-room
npm install

Environment

cp .env.example .env.local
# No API keys required for basic usage
# OpenSky Network free tier works without authentication
# Falls back to simulation mode automatically if rate limited

Run

npm run dev
# Open http://localhost:3000

Optional: Kafka Streaming Backend

cd backend-export
pip install -r requirements.txt
docker-compose up -d        # Start Redpanda
python producer.py          # Start flight data producer
python server.py            # Start WebSocket server

Data Notes

OpenSky Network provides free access to real-time ADS-B flight data. The free tier has rate limits — when exceeded, the dashboard automatically switches to a deterministic simulation of 200 flights over Spain maintaining realistic movement patterns.

E·SIOS is the official Spanish electricity system operator's data platform. Electricity spot prices are fetched from their public API.

RainViewer provides free weather radar tiles updated every 10 minutes globally.


Screenshots

Flights + Grid Weather Radar
200 active flights over Spain with power grid Precipitation radar overlay

Roadmap

  • Real E·SIOS WebSocket integration (currently polling)
  • Historical playback mode
  • Alert system for airspace incidents
  • Situation Room for other countries (Europe, global)
  • Mobile responsive layout
  • Export snapshots as PNG/PDF

License

MIT — free to use, modify and distribute.


Built with Google AI Studio + Gemini · Real data from OpenSky, E·SIOS, RainViewer

About

Real-time operational dashboard for Spain · Live flights (OpenSky) · Electricity prices (E·SIOS) · Weather radar · Next.js + Deck.GL + MapLibre

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors