2025Full-stack developer · UTSA Mobile Lab

REAL-TIME SEISMIC WARNING SYSTEM

ReactFastAPIMapbox GLWebSocketsPythonUSGS API
View live

The situation

UTSA's seismic research team was monitoring earthquake activity by hand. They had real-time USGS data feeds — sensors updating every few seconds globally — but the actual workflow was: download CSV, load it into QGIS, manually plot events, stare at the screen. By the time you updated the map, the data was old. Nobody could watch multiple regions at once, and the whole process depended on whoever happened to be at the computer.

What I shipped

A full-stack real-time dashboard. FastAPI backend ingests USGS feeds and pushes events through WebSockets. React frontend renders a 3D globe via Mapbox GL. Earthquakes appear as color-coded markers sized by magnitude, alongside a live incident feed that scrolls as new events arrive. The whole pipeline — USGS data to pixel on screen — runs in under a second.

WebSocket reliability

Broadcasting to multiple WebSocket clients in FastAPI is straightforward until connections start dropping. My first version silently lost messages when a client was mid-reconnect. Nobody noticed during development because I was the only client. With 20 concurrent researchers, it broke immediately. I wrote a connection manager that tracks active sessions, queues messages during reconnection windows, and retries delivery. Tested with 20 concurrent clients — zero dropped messages.

The rendering bottleneck

A 3D globe with thousands of markers has a frame rate problem. Every new data point was triggering a full layer re-render in Mapbox. I switched from individual feature layers to a single GeoJSON source updated in-place — Mapbox diffs the data internally and re-renders only what changed. Frame rate went from choppy to stable 60fps, even with dense incident clusters.

Where it is now

Deployed and used daily by the UTSA research team for real-time seismic monitoring. I built it solo in three weeks.