Back to Projects

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.

Next.js 14TypeScriptTailwindCSSThree.jsglobe.glreact-simple-mapslightweight-chartsFramer MotionPythonFastAPISQLAlchemyAPSchedulerHuggingFace TransformersLightGBMBERTopicPostgreSQL 16DockerGitHub Actions

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 riskno automated ML pipeline existed to ingest articles,...

No interactive globe visualisation correlated geographic events with market movementsanalysts couldn't click a country to see region-specific...

Existing geopolitical risk tools lacked what-if scenario simulationno way to model macro shocks (oil supply disruption, interest rate changes,...

AI trading signals in the market lacked transparencyno causal reasoning chains explaining why a signal was generated, no event-to-market reaction...

No narrative detection to identify emerging geopolitical themesanalysts 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 modelseach service encapsulates one ML pipeline stage or data domain, routers handle HTTP...

APScheduler for automated ML pipelines over Celerylighter weight for scheduled jobs (no broker dependency), sufficient for 6 periodic tasks at...

DistilBERT for sentiment over full BERT or GPT60% smaller, 60% faster, retains 97% of BERT's accuracy. For real-time sentiment scoring every 10...

BART-MNLI zero-shot classification over fine-tuned classifierno labelled geopolitical event dataset required. Zero-shot handles new event...

LightGBM for macro predictions over deep learningtrains in seconds on tabular features (sentiment scores, event counts, GTI values), handles...

BERTopic with Sentence Transformers for narrative detectionproduces human-readable topic labels from article clusters, handles dynamic topic...

globe.gl + Three.js for 3D visualisation over Mapbox Globe or Cesiumglobe.gl provides high-level abstractions for points, arcs, and polygons on a...

react-simple-maps for 2D choropleth over Mapbox/Leafletlighter weight (no tile server dependency), D3-geo projection built-in, sufficient for...

lightweight-charts for candlestick display over TradingView widgetopen-source (no API key), lightweight (~40KB), financial-grade OHLC rendering...

Rule-based signal engine over ML signal generationdeterministic signals with explicit reasoning chains (users can audit why a signal was...

What-if scenario engine with linear parameter adjustmentssimple slider-to-risk mapping enables rapid iteration. Full Monte Carlo simulation would...

Next.js 14 with App Router over Pages Routerleverages React Server Components for initial data loading, streaming for progressive UI hydration,...

Tradeoffs & Constraints

DistilBERT sentiment is general-purposenot 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 classifierambiguous events (e.g. 'trade sanctions'...

GTI recalculation every 15 minutes creates a lag windowevents occurring between recalculations aren't reflected in risk indices until the next...

LightGBM predictions depend on feature qualitygarbage-in-garbage-out from upstream sentiment/classification errors propagate to macro predictions....

BERTopic narrative detection requires sufficient article volumefewer than ~20 articles in a time window produces unstable topic clusters. During...

globe.gl 3D rendering is CPU/GPU intensiveolder devices or browsers without WebGL2 support may experience frame drops. The 2D map tab serves as a...

No real-time WebSocket pushfrontend 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)

Back to Projects