Dashboard

Component Library

14 reusable components — data visualization, navigation, real-time alerts, and interactive UI.

Data Visualization

IdentityGraph

IdentityGraph.tsx·387 LOC

D3.js force-directed graph rendering identity relationships: users ↔ fingerprints ↔ domainprints ↔ domains. Canvas-based for performance with 100+ nodes. Supports zoom, pan, and click-to-select.

Key Props / State

dataGraphDataNodes and edges from /admin/identity-graph
selectedDomainstring[]Domain filter from DomainMultiSelect
onNodeClick(node) => voidOpens IdentityGraphPanel
Node types & colors:
├── user    → cyan (#06b6d4)
├── fp      → purple (#a855f7)
├── dp      → emerald (#10b981)
└── domain  → amber (#f59e0b)

Force simulation:
├── charge: -300 (repulsion)
├── link distance: 80
├── collision radius: 30
└── center: canvas center

IdentityGraphPanel

IdentityGraphPanel.tsx·152 LOC

Slide-in detail panel showing node metadata: events, related identities, risk scores. Positioned with z-index layering above the graph.

Key Props / State

nodeGraphNode | nullSelected node data
onClose() => voidClose panel callback
onNavigate(id) => voidNavigate to detail page

FraudChart

FraudChart.tsx·217 LOC

Risk score distribution chart with bar visualization. Shows breakdown by risk level (low/medium/high/critical) and detection signal types.

Key Props / State

byRiskLevelRecord<string, number>Distribution of risk levels
byReasonRecord<string, number>Count by detection signal

CollisionGraph

CollisionGraph.tsx·199 LOC

Visualizes fingerprint collisions — cases where the same browser fingerprint appears across multiple user accounts. Uses node-link diagram.

Key Props / State

fingerprintstringTarget fingerprint hash
userIdsstring[]Associated user IDs
hasCollisionsbooleanWhether collision exists

GeoMap / GeoMapInner

GeoMap.tsx + GeoMapInner.tsx·126 LOC

Geographic heatmap showing event distribution by country. Dynamic import (client-only) to avoid SSR issues with map libraries. Lazy-loaded wrapper pattern.

// GeoMap.tsx — dynamic import wrapper
const GeoMapInner = dynamic(
  () => import('./GeoMapInner'),
  { ssr: false, loading: () => <Skeleton /> }
);

ImpossibleTravelSection

ImpossibleTravelSection.tsx·103 LOC

Alert cards for impossible travel detections. Shows from/to countries, distance, speed, and risk score for each event. Sorted by speed (most extreme first).

Key Props / State

eventsImpossibleTravelEvent[]Sorted by speed_kmh desc
{
  fingerprint: "a1b2...",
  from_country: "ES",
  to_country: "JP",
  distance_km: 10200,
  delta_hours: 0.5,
  speed_kmh: 20400,
  risk_score: 90
}

Navigation & UI

Sidebar

Sidebar.tsx·188 LOC

Collapsible sidebar with 9 navigation items. Mobile: hamburger menu with overlay. Desktop: collapse/expand toggle. Active route indicator with animated cyan glow.

Key Props / State

collapsedbooleanCollapsed state (desktop)
mobileOpenbooleanOpen state (mobile)
CSS Variables:
├── --sidebar-width: 220px
├── --sidebar-collapsed: 56px
└── --header-height: 56px

Active indicator:
├── 3px cyan bar on left
├── box-shadow glow effect
└── Bold icon + text color

EventCard

EventCard.tsx·347 LOC

Rich event detail card showing all tracking data: fingerprint, domainprint, user ID, site, page, referrer, country, browser, OS, device type, risk score, fraud signals, attribution data, and timestamp.

Key Props / State

eventTrackingEventFull event object from DynamoDB
compactbooleanReduced view for tables

MetricCard

MetricCard.tsx·98 LOC

Stat display card with icon, value, label, and optional trend indicator. Used across all dashboard pages for KPIs.

Key Props / State

labelstringMetric name
valuestring | numberDisplay value
iconLucideIconIcon component
colorstringAccent color (cyan/purple/emerald/red)

DomainMultiSelect

DomainMultiSelect.tsx·113 LOC

Multi-select dropdown for filtering by domain. Used in Identity Graph and Browse pages. Glassmorphism dropdown with z-index management.

Key Props / State

domainsstring[]Available domains
selectedstring[]Currently selected
onChange(selected) => voidSelection callback

NotificationBell

NotificationBell.tsx·216 LOC

Push notification bell icon with unread count badge. Manages service worker subscription, permission request, and real-time notification display.

Key Props / State

permissionNotificationPermissionBrowser permission state
subscriptionPushSubscription | nullActive SW subscription
Flow:
1. User clicks bell
2. Request notification permission
3. Register service worker
4. Subscribe to push API
5. POST /api/push/subscribe
6. Processor Lambda → POST /api/push/send
7. Service worker shows notification

SystemStatus

SystemStatus.tsx·85 LOC

Health check widget that pings GET /health and displays service status, DynamoDB connectivity, and API version. Auto-refreshes on mount.

Key Props / State

status'ok' | 'degraded' | 'error'Service health state
databasebooleanDynamoDB connectivity
versionstringAPI version (e.g. 4.5.1)