Skip to main content

Tech Stack

Frontend

TechnologyPurposeVersion
TypeScriptType-safe JavaScript5.7.2
ViteBuild tool and dev server6.0.7
MapLibre GL JS2D/3D map rendering5.16.0
deck.glWebGL data visualization9.2.6
D3.jsCharts and data transformations7.9.0
i18nextInternationalization (16 languages)25.8.10
Vite PWAProgressive web app features1.2.0

Backend (Serverless)

TechnologyPurpose
Vercel Edge FunctionsServerless API routes
Node.jsServer runtime
SebufTypeScript RPC framework
Upstash RedisDistributed cache and rate limiting
ConvexReal-time database for registrations

Desktop (Tauri)

TechnologyPurposeVersion
TauriNative app framework2.10.0
RustBackend runtime
Node.js SidecarLocal API server18+

AI & ML

TechnologyPurpose
Transformers.jsBrowser-side ML (NER, sentiment)2.17.2
ONNX Runtime WebNeural network inference1.23.2
OllamaLocal LLM inference
GroqCloud LLM inference (Llama 3.1 8B)
OpenRouterMulti-model LLM gateway

Data Processing

TechnologyPurpose
PapaParseCSV parsing5.5.3
fast-xml-parserXML/RSS parsing5.3.7
topojson-clientTopoJSON mesh rendering3.1.0
h3-jsHexagonal spatial indexing4.4.0

Protobuf Tooling

ToolPurposeVersion
bufProto linting and generation1.64.0
sebufTypeScript RPC code generator0.7.0
protoc-gen-ts-clientClient stub generator
protoc-gen-ts-serverServer handler generator
protoc-gen-openapiv3OpenAPI spec generator

System Architecture

High-Level Design

Proto-First API Flow

Desktop Architecture

Project Structure

worldmonitor/
├── api/                          # Vercel serverless functions
│   ├── [domain]/v1/[rpc].ts     # Sebuf RPC gateway catch-all
│   ├── download.ts              # Desktop installer redirect
│   └── og-story.ts              # Dynamic Open Graph images
├── convex/                       # Convex database schema
├── data/                         # Static datasets (GeoJSON, CSV)
├── deploy/                       # Deployment configs
├── docs/                         # Documentation source
│   └── api/                     # Generated OpenAPI specs
├── e2e/                         # Playwright E2E tests
├── proto/                       # Protocol buffer definitions
│   ├── buf.gen.yaml             # Code generation config
│   ├── sebuf/                   # Sebuf framework protos
│   └── worldmonitor/            # Service definitions (20 domains)
│       ├── aviation/v1/
│       ├── climate/v1/
│       ├── conflict/v1/
│       ├── cyber/v1/
│       ├── seismology/v1/
│       └── ...
├── public/                      # Static assets
├── scripts/                     # Build and utility scripts
│   ├── build-sidecar-sebuf.mjs # Bundle sidecar gateway
│   ├── desktop-package.mjs     # Package desktop builds
│   ├── ais-relay.cjs           # Railway relay server
│   └── ...
├── server/                      # Server-side handler implementations
│   ├── router.ts               # HTTP route matcher
│   ├── cors.ts                 # CORS policy
│   ├── error-mapper.ts         # Error response formatter
│   └── worldmonitor/           # Handler implementations
│       ├── seismology/v1/handler.ts
│       ├── aviation/v1/handler.ts
│       └── ...
├── src/                         # Frontend source code
│   ├── App.ts                  # Main application entry
│   ├── main.ts                 # Vite entry point
│   ├── components/             # UI components (panels, modals)
│   ├── services/               # Data fetching services
│   ├── utils/                  # Helper functions
│   ├── config/                 # Configuration files
│   ├── locales/                # i18n translation files (16 languages)
│   ├── workers/                # Web Workers (ML inference)
│   ├── generated/              # Generated code (DO NOT EDIT)
│   │   ├── client/             # TypeScript RPC clients
│   │   └── server/             # TypeScript RPC servers
│   └── styles/                 # Global CSS
├── src-tauri/                   # Tauri desktop app
│   ├── src/                    # Rust source code
│   ├── sidecar/                # Node.js sidecar server
│   └── tauri.conf.json         # Tauri configuration
├── tests/                       # Unit and API tests
├── vite.config.ts              # Vite build configuration
├── playwright.config.ts        # Playwright test configuration
├── tsconfig.json               # TypeScript configuration
├── Makefile                    # Development commands
└── package.json                # npm scripts and dependencies

