Skip to content

SafeWatch Overview

SafeWatch is the ApexLab admin dashboard — a Blazor Server app mounted inside SimCopilot.Api at /safewatch. It provides real-time visibility into system health, user activity, and business metrics for four internal roles.


Access

Navigate to /safewatch on any running API instance. You will be redirected to /safewatch/login.

Internal only

The /safewatch prefix is not documented in Swagger. No links to it appear in any public API response.


Architecture

Request → SafeWatchAuthMiddleware
               ↓ no valid cookie
         redirect → /safewatch/login
               ↓ valid cookie
         Blazor Server circuit → page renders with direct AppDbContext access

SafeWatch components access the database directly via IDbContextFactory<AppDbContext>. All queries use AsNoTracking() and are read-only.


Modules

Module sys_admin product support ceo
KPI Dashboard
Event Explorer
User Explorer
Feature Analytics
Funnels
Alerts Center
Global Search

See Modules for details on each.


Data Sources

All data comes from the five Phase 1 event tables: api_request_events, auth_events, session_events, ai_events, leaderboard_events. The existing users table is also queried for user counts.


File Structure

SafeWatch/
  Auth/           SafeWatchAuthMiddleware, LoginService, Credentials config
  Components/     App.razor, Routes.razor, Layout, Shared components
  Pages/          12 Razor pages (Login + 4 dashboards + 7 modules)
  Services/       EventQueryService, UserTimelineService, MetricsService, AlertsService