This guide walks you through standing up a complete GeoSentinel environment — database, backend API, and React dashboard — on your local machine. By the end you will have a running API atDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/danizd/GeoSentinel/llms.txt
Use this file to discover all available pages before exploring further.
http://localhost:8000, a live dashboard at http://localhost:5173, seeded test incidents, and real USGS earthquake events flowing through the clustering pipeline.
Prerequisites
Before you begin, make sure you have the following installed and available:- Python 3.12+ managed via
uv— installuvwithpip install uv - Node.js 18+ for the React frontend
- Docker and Docker Compose v2 — used to run PostgreSQL 16 + PostGIS 3.4
- API credentials for the data sources you want to activate:
- GDELT Cloud Events v2 — gdeltcloud.com/dashboard
- ACLED — acleddata.com/myacled
- FIRMS NASA — firms.modaps.eosdis.nasa.gov/api/map_key
- OpenSky Network (military flights relay) — opensky-network.org/my-opensky/account
- Mapbox (frontend map tiles) — console.mapbox.com
Clone the repository and start PostgreSQL
Clone the GeoSentinel repository and bring up the development database container. The Wait for the PostgreSQL health check to pass before continuing. You can confirm readiness with:
docker-compose.yml in the project root runs postgis/postgis:16-3.4 and exposes PostgreSQL on localhost:5432.Install Python backend dependencies
GeoSentinel uses Key runtime dependencies installed: FastAPI 0.136+, SQLAlchemy 2.x, GeoAlchemy2, Alembic, Pydantic v2, scikit-learn (DBSCAN), Shapely, psycopg3, and uvicorn.
uv for reproducible Python environment management. Run uv sync from the backend/ directory to install all dependencies into an isolated virtual environment.Install frontend dependencies
From the project root, move into the This installs React 19, Vite 8, Mapbox GL JS 3.x, Deck.gl 9, TanStack Query 5, Zustand 5, and Tailwind CSS 3 — among others.
frontend/ directory and install Node.js dependencies with npm.Create the .env file
Create a You only need to fill in the keys for the sources you plan to activate.
.env file at the project root (not inside backend/). All ingestor scripts and the backend load environment variables from this location automatically via python-dotenv.DATABASE_URL and VITE_MAPBOX_TOKEN are required for the core stack; the ingestor-specific keys can be added as needed.Run Alembic migrations
Apply all database migrations to create the full schema — A successful run prints each applied revision. If you see a PostGIS-related error, confirm the Docker container is healthy and that the
sources_metadata, events_canonical, events_quarantine, incidents, aoi, and corrections_audit — along with PostGIS geometry columns and GIST spatial indexes.geosentinel database exists.Start the API and the frontend
Open two terminal windows from the project root and start both services:Terminal 1 — FastAPI backend (port 8000):Terminal 2 — React frontend (port 5173):Once both are running:
- API root: http://localhost:8000
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
- Dashboard: http://localhost:5173
Seed test data
Populate the database with the built-in source metadata records and three sample incidents (one conflict, one earthquake, one wildfire) to verify that the API and dashboard are wired up correctly.The endpoint returns a JSON summary of rows inserted. Refresh the dashboard — you should see markers appear on the map.
Pull real USGS earthquake events
Run the USGS ingestor to download and process real earthquake events from the last 24 hours (magnitude ≥ 4.0). This is the fastest source to test because USGS requires no API key.The script prints a summary of events fetched, validated, and inserted into
events_canonical.Run the clustering job
After ingesting raw events, run the clustering job to group them into incidents using DBSCAN. This is what populates the The job prints the number of new incidents created and existing incidents updated. Head to http://localhost:5173 — the USGS earthquake incidents will now appear on the map as clustered markers.
incidents table and what the dashboard and /v1/incidents endpoint query.Available Ingestor Scripts
Each ingestor script lives underbackend/scripts/ and can be run independently. All scripts auto-load the .env from the project root.
| Script | Source | Requires | Notes |
|---|---|---|---|
run_usgs.py | USGS Earthquake Hazards | No API key | Pulls last 24 h, magnitude ≥ 4.0 |
run_firms.py | FIRMS NASA (active fires) | FIRMS_MAP_KEY | Processes last day’s hotspots for active AOIs |
run_gdelt.py | GDELT Cloud v2 (conflict) | GDELT_API_KEY | Downloads last 24 h of conflict events by zone |
run_acled.py | ACLED (structured conflict) | ACLED_USERNAME, ACLED_PASSWORD | 48-hour batch backfill via OAuth2 Bearer |
run_clustering.py | — (internal job) | Database populated | DBSCAN grouping; run after any ingestor |
