$ show koala73/worldmonitor
WorldMonitor is a full-stack, open-source global intelligence platform providing real-time monitoring of geopolitical, economic, military, supply chain, and natural events. The codebase is overwhelmingly an application (single-page web dashboard, Vercel Edge API, Convex backend, Tauri desktop app, CLI, and SDKs) with a secondary data pipeline character (consumer price scraping, external API seeding). It powers a commercial SaaS with free and Pro tiers, featuring a map-based dashboard with 100+ configurable panels, an MCP (Model Context Protocol) server for AI agents, and extensive multi-language support (28 locales). The architecture follows a seed-cache pattern where Railway cron jobs fetch external data into Redis, and serverless Edge functions read cached JSON for low-latency responses. The frontend uses vanilla TypeScript with Vite, deck.gl/MapLibre for mapping, and a panel system for modular UI composition. The system is actively maintained, with daily commits, comprehensive test coverage (unit, integration, E2E with Playwright), and a well-documented API surface with 298 protobuf definitions across 36 domain services. While the codebase is large and occasionally duplicates shared constants across modules, it demonstrates strong software engineering practices including circuit breakers, idempotency keys, rate limiting, and a consistent handler pattern.
The LLM identified 5 files worth highlighting for reuse:
Centralized credential validation supporting multiple authentication strategies: Clerk JWT sessions, HMAC-signed anonymous tokens, enterprise-tier API keys, and user API keys. Implements timing-safe comparisons, rate-limit gating, and tier extraction. Isolated module with no internal imports, easily portable to any Node.js server.
Generic Redis caching layer with getCachedJson, setCachedJson, and cachedFetchJson that handles TTL, stampede protection via background refresh, and pipeline writes. Dependency-free Redis client wrapper with consistent error handling and fallback to stale data. Reusable in any Node.js project requiring async caching.
Defines a consistent metadata envelope (_seed, fetchedAt, state) for all cached external data. Ensures handlers can verify freshness, detect corruption, and serve stale fallbacks. Pure type and validation logic, zero runtime dependencies, extractable as an npm package.
Structured search adapter for consumer price extraction with multiple provider backends (Exa, Firecrawl, generic). Implements provider cooldown, candidate extraction validation, and deterministic search hit scoring. Clean separation of concerns with injectable providers and testable validation gates.
Idempotent retry transport for checkout POST requests using a shared idempotency key derived from checkout intent URL. Handles network failures, duplicate submissions, and rate-limit backoff. Pure function with no DOM dependencies, shared between the main dashboard and pro marketing site.