# parthsingh03/gotham architecture

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

- Interactive diagram: https://gitdiagram.com/parthsingh03/gotham
- Repository: https://github.com/parthsingh03/gotham

## Overview

GOTHAM is a keyless public-source situational-awareness and investigation dashboard. Analysts explore operational and historical events on maps, search subjects and public web/phone intelligence, and combine findings in a case workspace or Foundry object graph. The main client-to-result path is the React dashboard calling typed server actions, which provide domain data and persist selected work in SQLite. The README documents several capabilities whose detailed implementation was not sampled; those branches are represented without speculative internal call chains.

Main entry points: [`server/src/actions.ts`](https://github.com/parthsingh03/gotham/blob/main/server/src/actions.ts) (Server actions), [`client/src/App.tsx`](https://github.com/parthsingh03/gotham/blob/main/client/src/App.tsx) (GOTHAM dashboard), [`server/src/foundry.ts`](https://github.com/parthsingh03/gotham/blob/main/server/src/foundry.ts) (Foundry imports and graph), [`server/src/intelligence.ts`](https://github.com/parthsingh03/gotham/blob/main/server/src/intelligence.ts) (Search and intelligence)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Analyst workspace"]
  node_dashboard["GOTHAM dashboard<br/>[App.tsx]"]
  node_operational_map["Operational map<br/>[CanvasMap.tsx]"]
  node_history_map["Timeline and history<br/>[HistoryMap.tsx]"]
  node_foundry_ui["Data Foundry<br/>[Foundry.tsx]"]
  node_intel_lab["Intelligence and cases"]
  node_rpc["Typed action client<br/>[api.ts]"]
end

subgraph group_server["Action services"]
  node_actions["Server actions<br/>[actions.ts]"]
  node_conflicts["Conflict intelligence<br/>[conflicts.ts]"]
  node_attacks["Attack records<br/>[attacks.ts]"]
  node_battles["Battle records<br/>[battles.ts]"]
  node_protests["Protest records<br/>[protests.ts]"]
  node_news_locations["News geolocation<br/>[news-locations.ts]"]
  node_live_cams["Live cameras<br/>[live-cams.ts]"]
  node_foundry_service["Foundry imports and graph<br/>[foundry.ts]"]
  node_connector_retries["Connector retrieval<br/>[foundry-retries.ts]"]
  node_intelligence_service["Search and intelligence<br/>[intelligence.ts]"]
end

subgraph group_data["Data and mapping"]
  node_map_assets["Map geometry and layers<br/>[coastline.ts]"]
  node_map_monitoring["Map monitoring state<br/>[monitoring.ts]"]
  node_map_library["Hosted map integration<br/>[hatch-maps.js]"]
  node_schema[("SQLite data model<br/>[schema.ts]")]
  node_centroids["Country centroids"]
end

subgraph group_external["Public sources"]
  node_public_sources["Public data sources"]
  node_duckduckgo["DuckDuckGo search"]
  node_crt["Certificate transparency"]
  node_sqlite[("SQLite")]
end

node_analyst(("Analyst"))

node_analyst -->|"uses"| node_dashboard
node_dashboard -->|"renders"| node_operational_map
node_dashboard -->|"opens"| node_history_map
node_dashboard -->|"renders"| node_foundry_ui
node_dashboard -->|"opens"| node_intel_lab
node_dashboard -->|"queries"| node_rpc
node_foundry_ui -->|"imports datasets"| node_rpc
node_intel_lab -->|"requests services"| node_rpc
node_history_map -->|"reuses"| node_operational_map
node_operational_map -->|"draws geography"| node_map_assets
node_operational_map -->|"uses state"| node_map_monitoring
node_dashboard -->|"loads integration"| node_map_library
node_rpc -->|"posts actions"| node_actions
node_actions -->|"loads conflict data"| node_conflicts
node_actions -->|"fetches attack detail"| node_attacks
node_actions -->|"serves battle data"| node_battles
node_actions -->|"loads protest data"| node_protests
node_actions -->|"uses story locations"| node_news_locations
node_actions -->|"serves camera data"| node_live_cams
node_actions -->|"dispatches Foundry"| node_foundry_service
node_actions -->|"dispatches intelligence"| node_intelligence_service
node_foundry_service -->|"retries connectors"| node_connector_retries
node_foundry_service -.->|"stores graph data"| node_schema
node_intelligence_service -->|"reads records"| node_schema
node_news_locations -->|"uses centroids"| node_centroids
node_conflicts -->|"fetches reports"| node_public_sources
node_foundry_service -->|"imports connectors"| node_public_sources
node_intelligence_service -.->|"searches web"| node_duckduckgo
node_intelligence_service -->|"discovers subdomains"| node_crt
node_schema -.->|"persists data"| node_sqlite

click node_dashboard "https://github.com/parthsingh03/gotham/blob/main/client/src/App.tsx"
click node_operational_map "https://github.com/parthsingh03/gotham/blob/main/client/src/CanvasMap.tsx"
click node_history_map "https://github.com/parthsingh03/gotham/blob/main/client/src/HistoryMap.tsx"
click node_foundry_ui "https://github.com/parthsingh03/gotham/blob/main/client/src/Foundry.tsx"
click node_intel_lab "https://github.com/parthsingh03/gotham/blob/main/client/src/IntelligenceLab.tsx"
click node_rpc "https://github.com/parthsingh03/gotham/blob/main/client/src/api.ts"
click node_map_assets "https://github.com/parthsingh03/gotham/blob/main/client/src/coastline.ts"
click node_map_monitoring "https://github.com/parthsingh03/gotham/blob/main/client/src/monitoring.ts"
click node_map_library "https://github.com/parthsingh03/gotham/blob/main/client/src/hatch-maps.js"
click node_actions "https://github.com/parthsingh03/gotham/blob/main/server/src/actions.ts"
click node_conflicts "https://github.com/parthsingh03/gotham/blob/main/server/src/conflicts.ts"
click node_attacks "https://github.com/parthsingh03/gotham/blob/main/server/src/attacks.ts"
click node_battles "https://github.com/parthsingh03/gotham/blob/main/server/src/battles.ts"
click node_protests "https://github.com/parthsingh03/gotham/blob/main/server/src/protests.ts"
click node_news_locations "https://github.com/parthsingh03/gotham/blob/main/server/src/news-locations.ts"
click node_live_cams "https://github.com/parthsingh03/gotham/blob/main/server/src/live-cams.ts"
click node_foundry_service "https://github.com/parthsingh03/gotham/blob/main/server/src/foundry.ts"
click node_connector_retries "https://github.com/parthsingh03/gotham/blob/main/server/src/foundry-retries.ts"
click node_intelligence_service "https://github.com/parthsingh03/gotham/blob/main/server/src/intelligence.ts"
click node_schema "https://github.com/parthsingh03/gotham/blob/main/server/src/schema.ts"
click node_centroids "https://github.com/parthsingh03/gotham/blob/main/server/src/country-centroids.ts"

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_dashboard,node_operational_map,node_history_map,node_foundry_ui,node_intel_lab,node_rpc toneBlue
class node_actions,node_conflicts,node_attacks,node_battles,node_protests,node_news_locations,node_live_cams,node_foundry_service,node_connector_retries,node_intelligence_service toneAmber
class node_map_assets,node_map_monitoring,node_map_library,node_schema,node_centroids toneMint
class node_public_sources,node_duckduckgo,node_crt,node_sqlite toneRose
class node_analyst toneIndigo
```

## Components

### Analyst workspace

- [GOTHAM dashboard](https://github.com/parthsingh03/gotham/blob/main/client/src/App.tsx): `client/src/App.tsx`
- [Operational map](https://github.com/parthsingh03/gotham/blob/main/client/src/CanvasMap.tsx): `client/src/CanvasMap.tsx`
- [Timeline and history](https://github.com/parthsingh03/gotham/blob/main/client/src/HistoryMap.tsx): `client/src/HistoryMap.tsx`
- [Data Foundry](https://github.com/parthsingh03/gotham/blob/main/client/src/Foundry.tsx): `client/src/Foundry.tsx`
- [Intelligence and cases](https://github.com/parthsingh03/gotham/blob/main/client/src/IntelligenceLab.tsx): `client/src/IntelligenceLab.tsx`
- [Typed action client](https://github.com/parthsingh03/gotham/blob/main/client/src/api.ts): `client/src/api.ts`

### Action services

- [Server actions](https://github.com/parthsingh03/gotham/blob/main/server/src/actions.ts): `server/src/actions.ts`
- [Conflict intelligence](https://github.com/parthsingh03/gotham/blob/main/server/src/conflicts.ts): `server/src/conflicts.ts`
- [Attack records](https://github.com/parthsingh03/gotham/blob/main/server/src/attacks.ts): `server/src/attacks.ts`
- [Battle records](https://github.com/parthsingh03/gotham/blob/main/server/src/battles.ts): `server/src/battles.ts`
- [Protest records](https://github.com/parthsingh03/gotham/blob/main/server/src/protests.ts): `server/src/protests.ts`
- [News geolocation](https://github.com/parthsingh03/gotham/blob/main/server/src/news-locations.ts): `server/src/news-locations.ts`
- [Live cameras](https://github.com/parthsingh03/gotham/blob/main/server/src/live-cams.ts): `server/src/live-cams.ts`
- [Foundry imports and graph](https://github.com/parthsingh03/gotham/blob/main/server/src/foundry.ts): `server/src/foundry.ts`
- [Connector retrieval](https://github.com/parthsingh03/gotham/blob/main/server/src/foundry-retries.ts): `server/src/foundry-retries.ts`
- [Search and intelligence](https://github.com/parthsingh03/gotham/blob/main/server/src/intelligence.ts): `server/src/intelligence.ts`

### Data and mapping

- [Map geometry and layers](https://github.com/parthsingh03/gotham/blob/main/client/src/coastline.ts): `client/src/coastline.ts`
- [Map monitoring state](https://github.com/parthsingh03/gotham/blob/main/client/src/monitoring.ts): `client/src/monitoring.ts`
- [Hosted map integration](https://github.com/parthsingh03/gotham/blob/main/client/src/hatch-maps.js): `client/src/hatch-maps.js`
- [SQLite data model](https://github.com/parthsingh03/gotham/blob/main/server/src/schema.ts): `server/src/schema.ts`
- [Country centroids](https://github.com/parthsingh03/gotham/blob/main/server/src/country-centroids.ts): `server/src/country-centroids.ts`

### Public sources

- **Public data sources**
- **DuckDuckGo search**
- **Certificate transparency**
- **SQLite**

### Other components

- **Analyst**

## Connections

- Analyst → GOTHAM dashboard: uses (evidence: `README.md`)
- GOTHAM dashboard → Operational map: renders (evidence: `client/src/App.tsx`)
- GOTHAM dashboard → Timeline and history: opens (evidence: `client/src/App.tsx`)
- GOTHAM dashboard → Data Foundry: renders (evidence: `client/src/App.tsx`)
- GOTHAM dashboard → Intelligence and cases: opens (evidence: `client/src/App.tsx`)
- GOTHAM dashboard → Typed action client: queries (evidence: `client/src/App.tsx`)
- Data Foundry → Typed action client: imports datasets (evidence: `client/src/Foundry.tsx`)
- Intelligence and cases → Typed action client: requests services (evidence: `client/src/IntelligenceLab.tsx`)
- Timeline and history → Operational map: reuses (evidence: `client/src/HistoryMap.tsx`)
- Operational map → Map geometry and layers: draws geography (evidence: `client/src/CanvasMap.tsx`)
- Operational map → Map monitoring state: uses state (evidence: `client/src/CanvasMap.tsx`)
- GOTHAM dashboard → Hosted map integration: loads integration (evidence: `client/src/main.tsx`)
- Typed action client → Server actions: posts actions (evidence: `client/src/api.ts`)
- Server actions → Conflict intelligence: loads conflict data (evidence: `server/src/actions.ts`)
- Server actions → Attack records: fetches attack detail (evidence: `server/src/actions.ts`)
- Server actions → Battle records: serves battle data (evidence: `server/src/actions.ts`)
- Server actions → Protest records: loads protest data (evidence: `server/src/actions.ts`)
- Server actions → News geolocation: uses story locations (evidence: `server/src/actions.ts`)
- Server actions → Live cameras: serves camera data (evidence: `server/src/actions.ts`)
- Server actions → Foundry imports and graph: dispatches Foundry (evidence: `server/src/actions.ts`)
- Server actions → Search and intelligence: dispatches intelligence (evidence: `server/src/actions.ts`)
- Foundry imports and graph → Connector retrieval: retries connectors (evidence: `server/src/foundry.ts`)
- Foundry imports and graph → SQLite data model: stores graph data (evidence: `server/src/foundry.ts`)
- Search and intelligence → SQLite data model: reads records (evidence: `server/src/intelligence.ts`)
- News geolocation → Country centroids: uses centroids (evidence: `server/src/news-locations.ts`)
- Conflict intelligence → Public data sources: fetches reports (evidence: `server/src/conflicts.ts`)
- Foundry imports and graph → Public data sources: imports connectors (evidence: `README.md`)
- Search and intelligence → DuckDuckGo search: searches web
- Search and intelligence → Certificate transparency: discovers subdomains (evidence: `server/src/intelligence.ts`)
- SQLite data model → SQLite: persists data
