Skip to content
All work

TerraPulse

Geospatial SaaS that turns exploration data into ranked, explainable drill targets.

role
Lead Engineer
for
Smart Innovations Ghana
period
May 2026 - Present
status
Live
TerraPulse landing page showing a globe and a drill target score panel
452 / 479
commits authored
123
API endpoints
~590
automated tests

Overview

Mining companies and geological surveys sit on years of geophysics, geochemistry and satellite data but still choose drill sites slowly and by hand. TerraPulse ingests that data, runs it through a geoscience pipeline and returns ranked drill targets with the evidence behind each score, plus reports a board can read.

How it is built

REST/SSENext.js 15 + MapLibremaps and copilot UIFastAPI123 endpointsPostgreSQL + PostGISrow-level securityLLM layerClaude, OpenAI, GeminiRedisjob queueCelery workerskriging, XGBoostMinIO + TiTilercloud-optimised tiles
Simplified architecture. Arrows show the main request and data flow.

What I built

  • Wrote 452 of the 479 commits; built the backend, data pipeline, AI layer, admin portal and deployment.
  • Designed the multi-tenant data model (32 models, 27 migrations) with tenant isolation enforced by PostgreSQL row-level security.
  • Built the Next.js 15 frontend data layer, map viewer, copilot interface and super-admin console.

Architecture

  • FastAPI with async SQLAlchemy over PostgreSQL 16 and PostGIS; MinIO for raster and upload storage.
  • Celery workers on Redis for heavy jobs, with job progress streamed to the browser over Server-Sent Events.
  • Raster outputs written as cloud-optimised GeoTIFFs and served as map tiles to a MapLibre GL frontend.
  • Deployed on a Linux VPS behind Nginx (HTTP/2) with PM2; GitHub Actions deploys over SSH, runs migrations and seeds, then health-checks.

Key decisions

Row-level security for tenancy

Tenant isolation lives in the database, not only in application queries, so a missed filter in one endpoint cannot leak another customer's data.

Provider-agnostic LLM layer

One interface over Anthropic, OpenAI and Gemini with API keys encrypted at rest, so customers and admins can switch providers without code changes.

A copilot with guard rails

The exploration copilot can only call allow-listed tools, runs within a spending budget, logs every action to an audit trail and proposes changes instead of making them silently.

Challenges

Geoscience jobs (kriging, terrain and satellite processing) take minutes, too long for a request cycle.

Moved them to Celery tasks and streamed status over SSE so users see progress instead of a frozen screen.

Explaining why an area scored highly matters as much as the score for a geologist.

Scored prospectivity with XGBoost and attached SHAP explanations to every target, so each ranking shows its contributing evidence layers.

Results

  • First version live in production at terrapulze.com.
  • About 590 automated tests (375 backend, 213 frontend) run in CI.

Stack

FastAPI, PostgreSQL, PostGIS, Celery, Redis, Next.js 15, MapLibre GL, XGBoost, Anthropic, OpenAI, Gemini