Key Directories Explained

/proto

Contains all protocol buffer definitions organized by domain:
  • 20 service domains: aviation, climate, conflict, cyber, displacement, economic, giving, infrastructure, intelligence, maritime, market, military, news, positive_events, prediction, research, seismology, supply_chain, trade
  • buf.gen.yaml: Configures code generation plugins
  • buf.yaml: Proto linting rules and dependencies

/src/generated

WARNING: Never edit files here manually. This directory is regenerated by make generate.
  • client/: TypeScript RPC clients for frontend use
  • server/: TypeScript server stubs for backend handlers
Both are auto-generated from proto definitions.

/server

Server-side handler implementations that fulfill the generated service interfaces:
// Example: server/worldmonitor/seismology/v1/handler.ts
export const seismologyHandler: SeismologyService = {
  async listEarthquakes(req, context) {
    // Fetch from USGS API
    // Transform to proto response
    return { earthquakes };
  },
};

/api

Vercel serverless functions. Most routes are handled by the catch-all:
/api/[domain]/v1/[rpc].ts
This single file routes all RPC requests to their respective handlers.

/scripts

Build and utility scripts:
  • build-sidecar-sebuf.mjs: Bundles the sidecar gateway for Tauri
  • desktop-package.mjs: Creates signed installers for macOS/Windows
  • ais-relay.cjs: Railway relay server for AIS/OpenSky/Telegram
  • validate-rss-feeds.mjs: Tests all RSS feed URLs

/e2e

Playwright end-to-end tests:
  • runtime-fetch.spec.ts: Tests all API endpoints across variants
  • map-harness.spec.ts: Visual regression tests for map layers
  • circuit-breaker-persistence.spec.ts: Circuit breaker behavior
  • keyword-spike-flow.spec.ts: Keyword spike detection

Build Variants

World Monitor supports 4 build variants from a single codebase:
VariantDomainFocusData Layers
Fullworldmonitor.appGeopolitics, military, conflicts40+ layers
Techtech.worldmonitor.appAI/ML, startups, cloudTech-specific
Financefinance.worldmonitor.appMarkets, trading, central banksFinancial centers, exchanges
Happyhappy.worldmonitor.appGood news, positive trendsUplifting stories
Variants are controlled by the VITE_VARIANT environment variable.

Data Flow

News Aggregation

AI Summarization

Map Rendering Pipeline

Configuration Files

vite.config.ts

Configures:
  • Build variants with dynamic HTML meta injection
  • Brotli pre-compression
  • Service worker registration (PWA)
  • Dev server plugins (sebuf, RSS proxy, Polymarket, YouTube)
  • Chunk splitting strategy

playwright.config.ts

Configures:
  • Test directory: ./e2e
  • Base URL: http://127.0.0.1:4173
  • Browser: Chromium with SwiftShader (headless GPU)
  • Retries: 0 (fail fast)
  • Workers: 1 (serial execution)

tsconfig.json

TypeScript settings:
  • Target: ES2020
  • Module: ESNext
  • Strict mode enabled
  • Path alias: @/*src/*

Makefile

Development commands:
  • make install — Install all dependencies
  • make generate — Generate code from protos
  • make lint — Lint proto files
  • make clean — Remove generated code

Next Steps

Proto API

Learn the proto-first workflow

Building

Build for production and desktop

Build docs developers (and LLMs) love