GeoPulse — Geopolitical Intelligence Platform
Real-time geopolitical intelligence platform combining a 3D globe dashboard (globe.gl + Three.js), 2D choropleth maps (react-simple-maps), AI-powered trading signals, and ML-driven risk scoring. Next.js 14 + TypeScript + TailwindCSS frontend with Framer Motion.
Role
Full-stack & ML Engineer
Team
Solo
Company/Organization
Personal Project
The Problem
Geopolitical events (military conflicts, sanctions, trade disputes, diplomatic shifts) have immediate market impact, but existing tools are siloed — ...
Financial analysts manually monitored dozens of news sources to assess geopolitical risk — no automated ML pipeline existed to ingest articles,...
No interactive globe visualisation correlated geographic events with market movements — analysts couldn't click a country to see region-specific...
Existing geopolitical risk tools lacked what-if scenario simulation — no way to model macro shocks (oil supply disruption, interest rate changes,...
AI trading signals in the market lacked transparency — no causal reasoning chains explaining why a signal was generated, no event-to-market reaction...
No narrative detection to identify emerging geopolitical themes — analysts couldn't see which stories were clustering (e.g. 'South China Sea...
The Solution
Built a full-stack geopolitical intelligence platform with automated ML pipelines, interactive 3D/2D visualisations, and AI-powered trading signals.
Backend (Python FastAPI + SQLAlchemy async)
9 Routers — health, news, events, risk, predictions, narratives, summary, market, globe — each in its own module under routers/. 25+ REST API...
12 Services — news_pipeline.py (RSS ingestion from geopolitical feeds), ai_pipeline.py (DistilBERT sentiment + BART-MNLI zero-shot...
8 ORM Models — NewsArticle, GeopoliticalEvent, NewsEvent (ML-processed), GeopoliticalIndex (GTI), TensionIndex (historical snapshots),...
APScheduler (6 Jobs) — News ingestion every 10 min, AI processing every 10 min, GTI recalculation every 15 min, LightGBM predictions every 30...
ML/AI Pipeline
News Ingestion — Automated RSS feed ingestion every 10 minutes, parsed and stored as NewsArticle records.
Sentiment Analysis — DistilBERT-based scoring normalised to -1 (bearish) → +1 (bullish) per article.
Event Classification — BART-MNLI zero-shot classification into 9 categories (military, sanctions, trade, diplomatic, cyber, energy, economic,...
GTI Calculation — Per-region Geopolitical Tension Index recalculated every 15 minutes from recent event severity, sentiment, and classification...
Macro Risk Predictions — LightGBM model predicting volatility spike probability, market bias (bullish/bearish/neutral), and risk level...
Narrative Detection — BERTopic with Sentence Transformers clustering recent articles into emerging geopolitical narratives.
Intelligence Summary — Template-based NLG producing structured global risk briefings from GTI scores, top events, and predictions.
Signal Engine — Rule-based AI trading signals with full trade setup (entry, stop loss, target, risk/reward, ATR, max position sizing), causal...
Scenario Engine — What-if simulation adjusting risk indices based on 5 user-defined macro parameters.
Frontend (Next.js 14 + TypeScript + TailwindCSS)
Earth Pulse Tab — Interactive 3D globe (globe.gl + Three.js) with night-earth texture, country polygons coloured by risk level, severity-based...
Geo Map Tab — Full-screen 2D choropleth map (react-simple-maps) with vivid risk-level colouring. Click any country to open financial analysis...
AI Signals Tab — Three-column layout: filters sidebar (asset class, direction BUY/SELL, geo sensitivity tags, search), signal cards (confidence...
Filters & Scenarios — Region filters (6 regions), asset class filters (5 classes), what-if scenario sliders (Oil Shock, Rate Change, Escalation,...
Dashboard Components — DashboardHeader (GTI display, tab navigation, LIVE badge), LiveEventsFeed (animated scrollable event feed), MacroRiskPanel...
Custom Hooks — useEventsPolling (live event polling), useGlobalRisk (GTI data), useMarketData (prices + candles), usePredictions (ML...
Design Decisions
Separated backend into 9 routers, 12 services, and 8 models — each service encapsulates one ML pipeline stage or data domain, routers handle HTTP...
APScheduler for automated ML pipelines over Celery — lighter weight for scheduled jobs (no broker dependency), sufficient for 6 periodic tasks at...
DistilBERT for sentiment over full BERT or GPT — 60% smaller, 60% faster, retains 97% of BERT's accuracy. For real-time sentiment scoring every 10...
BART-MNLI zero-shot classification over fine-tuned classifier — no labelled geopolitical event dataset required. Zero-shot handles new event...
LightGBM for macro predictions over deep learning — trains in seconds on tabular features (sentiment scores, event counts, GTI values), handles...
BERTopic with Sentence Transformers for narrative detection — produces human-readable topic labels from article clusters, handles dynamic topic...
globe.gl + Three.js for 3D visualisation over Mapbox Globe or Cesium — globe.gl provides high-level abstractions for points, arcs, and polygons on a...
react-simple-maps for 2D choropleth over Mapbox/Leaflet — lighter weight (no tile server dependency), D3-geo projection built-in, sufficient for...
lightweight-charts for candlestick display over TradingView widget — open-source (no API key), lightweight (~40KB), financial-grade OHLC rendering...
Rule-based signal engine over ML signal generation — deterministic signals with explicit reasoning chains (users can audit why a signal was...
What-if scenario engine with linear parameter adjustments — simple slider-to-risk mapping enables rapid iteration. Full Monte Carlo simulation would...
Next.js 14 with App Router over Pages Router — leverages React Server Components for initial data loading, streaming for progressive UI hydration,...
Tradeoffs & Constraints
DistilBERT sentiment is general-purpose — not fine-tuned on financial/geopolitical text. Phrases like 'aggressive sanctions' score negatively despite...
Zero-shot classification into 9 categories has lower precision than a fine-tuned multi-class classifier — ambiguous events (e.g. 'trade sanctions'...
GTI recalculation every 15 minutes creates a lag window — events occurring between recalculations aren't reflected in risk indices until the next...
LightGBM predictions depend on feature quality — garbage-in-garbage-out from upstream sentiment/classification errors propagate to macro predictions....
BERTopic narrative detection requires sufficient article volume — fewer than ~20 articles in a time window produces unstable topic clusters. During...
globe.gl 3D rendering is CPU/GPU intensive — older devices or browsers without WebGL2 support may experience frame drops. The 2D map tab serves as a...
No real-time WebSocket push — frontend polls APIs at intervals rather than receiving server-pushed updates. WebSocket/SSE would reduce latency for...
Would improve: Fine-tune DistilBERT on labelled geopolitical sentiment corpus, add event-driven GTI recalculation, implement WebSocket for real-time...
Outcome & Impact
Production-grade geopolitical intelligence platform unifying news ingestion, ML analysis, risk scoring, trading signals, and interactive...
3D globe (globe.gl + Three.js) with country risk polygons, severity-based altitude extrusion, night-earth texture, and real-time arc animations for 4...
2D choropleth map (react-simple-maps) with per-country financial analysis: region-aware asset selector, live candlestick chart (lightweight-charts...
AI trading signals with full trade setup (entry, stop loss, target, R:R, ATR, position sizing), causal reasoning chains with contribution bars,...
Automated ML pipeline with 6 scheduled jobs: RSS news ingestion (10 min), DistilBERT sentiment + BART-MNLI classification (10 min), GTI recalculation...
25+ REST API endpoints across 9 routers with clean separation: health, news (ingest + query), events (CRUD + ML processing), risk (GTI global +...
What-if scenario engine with 5 macro sliders (Oil Shock, Rate Change, Escalation, Supply Chain, Cyber Threat) adjusting regional risk indices and...
GitHub Actions CI/CD: frontend job (npm ci → next lint → next build), backend job (pip install → syntax check → module import validation for 9...
Docker Compose full-stack deployment (frontend + backend + PostgreSQL) and Makefile with 16 commands (install, setup, dev, dev-backend, dev-frontend,...
Tech Stack
Frontend: Next.js 14, TypeScript, TailwindCSS, Framer Motion
3D Visualisation: Three.js, globe.gl (country polygons, arc animations, altitude extrusion)
2D Map: react-simple-maps (D3-geo choropleth with click interactions)
Charts: lightweight-charts (financial-grade OHLC candlestick rendering)
Backend: Python, FastAPI, Uvicorn, SQLAlchemy (async), APScheduler
NLP: HuggingFace Transformers (DistilBERT sentiment, BART-MNLI zero-shot classification)
ML: LightGBM (macro risk predictions), BERTopic + Sentence Transformers (narrative detection)
Database: PostgreSQL 16 (Supabase-ready), async SQLAlchemy ORM with 8 models
Infrastructure: Docker, Docker Compose, GitHub Actions CI/CD, Makefile (16 commands)