# ladybug-w/worldmonitor architecture

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

- Interactive diagram: https://gitdiagram.com/ladybug-w/worldmonitor
- Repository: https://github.com/ladybug-w/worldmonitor

## Overview

World Monitor is a real-time global intelligence dashboard: users explore live geopolitical, economic, and infrastructure signals through maps, panels, and country briefs. The main flow runs from app startup and bootstrap hydration, through domain data services and API endpoints, to map and panel presentation. The repository also documents variant-specific dashboards, AI analysis, multilingual support, desktop/PWA delivery, and typed APIs. Several domain links below reflect README capabilities; sampled excerpts do not expose every runtime call, so uncertain connections are omitted or marked dashed.

Main entry points: [`src/App.ts`](https://github.com/ladybug-w/worldmonitor/blob/main/src/App.ts) (Dashboard app), [`server/worldmonitor`](https://github.com/ladybug-w/worldmonitor/tree/main/server/worldmonitor) (Domain services), [`src/app/search-manager.ts`](https://github.com/ladybug-w/worldmonitor/blob/main/src/app/search-manager.ts) (Search manager), [`src/app/country-intel.ts`](https://github.com/ladybug-w/worldmonitor/blob/main/src/app/country-intel.ts) (Country briefs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Dashboard experience"]
  node_app["Dashboard app<br/>[App.ts]"]
  node_context["App context<br/>[app-context.ts]"]
  node_map["Map engines<br/>[MapContainer.ts]"]
  node_panels["Dashboard panels<br/>[Panel.ts]"]
  node_posture["Strategic posture"]
  node_search["Search manager<br/>[search-manager.ts]"]
end

subgraph group_analysis["Intelligence and analysis"]
  node_country["Country briefs<br/>[country-intel.ts]"]
  node_risk["Country risk"]
  node_geometry["Country geometry"]
  node_ai["AI and ML<br/>[ml-worker.ts]"]
end

subgraph group_data["Data and APIs"]
  node_news["News feeds"]
  node_domain["Domain services"]
  node_gateway["API gateway<br/>[gateway.ts]"]
  node_router["API router<br/>[router.ts]"]
  node_bootstrap["Bootstrap data<br/>[bootstrap.js]"]
  node_marketstore[("Market history store")]
end

subgraph group_platform["Runtime and configuration"]
  node_config["Variant configuration<br/>[index.ts]"]
  node_runtime["API runtime<br/>[runtime.ts]"]
  node_runtimeconfig["Runtime settings<br/>[runtime-config.ts]"]
  node_i18n["Localization<br/>[i18n.ts]"]
end

node_user(("Analyst"))

node_user -->|"explores"| node_app
node_app -->|"initializes"| node_context
node_app -->|"hydrates"| node_bootstrap
node_app -->|"creates"| node_search
node_app -->|"loads"| node_config
node_app -->|"checks runtime"| node_runtime
node_search -->|"opens brief"| node_country
node_search -->|"changes layers"| node_map
node_country -->|"uses scores"| node_risk
node_country -->|"uses geometry"| node_geometry
node_panels -->|"includes"| node_posture
node_posture -.->|"presents signals"| node_domain
node_app -.->|"presents layers"| node_map
node_app -.->|"presents intelligence"| node_panels
node_app -.->|"supports AI analysis"| node_ai
node_app -.->|"localizes"| node_i18n
node_runtime -->|"loads settings"| node_runtimeconfig
node_gateway -.->|"routes requests"| node_router
node_router -.->|"dispatches domains"| node_domain
node_domain -.->|"serves news"| node_news
node_domain -.->|"stores history"| node_marketstore

click node_app "https://github.com/ladybug-w/worldmonitor/blob/main/src/App.ts"
click node_context "https://github.com/ladybug-w/worldmonitor/blob/main/src/app/app-context.ts"
click node_map "https://github.com/ladybug-w/worldmonitor/blob/main/src/components/MapContainer.ts"
click node_panels "https://github.com/ladybug-w/worldmonitor/blob/main/src/components/Panel.ts"
click node_posture "https://github.com/ladybug-w/worldmonitor/blob/main/src/components/StrategicPosturePanel.ts"
click node_search "https://github.com/ladybug-w/worldmonitor/blob/main/src/app/search-manager.ts"
click node_country "https://github.com/ladybug-w/worldmonitor/blob/main/src/app/country-intel.ts"
click node_risk "https://github.com/ladybug-w/worldmonitor/blob/main/src/services/country-instability.ts"
click node_geometry "https://github.com/ladybug-w/worldmonitor/blob/main/src/services/country-geometry.ts"
click node_ai "https://github.com/ladybug-w/worldmonitor/blob/main/src/services/ml-worker.ts"
click node_news "https://github.com/ladybug-w/worldmonitor/tree/main/server/worldmonitor/news/v1"
click node_domain "https://github.com/ladybug-w/worldmonitor/tree/main/server/worldmonitor"
click node_gateway "https://github.com/ladybug-w/worldmonitor/blob/main/server/gateway.ts"
click node_router "https://github.com/ladybug-w/worldmonitor/blob/main/server/router.ts"
click node_bootstrap "https://github.com/ladybug-w/worldmonitor/blob/main/api/bootstrap.js"
click node_config "https://github.com/ladybug-w/worldmonitor/blob/main/src/config/index.ts"
click node_runtime "https://github.com/ladybug-w/worldmonitor/blob/main/src/services/runtime.ts"
click node_runtimeconfig "https://github.com/ladybug-w/worldmonitor/blob/main/src/services/runtime-config.ts"
click node_i18n "https://github.com/ladybug-w/worldmonitor/blob/main/src/services/i18n.ts"
click node_marketstore "https://github.com/ladybug-w/worldmonitor/blob/main/server/worldmonitor/market/v1/premium-stock-store.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_app,node_context,node_map,node_panels,node_posture,node_search toneBlue
class node_country,node_risk,node_geometry,node_ai toneAmber
class node_news,node_domain,node_gateway,node_router,node_bootstrap,node_marketstore toneMint
class node_config,node_runtime,node_runtimeconfig,node_i18n toneRose
class node_user toneIndigo
```

## Components

### Dashboard experience

- [Dashboard app](https://github.com/ladybug-w/worldmonitor/blob/main/src/App.ts): `src/App.ts`
- [App context](https://github.com/ladybug-w/worldmonitor/blob/main/src/app/app-context.ts): `src/app/app-context.ts`
- [Map engines](https://github.com/ladybug-w/worldmonitor/blob/main/src/components/MapContainer.ts): `src/components/MapContainer.ts`
- [Dashboard panels](https://github.com/ladybug-w/worldmonitor/blob/main/src/components/Panel.ts): `src/components/Panel.ts`
- [Strategic posture](https://github.com/ladybug-w/worldmonitor/blob/main/src/components/StrategicPosturePanel.ts): `src/components/StrategicPosturePanel.ts`
- [Search manager](https://github.com/ladybug-w/worldmonitor/blob/main/src/app/search-manager.ts): `src/app/search-manager.ts`

### Intelligence and analysis

- [Country briefs](https://github.com/ladybug-w/worldmonitor/blob/main/src/app/country-intel.ts): `src/app/country-intel.ts`
- [Country risk](https://github.com/ladybug-w/worldmonitor/blob/main/src/services/country-instability.ts): `src/services/country-instability.ts`
- [Country geometry](https://github.com/ladybug-w/worldmonitor/blob/main/src/services/country-geometry.ts): `src/services/country-geometry.ts`
- [AI and ML](https://github.com/ladybug-w/worldmonitor/blob/main/src/services/ml-worker.ts): `src/services/ml-worker.ts`

### Data and APIs

- [News feeds](https://github.com/ladybug-w/worldmonitor/tree/main/server/worldmonitor/news/v1): `server/worldmonitor/news/v1`
- [Domain services](https://github.com/ladybug-w/worldmonitor/tree/main/server/worldmonitor): `server/worldmonitor`
- [API gateway](https://github.com/ladybug-w/worldmonitor/blob/main/server/gateway.ts): `server/gateway.ts`
- [API router](https://github.com/ladybug-w/worldmonitor/blob/main/server/router.ts): `server/router.ts`
- [Bootstrap data](https://github.com/ladybug-w/worldmonitor/blob/main/api/bootstrap.js): `api/bootstrap.js`
- [Market history store](https://github.com/ladybug-w/worldmonitor/blob/main/server/worldmonitor/market/v1/premium-stock-store.ts): `server/worldmonitor/market/v1/premium-stock-store.ts`

### Runtime and configuration

- [Variant configuration](https://github.com/ladybug-w/worldmonitor/blob/main/src/config/index.ts): `src/config/index.ts`
- [API runtime](https://github.com/ladybug-w/worldmonitor/blob/main/src/services/runtime.ts): `src/services/runtime.ts`
- [Runtime settings](https://github.com/ladybug-w/worldmonitor/blob/main/src/services/runtime-config.ts): `src/services/runtime-config.ts`
- [Localization](https://github.com/ladybug-w/worldmonitor/blob/main/src/services/i18n.ts): `src/services/i18n.ts`

### Other components

- **Analyst**

## Connections

- Analyst → Dashboard app: explores (evidence: `README.md`)
- Dashboard app → App context: initializes (evidence: `src/App.ts`)
- Dashboard app → Bootstrap data: hydrates (evidence: `src/App.ts`)
- Dashboard app → Search manager: creates (evidence: `src/App.ts`)
- Dashboard app → Variant configuration: loads (evidence: `src/App.ts`)
- Dashboard app → API runtime: checks runtime (evidence: `src/App.ts`)
- Search manager → Country briefs: opens brief (evidence: `src/app/search-manager.ts`)
- Search manager → Map engines: changes layers (evidence: `src/app/search-manager.ts`)
- Country briefs → Country risk: uses scores (evidence: `src/app/country-intel.ts`)
- Country briefs → Country geometry: uses geometry (evidence: `src/app/country-intel.ts`)
- Dashboard panels → Strategic posture: includes (evidence: `src/components/index.ts`)
- Strategic posture → Domain services: presents signals
- Dashboard app → Map engines: presents layers (evidence: `README.md`)
- Dashboard app → Dashboard panels: presents intelligence (evidence: `README.md`)
- Dashboard app → AI and ML: supports AI analysis (evidence: `README.md`)
- Dashboard app → Localization: localizes (evidence: `README.md`)
- API runtime → Runtime settings: loads settings (evidence: `src/services/runtime.ts`)
- API gateway → API router: routes requests
- API router → Domain services: dispatches domains
- Domain services → News feeds: serves news (evidence: `README.md`)
- Domain services → Market history store: stores history
