archwall 把架构画全Every architecture, drawn in full

World Monitor:从全球数据到同一张态势图World Monitor: from global feeds to a shared picture

osintmapsdata-pipelinetypescriptdesktop

World Monitor: from sources to a shared picture: External news, markets, conflict, climate, ships and aircraft feed Railway relay and seed jobs. Upstash Redis holds shared datasets and freshness metadata; Convex holds account state and, when configured, intelligence history. Vercel APIs and the desktop Node sidecar serve the browser or desktop maps, panels and analysis, and API, CLI, SDK and MCP consumers. When WS_RELAY_URL is set, relay vessel snapshots also reach Vercel APIs directly. Configured AI providers enrich intelligence. The remaining figures explain ingestion, gateway, quote reads, queued jobs, browser, intelligence, accounts, desktop and operations.

World Monitor 把新闻、市场、追踪、事件数据放进地图、面板。Railway 采集,Redis 共享,Convex 保存账户,配置齐全时存情报历史。

中继、定时采集、价格爬虫发布;启动接口读缓存,健康检查报过期、缺失。

Data collection and delivery: Railway relays collect streams and RSS. Scheduled seed bundles validate upstream data before publishing Redis keys. Consumer Prices Core stores retailer observations in PostgreSQL and aggregates prices into snapshots. Redis carries canonical data, optional freshness envelopes and seed metadata. Bootstrap batches fast and slow tier reads into a browser hydration cache, while RPC handlers read domain keys. Health checks inspect freshness and service status.
采集发布数据,读端与健康检查共用缓存。

契约生成接口,网关检查权限、限流、缓存。运维、MCP 另设入口。

Contracts and the API gateway: HTTP-annotated protobuf services generate TypeScript clients, server routes and OpenAPI. Browser clients send requests through a shared domain gateway. It checks origins, credentials and entitlements, limits requests and invokes handwritten handlers. Status-200 GET or HEAD bodies receive cache policy, optional JSON projection and ETag validation. Operational APIs and MCP have separate entry points.
HTTP 契约生成客户端和路由;网关检查访问权限并控制缓存。

股票指数先读种子;缺代码先准入,再查缓存,未中取价。

Stock and index quotes: seed first: A stock or index quote request reads the fixed market seed first. An invalid or empty seed returns unavailable without calling a provider. Symbols found in the seed are answered. Missing symbols must first be admitted: a provider has to be configured, support the symbol and fit the per-request limit. Only admitted symbols check their per-symbol cache, and a cache hit answers without a provider call. A provider is called only on a cache miss. The answer keeps the requested order and gives a reason for each unavailable symbol.
股票指数行情先读种子,缺失代码须先准入,再查缓存,未中才取价。

情景任务排队:先给任务号,后台计算,客户端轮询。

Queued scenario jobs: A scenario request passes its checks, then the owner key and a pending queue entry are written in one transaction, and the caller gets a job id and status address. A background worker claims a pending job, records it as processing, and writes done or failed under the owner-scoped result key. On restart, requeued jobs with any saved result record are skipped; a saved processing record can leave an unfinished job uncomputed. The status route checks premium access and the owner key, then reads the result key. A missing owner key or result reads as pending, so polling can start at once. Simulation and deep-forecast use sorted-set queues instead.
情景任务先排队,后台进程领取计算,客户端可随时轮询状态。

AppContext 连接加载器、面板、地图。存偏好与历史;隐藏页暂停轮询,返回补刷。

From shared data to the dashboard: App starts storage and language services, hydrates bootstrap data, and shares mutable AppContext with layout and data-loading managers. Variants choose defaults. Panels and lazy map renderers show the resulting data. Local storage preserves preferences and history; workers move analysis off the UI thread. Refresh pauses in hidden tabs and staggers stale work when they return.
启动缓存与实时加载汇入 AppContext,再交给面板、地图和后台线程。

浏览器整理新闻、发突发提醒;服务端评分读缓存;RSS、警笛分开告警。浏览器模型需开启或桌面模式;接口摘要需权益与配置,T5 兜底。

From observations to signals and summaries: In the browser, news items receive keyword threat labels and locations, then word-overlap clustering with optional semantic refinement. Cached physical and news observations also feed server country and strategic risk, geographic correlations and seasonal-count anomalies. Risk health checks source coverage; anomalies require enough baseline samples. Optional local ML supplies embeddings, sentiment and named entities. Summary requests use configured entitled APIs Ollama then OpenRouter in normal mode, followed by available browser T5; beta can try already-loaded local T5 first. RSS breaking alerts and OREF sirens form distinct notification inputs.
新闻解析、风险信号、可选 AI 摘要与突发提醒各走不同路径。

