Skip to main content

What Are Variants?

World Monitor uses a variant system that packages the same codebase with different configurations, data sources, and UI themes to create specialized dashboards for different use cases:
VariantDomainFocus Area
World Monitor (full)worldmonitor.appGeopolitics, military, conflicts, infrastructure
Tech Monitortech.worldmonitor.appStartups, AI/ML, cloud, cybersecurity
Finance Monitorfinance.worldmonitor.appGlobal markets, trading, central banks, Gulf FDI
Happy Monitorhappy.worldmonitor.appGood news, positive trends, uplifting stories
All four variants run from a single codebase β€” the build system configures features, data sources, and styling based on the VITE_VARIANT environment variable.

How Variants Work

Build-Time Configuration

Variants are configured at build time via the VITE_VARIANT environment variable in vite.config.ts:
vite.config.ts
const activeVariant = process.env.VITE_VARIANT || 'full';
const activeMeta = VARIANT_META[activeVariant] || VARIANT_META.full;
Each variant has metadata defining:
  • SEO metadata: title, description, keywords, Open Graph tags
  • URLs: canonical URL and live demo link
  • Categories: PWA manifest categories (e.g., ['news', 'productivity'])
  • Features: list of available features for the variant

Variant Metadata (vite.config.ts:40-144)

{
  title: 'World Monitor - Real-Time Global Intelligence Dashboard',
  description: 'Real-time global intelligence dashboard with live news, markets, military tracking, infrastructure monitoring, and geopolitical data.',
  url: 'https://worldmonitor.app/',
  siteName: 'World Monitor',
  shortName: 'WorldMonitor',
  categories: ['news', 'productivity'],
  features: [
    'Real-time news aggregation',
    'Stock market tracking',
    'Military flight monitoring',
    'Ship AIS tracking',
    'Earthquake alerts',
    'Protest tracking',
    'Power outage monitoring',
    'Oil price analytics',
    'Government spending data',
    'Prediction markets',
    'Infrastructure monitoring',
    'Geopolitical intelligence',
  ]
}

Switching Between Variants

In Production (Web)

Each variant is deployed to its own subdomain. The header bar displays clickable links to other variants:
🌍 World  |  πŸ’» Tech  |  πŸ“ˆ Finance  |  β˜€οΈ Good News
Clicking a variant link navigates to that variant’s live deployment:
  • worldmonitor.app β†’ tech.worldmonitor.app
  • finance.worldmonitor.app β†’ happy.worldmonitor.app

In Desktop App

The desktop app (Tauri) allows in-app variant switching without navigating to a different URL:
  1. Click any variant in the header bar (🌍 World, πŸ’» Tech, πŸ“ˆ Finance)
  2. The app stores the selection in localStorage as worldmonitor-variant
  3. On next reload, the app loads the selected variant
Code reference: src/config/variant.ts:1-12
export const SITE_VARIANT: string = (() => {
  const env = import.meta.env.VITE_VARIANT || 'full';
  // Build-time variant (non-full) takes priority β€” each deployment is variant-specific.
  // Only fall back to localStorage when env is 'full' (allows desktop app variant switching).
  if (env !== 'full') return env;
  if (typeof window !== 'undefined') {
    const stored = localStorage.getItem('worldmonitor-variant');
    if (stored === 'tech' || stored === 'full' || stored === 'finance' || stored === 'happy') return stored;
  }
  return env;
})();

In Development

Use npm scripts to launch specific variants:
npm run dev
# or explicitly:
npm run dev:full

Building Variants

Production Builds

Each variant has its own build script in package.json:
npm run build:full
# Sets VITE_VARIANT=full

Desktop Builds

Desktop apps are built with variant-specific Tauri configurations:
npm run desktop:build:full
# Uses src-tauri/tauri.conf.json

Variant-Specific Features

UI Theme Customization

The Happy Monitor variant uses a warm cream theme instead of the default dark theme:
src/styles/happy-theme.css:9-100
:root[data-variant="happy"],
:root[data-variant="happy"][data-theme="light"] {
  --bg: #FAFAF5;  /* Warm cream background */
  --text: #2c2c2c;
  --panel-bg: #ffffff;
  /* ... 90+ more color variable overrides */
}
The variant is detected via the data-variant attribute on the root element.

RSS Feed Selection

Each variant loads a curated set of RSS feeds:
  • World Monitor: 150+ geopolitical, defense, and energy feeds
  • Tech Monitor: 100+ tech news, AI labs, startup, and cybersecurity feeds
  • Finance Monitor: 120+ market news, trading, central bank, and economic feeds
  • Happy Monitor: 40+ positive news, science breakthrough, and conservation feeds
Code reference: RSS feed configuration is defined in variant-specific feed lists

Map Layers

Variants enable/disable map layers based on relevance:
LayerWorldTechFinanceHappy
Military basesβœ…βŒβŒβŒ
Nuclear facilitiesβœ…βŒβŒβŒ
Tech HQsβŒβœ…βŒβŒ
Datacentersβœ…βœ…βŒβŒ
Stock exchangesβœ…βŒβœ…βŒ
Central banksβŒβŒβœ…βŒ
Positive eventsβŒβŒβŒβœ…

Analytics & Tracking

Variant switches are tracked for analytics:
src/services/analytics.ts:78,303
wm_variant_switched: new Set(['from', 'to']),

trackEventBeforeUnload('wm_variant_switched', { from, to });
This allows monitoring user preferences for variant selection.

Next Steps

World Monitor

Full geopolitical intelligence variant

Tech Monitor

AI & tech industry variant

Finance Monitor

Markets & trading variant

Happy Monitor

Positive news variant

Build docs developers (and LLMs) love