# yanncedl/terra-geospatial-platform architecture

> Architecture diagram of the GitHub repository yanncedl/terra-geospatial-platform, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yanncedl/terra-geospatial-platform
- Repository: https://github.com/yanncedl/terra-geospatial-platform

## Overview

TERRA is a geospatial intelligence web platform that combines a browser map interface with a FastAPI backend and specialized intelligence engines. The main user flow is to enter a company or location in a browser module, request analysis through the shared API client, receive a report, and project results onto the map. Backend routes dispatch domain analyses to aggregation logic. The excerpts establish several browser-to-API calls and backend route relationships; unsampled module implementations and some integrations are represented only where documented, without inferring unshown call chains.

Main entry points: [`src/terra_geospatial_platform/static/js/services/api_service.js`](https://github.com/yanncedl/terra-geospatial-platform/blob/master/src/terra_geospatial_platform/static/js/services/api_service.js) (API Client), [`src/terra_geospatial_platform/static/js/core/store.js`](https://github.com/yanncedl/terra-geospatial-platform/blob/master/src/terra_geospatial_platform/static/js/core/store.js) (Reactive Store), [`src/terra_geospatial_platform/static/js/core/map_engine.js`](https://github.com/yanncedl/terra-geospatial-platform/blob/master/src/terra_geospatial_platform/static/js/core/map_engine.js) (Map Engine), [`src/terra_geospatial_platform/api.py`](https://github.com/yanncedl/terra-geospatial-platform/blob/master/src/terra_geospatial_platform/api.py) (HTTP API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_browser["Browser Interface"]
  node_ui["Platform UI<br/>[app.js]"]
  node_api_client["API Client<br/>[api_service.js]"]
end

subgraph group_backend["API and Aggregation"]
  node_api["HTTP API<br/>[api.py]"]
  node_geo_engine["Geospatial Aggregator<br/>[engine.py]"]
  node_domain_modules["Domain Analysis<br/>[modules.py]"]
end

subgraph group_analysis["Analysis Workflows"]
  node_nexus["Nexus 360<br/>[nexus_module.js]"]
  node_site_audit["Site Audit"]
  node_arena["Competitive Arena<br/>[arena_module.js]"]
  node_supply["Supply Tracking<br/>[supply_module.js]"]
  node_mobility["Executive Mobility<br/>[mobility_module.js]"]
  node_forensic["Forensic Studio<br/>[forensic_module.js]"]
  node_sigint["SIGINT<br/>[sigint_module.js]"]
  node_war_room["War Room<br/>[war_room_card.html]"]
end

subgraph group_map["Map and State"]
  node_store[("Reactive Store<br/>[store.js]")]
  node_map_engine["Map Engine<br/>[map_engine.js]"]
  node_globe_engine["Globe Engine<br/>[globe_engine.js]"]
  node_event_bus["Event Bus<br/>[event_bus.js]"]
end

node_user(("Analyst"))
node_external_engines{{"Specialist Engines"}}

node_user -.->|"enters analyses"| node_ui
node_nexus -->|"requests reports"| node_api_client
node_site_audit -->|"requests audit"| node_api_client
node_arena -->|"requests arena"| node_api_client
node_supply -->|"requests flows"| node_api_client
node_mobility -->|"requests mobility"| node_api_client
node_forensic -->|"requests analysis"| node_api_client
node_sigint -->|"requests signals"| node_api_client
node_api_client -->|"calls endpoints"| node_api
node_api -->|"dispatches analyses"| node_domain_modules
node_api -->|"uses aggregator"| node_geo_engine
node_geo_engine -->|"queries specialists"| node_external_engines
node_nexus -->|"reads and updates"| node_store
node_site_audit -->|"reads and updates"| node_store
node_arena -->|"reads and updates"| node_store
node_supply -->|"reads and updates"| node_store
node_mobility -->|"reads and updates"| node_store
node_forensic -->|"reads and updates"| node_store
node_sigint -->|"reads and updates"| node_store
node_nexus -->|"projects results"| node_map_engine
node_site_audit -->|"projects results"| node_map_engine
node_arena -->|"projects results"| node_map_engine
node_supply -->|"projects results"| node_map_engine
node_mobility -->|"projects results"| node_map_engine
node_sigint -->|"projects results"| node_map_engine
node_ui -.->|"uses mapping"| node_map_engine
node_ui -.->|"offers globe view"| node_globe_engine
node_war_room -.->|"offers surveillance"| node_api

click node_ui "https://github.com/yanncedl/terra-geospatial-platform/blob/master/src/terra_geospatial_platform/static/js/app.js"
click node_api_client "https://github.com/yanncedl/terra-geospatial-platform/blob/master/src/terra_geospatial_platform/static/js/services/api_service.js"
click node_store "https://github.com/yanncedl/terra-geospatial-platform/blob/master/src/terra_geospatial_platform/static/js/core/store.js"
click node_map_engine "https://github.com/yanncedl/terra-geospatial-platform/blob/master/src/terra_geospatial_platform/static/js/core/map_engine.js"
click node_globe_engine "https://github.com/yanncedl/terra-geospatial-platform/blob/master/src/terra_geospatial_platform/static/js/core/globe_engine.js"
click node_event_bus "https://github.com/yanncedl/terra-geospatial-platform/blob/master/src/terra_geospatial_platform/static/js/core/event_bus.js"
click node_api "https://github.com/yanncedl/terra-geospatial-platform/blob/master/src/terra_geospatial_platform/api.py"
click node_geo_engine "https://github.com/yanncedl/terra-geospatial-platform/blob/master/src/terra_geospatial_platform/engine.py"
click node_domain_modules "https://github.com/yanncedl/terra-geospatial-platform/blob/master/src/terra_geospatial_platform/modules.py"
click node_nexus "https://github.com/yanncedl/terra-geospatial-platform/blob/master/src/terra_geospatial_platform/static/js/modules/nexus_module.js"
click node_site_audit "https://github.com/yanncedl/terra-geospatial-platform/blob/master/src/terra_geospatial_platform/static/js/modules/site_audit_module.js"
click node_arena "https://github.com/yanncedl/terra-geospatial-platform/blob/master/src/terra_geospatial_platform/static/js/modules/arena_module.js"
click node_supply "https://github.com/yanncedl/terra-geospatial-platform/blob/master/src/terra_geospatial_platform/static/js/modules/supply_module.js"
click node_mobility "https://github.com/yanncedl/terra-geospatial-platform/blob/master/src/terra_geospatial_platform/static/js/modules/mobility_module.js"
click node_forensic "https://github.com/yanncedl/terra-geospatial-platform/blob/master/src/terra_geospatial_platform/static/js/modules/forensic_module.js"
click node_sigint "https://github.com/yanncedl/terra-geospatial-platform/blob/master/src/terra_geospatial_platform/static/js/modules/sigint_module.js"
click node_war_room "https://github.com/yanncedl/terra-geospatial-platform/blob/master/src/terra_geospatial_platform/templates/sidebar/cards/war_room_card.html"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_ui,node_api_client toneBlue
class node_api,node_geo_engine,node_domain_modules toneAmber
class node_nexus,node_site_audit,node_arena,node_supply,node_mobility,node_forensic,node_sigint,node_war_room toneMint
class node_store,node_map_engine,node_globe_engine,node_event_bus toneRose
class node_user,node_external_engines toneIndigo
```

## Components

### Browser Interface

- [Platform UI](https://github.com/yanncedl/terra-geospatial-platform/blob/master/src/terra_geospatial_platform/static/js/app.js): `src/terra_geospatial_platform/static/js/app.js`
- [API Client](https://github.com/yanncedl/terra-geospatial-platform/blob/master/src/terra_geospatial_platform/static/js/services/api_service.js): `src/terra_geospatial_platform/static/js/services/api_service.js`

### API and Aggregation

- [HTTP API](https://github.com/yanncedl/terra-geospatial-platform/blob/master/src/terra_geospatial_platform/api.py): `src/terra_geospatial_platform/api.py`
- [Geospatial Aggregator](https://github.com/yanncedl/terra-geospatial-platform/blob/master/src/terra_geospatial_platform/engine.py): `src/terra_geospatial_platform/engine.py`
- [Domain Analysis](https://github.com/yanncedl/terra-geospatial-platform/blob/master/src/terra_geospatial_platform/modules.py): `src/terra_geospatial_platform/modules.py`

### Analysis Workflows

- [Nexus 360](https://github.com/yanncedl/terra-geospatial-platform/blob/master/src/terra_geospatial_platform/static/js/modules/nexus_module.js): `src/terra_geospatial_platform/static/js/modules/nexus_module.js`
- [Site Audit](https://github.com/yanncedl/terra-geospatial-platform/blob/master/src/terra_geospatial_platform/static/js/modules/site_audit_module.js): `src/terra_geospatial_platform/static/js/modules/site_audit_module.js`
- [Competitive Arena](https://github.com/yanncedl/terra-geospatial-platform/blob/master/src/terra_geospatial_platform/static/js/modules/arena_module.js): `src/terra_geospatial_platform/static/js/modules/arena_module.js`
- [Supply Tracking](https://github.com/yanncedl/terra-geospatial-platform/blob/master/src/terra_geospatial_platform/static/js/modules/supply_module.js): `src/terra_geospatial_platform/static/js/modules/supply_module.js`
- [Executive Mobility](https://github.com/yanncedl/terra-geospatial-platform/blob/master/src/terra_geospatial_platform/static/js/modules/mobility_module.js): `src/terra_geospatial_platform/static/js/modules/mobility_module.js`
- [Forensic Studio](https://github.com/yanncedl/terra-geospatial-platform/blob/master/src/terra_geospatial_platform/static/js/modules/forensic_module.js): `src/terra_geospatial_platform/static/js/modules/forensic_module.js`
- [SIGINT](https://github.com/yanncedl/terra-geospatial-platform/blob/master/src/terra_geospatial_platform/static/js/modules/sigint_module.js): `src/terra_geospatial_platform/static/js/modules/sigint_module.js`
- [War Room](https://github.com/yanncedl/terra-geospatial-platform/blob/master/src/terra_geospatial_platform/templates/sidebar/cards/war_room_card.html): `src/terra_geospatial_platform/templates/sidebar/cards/war_room_card.html`

### Map and State

- [Reactive Store](https://github.com/yanncedl/terra-geospatial-platform/blob/master/src/terra_geospatial_platform/static/js/core/store.js): `src/terra_geospatial_platform/static/js/core/store.js`
- [Map Engine](https://github.com/yanncedl/terra-geospatial-platform/blob/master/src/terra_geospatial_platform/static/js/core/map_engine.js): `src/terra_geospatial_platform/static/js/core/map_engine.js`
- [Globe Engine](https://github.com/yanncedl/terra-geospatial-platform/blob/master/src/terra_geospatial_platform/static/js/core/globe_engine.js): `src/terra_geospatial_platform/static/js/core/globe_engine.js`
- [Event Bus](https://github.com/yanncedl/terra-geospatial-platform/blob/master/src/terra_geospatial_platform/static/js/core/event_bus.js): `src/terra_geospatial_platform/static/js/core/event_bus.js`

### Other components

- **Analyst**
- **Specialist Engines**

## Connections

- Analyst → Platform UI: enters analyses
- Nexus 360 → API Client: requests reports (evidence: `src/terra_geospatial_platform/static/js/modules/nexus_module.js`)
- Site Audit → API Client: requests audit (evidence: `src/terra_geospatial_platform/static/js/modules/site_audit_module.js`)
- Competitive Arena → API Client: requests arena (evidence: `src/terra_geospatial_platform/static/js/modules/arena_module.js`)
- Supply Tracking → API Client: requests flows (evidence: `src/terra_geospatial_platform/static/js/modules/supply_module.js`)
- Executive Mobility → API Client: requests mobility (evidence: `src/terra_geospatial_platform/static/js/modules/mobility_module.js`)
- Forensic Studio → API Client: requests analysis (evidence: `src/terra_geospatial_platform/static/js/modules/forensic_module.js`)
- SIGINT → API Client: requests signals (evidence: `src/terra_geospatial_platform/static/js/modules/sigint_module.js`)
- API Client → HTTP API: calls endpoints (evidence: `src/terra_geospatial_platform/static/js/services/api_service.js`)
- HTTP API → Domain Analysis: dispatches analyses (evidence: `src/terra_geospatial_platform/api.py`)
- HTTP API → Geospatial Aggregator: uses aggregator (evidence: `src/terra_geospatial_platform/api.py`)
- Geospatial Aggregator → Specialist Engines: queries specialists (evidence: `src/terra_geospatial_platform/engine.py`)
- Nexus 360 → Reactive Store: reads and updates (evidence: `src/terra_geospatial_platform/static/js/modules/nexus_module.js`)
- Site Audit → Reactive Store: reads and updates (evidence: `src/terra_geospatial_platform/static/js/modules/site_audit_module.js`)
- Competitive Arena → Reactive Store: reads and updates (evidence: `src/terra_geospatial_platform/static/js/modules/arena_module.js`)
- Supply Tracking → Reactive Store: reads and updates (evidence: `src/terra_geospatial_platform/static/js/modules/supply_module.js`)
- Executive Mobility → Reactive Store: reads and updates (evidence: `src/terra_geospatial_platform/static/js/modules/mobility_module.js`)
- Forensic Studio → Reactive Store: reads and updates (evidence: `src/terra_geospatial_platform/static/js/modules/forensic_module.js`)
- SIGINT → Reactive Store: reads and updates (evidence: `src/terra_geospatial_platform/static/js/modules/sigint_module.js`)
- Nexus 360 → Map Engine: projects results (evidence: `src/terra_geospatial_platform/static/js/modules/nexus_module.js`)
- Site Audit → Map Engine: projects results (evidence: `src/terra_geospatial_platform/static/js/modules/site_audit_module.js`)
- Competitive Arena → Map Engine: projects results (evidence: `src/terra_geospatial_platform/static/js/modules/arena_module.js`)
- Supply Tracking → Map Engine: projects results (evidence: `src/terra_geospatial_platform/static/js/modules/supply_module.js`)
- Executive Mobility → Map Engine: projects results (evidence: `src/terra_geospatial_platform/static/js/modules/mobility_module.js`)
- SIGINT → Map Engine: projects results (evidence: `src/terra_geospatial_platform/static/js/modules/sigint_module.js`)
- Platform UI → Map Engine: uses mapping
- Platform UI → Globe Engine: offers globe view
- War Room → HTTP API: offers surveillance
