Skip to content

SiteSwarm Central Command Center (apps/command-center)

SiteSwarm Central Command Center (apps/command-center)

Section titled β€œSiteSwarm Central Command Center (apps/command-center)”

The unified internal control plane and operational cockpit for SiteSwarm agency staff, platform engineers, and support teams.

apps/command-center provides a single pane of glass across multi-tenant CMS operations, synthetic fleet health, on-call incident escalation, and visitor telemetry without requiring engineers to access disparate client domains or vendor dashboards.


The application is built with Astro SSR and hosted as an edge worker isolate on Cloudflare Workers:

  • Edge SSR (output: "server"): Server-side rendered with dynamic per-request identity evaluation and zero persistent compute overhead.
  • Cloudflare Workers Adapter: Deployed via @astrojs/cloudflare with nodejs_compat compatibility flags.
  • Zero Trust Perimeter: Shielded by Cloudflare Zero Trust (Access) enforcing corporate SSO (Google Workspace / GitHub OAuth) and hardware passkeys.
  • Cryptographic JWT Guard: Middleware parses and validates Cf-Access-Jwt-Assertion and Cf-Access-Authenticated-User-Email headers, enforcing expiration windows and audience/issuer constraints.
  • Role-Based Access Control (RBAC): Maps authenticated email assertions and identity claims to granular roles (admin, support, editor) following the ADR-0004 security matrix.
  • 0ms Service Bindings: Communicates with internal platform workers (services/cms-service, services/synthetic-monitoring, services/leads-service) with zero public network hops.

apps/command-center organizes platform operations into five core workspaces:

  1. Mission Control Overview (/): Consolidated operational cockpit displaying active client fleet status, latency benchmarks, synthetic uptime, and active incidents.
  2. CMS Fleet Studio (/cms): Unified multi-tenant content management studio with schema form builder, instant Cache-Tag invalidation bridge, and 1-click client admin launchpad.
  3. Fleet Health & Observability (/health): Abstracted health gateway consuming synthetic pinger probes and streaming real-time edge exceptions from Cloudflare Tail Workers.
  4. Incident Ops & On-Call Center (/incidents): Live on-call roster, 1-click page triage and acknowledgment, and emergency static maintenance overrides.
  5. Telemetry & Client Analytics (/analytics): Fleet traffic aggregates, lead conversion pipelines, Core Web Vitals gauges, and dual-surface EmDash plugin metrics.

Pressing Cmd + K (or Ctrl + K) triggers the global Command Palette modal powered by React (src/components/CommandPalette.tsx), providing instant keyboard navigation across:

  • Operational navigation routes
  • Client tenant workspaces (Green Leaf Bakery, Apex Labs, Precision Auto Repair, Portfolio)
  • Quick actions (trigger synthetic probes, purge global cache tags)

apps/command-center/
β”œβ”€β”€ astro.config.mjs # Astro SSR + Cloudflare adapter + React + Tailwind
β”œβ”€β”€ package.json # Workspace package (@siteswarm/command-center)
β”œβ”€β”€ tsconfig.json # TypeScript config extending root tsconfig.base.json
β”œβ”€β”€ wrangler.jsonc # Cloudflare Workers configuration with nodejs_compat
β”œβ”€β”€ src/
β”‚ β”œβ”€β”€ env.d.ts # App.Locals typing (user identity and role context)
β”‚ β”œβ”€β”€ middleware.ts # Perimeter authentication middleware
β”‚ β”œβ”€β”€ lib/
β”‚ β”‚ └── auth.ts # JWT parsing, assertion verification, and RBAC mapping
β”‚ β”œβ”€β”€ components/
β”‚ β”‚ └── CommandPalette.tsx # React keyboard command palette (Cmd+K)
β”‚ β”œβ”€β”€ layouts/
β”‚ β”‚ └── DashboardLayout.astro# Shell layout with header, navigation, and role badge
β”‚ β”œβ”€β”€ pages/
β”‚ β”‚ β”œβ”€β”€ index.astro # Mission Control overview
β”‚ β”‚ β”œβ”€β”€ cms.astro # CMS Fleet Studio
β”‚ β”‚ β”œβ”€β”€ health.astro # Fleet Health & Observability
β”‚ β”‚ β”œβ”€β”€ incidents.astro # Incident Ops & On-Call
β”‚ β”‚ β”œβ”€β”€ analytics.astro # Telemetry & Analytics Explorer
β”‚ β”‚ └── api/
β”‚ β”‚ └── health.ts # Public health check endpoint
β”‚ └── styles/
β”‚ └── global.css # Tailwind CSS v4 styling
└── tests/
└── auth.test.ts # JWT perimeter & RBAC test suite (23 unit tests)

Run tests and verification:

Terminal window
# Execute unit test suite
pnpm --filter @siteswarm/command-center test
# Typecheck and lint Astro templates
pnpm --filter @siteswarm/command-center run check
# Build serverless SSR worker
pnpm --filter @siteswarm/command-center run build
# Run architectural linters
npx tsx scripts/arch-lint.ts

Governed under ADR-0004: Central Command Center Architecture.