Clerk 识别用户,Dodo 支付更新 Convex 权益,支撑偏好、通知、密钥、智能体访问。

Accounts, durable state and access: Clerk signs in dashboard users. Edge APIs verify session JWTs and persist preferences, followed countries, notification settings and subscription state in Convex. Dodo checkout sends signed payment webhooks that update subscription records. External agents use API keys or MCP OAuth; MCP domain tools can call the same domain handlers through authenticated requests. Redis caches access rights while Convex holds durable records. Separately, when its config is set, history append stores intelligence events and vectors in Convex for timeline and semantic search; seed collection runs without it.
Clerk 识别用户,Convex 保存账户,配置齐全时另存历史记录,支付事件和缓存权益决定访问权限。

Tauri 启动 Node 服务,密钥存系统密钥库,部分接口优先云端,可回退。容器可代理云端或本地接口。

Desktop and Docker choices: Tauri wraps the dashboard. Native Rust owns the operating-system keyring and authenticates loopback calls to a Node sidecar. The sidecar runs local handlers and uses selected cloud-preferred routes or gated fallback. The frontend Docker image serves static assets through nginx and proxies APIs to its configured upstream. The root Docker image combines nginx and Node, with Compose wiring Redis REST, Redis and an AIS relay. Docker mode disables public-cloud fallback; provider keys are optional.
桌面端用系统密钥库保管密钥并运行本地接口;Docker 可只托管前端,也可一起运行接口、缓存和中继。

检查、部署、发行各走流程;新鲜度探针、缓存鉴权检查、部署偏差审计跟踪生产;配 DSN 的网页由 Sentry 上报。

Build, deploy and observe: GitHub checks types, code, tests, security, proto generation and stacked merges; Deploy Gate aggregates results for a commit. Vercel serves the web app and API; Railway runs ingestion; Convex and Cloudflare have separate deployment workflows. Desktop releases build the Tauri app with its Node sidecar; GHCR publishes container images. Scheduled probes check data freshness, API cache and authentication, and Railway drift; Sentry reports client faults when a DSN is set. These are independent checks and deployment surfaces, not one ordered release pipeline.
检查、部署和生产监控由各自工作流负责。

World Monitor turns news, markets, tracking feeds and event records into maps and panels. Railway collects and publishes datasets; Redis shares them across readers. Convex keeps accounts and, when configured, intelligence history.

Relays, scheduled seed bundles and retailer scrapers have distinct publishing paths. Bootstrap loads cached datasets into the dashboard; health checks expose stale or missing data.

Data collection and delivery: Railway relays collect streams and RSS. Scheduled seed bundles validate upstream data before publishing Redis keys. Consumer Prices Core stores retailer observations in PostgreSQL and aggregates prices into snapshots. Redis carries canonical data, optional freshness envelopes and seed metadata. Bootstrap batches fast and slow tier reads into a browser hydration cache, while RPC handlers read domain keys. Health checks inspect freshness and service status.
Collectors publish data; readers and health checks share the cache.

Protobuf contracts generate domain clients and routes. The gateway checks access, limits requests and controls response caching. Operational endpoints and MCP have separate entry points.

Contracts and the API gateway: HTTP-annotated protobuf services generate TypeScript clients, server routes and OpenAPI. Browser clients send requests through a shared domain gateway. It checks origins, credentials and entitlements, limits requests and invokes handwritten handlers. Status-200 GET or HEAD bodies receive cache policy, optional JSON projection and ETag validation. Operational APIs and MCP have separate entry points.
HTTP contracts generate clients and routes; the gateway checks access and controls caching.

Stock and index quotes read a seed first. Missing symbols must be admitted before a cache check, and a provider is called only on a miss.

Stock and index quotes: seed first: A stock or index quote request reads the fixed market seed first. An invalid or empty seed returns unavailable without calling a provider. Symbols found in the seed are answered. Missing symbols must first be admitted: a provider has to be configured, support the symbol and fit the per-request limit. Only admitted symbols check their per-symbol cache, and a cache hit answers without a provider call. A provider is called only on a cache miss. The answer keeps the requested order and gives a reason for each unavailable symbol.
Stock and index quotes read a seed first; missing symbols must be admitted before a cache check and any provider call.

Scenario runs are queued. The caller gets a job id at once; a background worker claims and computes it while clients poll for status.

Queued scenario jobs: A scenario request passes its checks, then the owner key and a pending queue entry are written in one transaction, and the caller gets a job id and status address. A background worker claims a pending job, records it as processing, and writes done or failed under the owner-scoped result key. On restart, requeued jobs with any saved result record are skipped; a saved processing record can leave an unfinished job uncomputed. The status route checks premium access and the owner key, then reads the result key. A missing owner key or result reads as pending, so polling can start at once. Simulation and deep-forecast use sorted-set queues instead.
Scenario jobs queue first; a background worker claims and computes them, and clients can poll for status at any time.

AppContext connects loaders, panels and maps. Storage preserves preferences and history. Polling pauses in hidden tabs and catches up when they return.

From shared data to the dashboard: App starts storage and language services, hydrates bootstrap data, and shares mutable AppContext with layout and data-loading managers. Variants choose defaults. Panels and lazy map renderers show the resulting data. Local storage preserves preferences and history; workers move analysis off the UI thread. Refresh pauses in hidden tabs and staggers stale work when they return.
Bootstrap data and live loaders meet in AppContext; panels, maps and workers share the result.

The browser groups news and raises breaking alerts; server scores read cached feeds. RSS and siren alerts stay separate. Browser ML needs its runtime setting or desktop mode. API news summaries need entitlement and provider configuration; browser T5 offers a fallback.

From observations to signals and summaries: In the browser, news items receive keyword threat labels and locations, then word-overlap clustering with optional semantic refinement. Cached physical and news observations also feed server country and strategic risk, geographic correlations and seasonal-count anomalies. Risk health checks source coverage; anomalies require enough baseline samples. Optional local ML supplies embeddings, sentiment and named entities. Summary requests use configured entitled APIs Ollama then OpenRouter in normal mode, followed by available browser T5; beta can try already-loaded local T5 first. RSS breaking alerts and OREF sirens form distinct notification inputs.
News interpretation, risk signals, optional AI summaries and breaking alerts follow separate paths.

Clerk identifies users. Dodo payment events update Convex entitlements. Preferences, notifications, keys and agent access use these account services.

Accounts, durable state and access: Clerk signs in dashboard users. Edge APIs verify session JWTs and persist preferences, followed countries, notification settings and subscription state in Convex. Dodo checkout sends signed payment webhooks that update subscription records. External agents use API keys or MCP OAuth; MCP domain tools can call the same domain handlers through authenticated requests. Redis caches access rights while Convex holds durable records. Separately, when its config is set, history append stores intelligence events and vectors in Convex for timeline and semantic search; seed collection runs without it.
Clerk identifies users; Convex stores accounts and, when configured, history records, while payment events and cached rights control access.

Tauri runs a Node sidecar with keyring-backed secrets. Cloud-preferred routes and fallback still use hosted APIs. Container builds offer either a frontend proxy or a local API runtime.

Desktop and Docker choices: Tauri wraps the dashboard. Native Rust owns the operating-system keyring and authenticates loopback calls to a Node sidecar. The sidecar runs local handlers and uses selected cloud-preferred routes or gated fallback. The frontend Docker image serves static assets through nginx and proxies APIs to its configured upstream. The root Docker image combines nginx and Node, with Compose wiring Redis REST, Redis and an AIS relay. Docker mode disables public-cloud fallback; provider keys are optional.
Desktop protects secrets in the OS keyring and runs a local sidecar. Docker can host the frontend alone or the API, cache and relay together.

Build checks, cloud deployments and distributed releases have separate workflows. Freshness probes, access checks and deployment audits watch production. Sentry watches web builds configured with a DSN.

Build, deploy and observe: GitHub checks types, code, tests, security, proto generation and stacked merges; Deploy Gate aggregates results for a commit. Vercel serves the web app and API; Railway runs ingestion; Convex and Cloudflare have separate deployment workflows. Desktop releases build the Tauri app with its Node sidecar; GHCR publishes container images. Scheduled probes check data freshness, API cache and authentication, and Railway drift; Sentry reports client faults when a DSN is set. These are independent checks and deployment surfaces, not one ordered release pipeline.
Separate workflows check changes, deploy services and observe production.

来源Source: github.com

← 全部架构← All architectures