ExfilGuardian
Frontend

Frontend

Desktop application with Electron + Next.js 16

Overview

The desktop application is the primary operator interface for ExfilGuardian. It connects to the Rust server's REST API and displays real-time alerts, metrics, and capture status. The app runs as a native desktop application via Electron, with the UI built in Next.js 16 (App Router).

Stack

TechnologyVersionPurpose
Next.js16.1React framework (App Router + Turbopack)
React19.2UI library
Electron40Desktop wrapper
coss uilatestComponent library (Base UI + Tailwind v4)
Zustand5Client state management
TanStack Query5Server state management
Recharts3Data visualization
Biome2.3Linter + formatter
Bun1.3+Runtime + package manager

Pages

The app has 6 pages accessible via the sidebar:

RoutePageDescription
/HomeRedirects to /dashboard
/dashboardDashboard4 KPI cards, traffic chart, threat distribution, layer status, quick actions
/threatsThreatsFilterable threat list by severity, split-panel detail view
/threats/[id]Threat DetailFull-page view of a single threat with all metadata
/captureCaptureInterface selector, capture controls, packet stats, protocol distribution
/analysisAnalysis24h correlation graph, detection layers overview, signatures list, behavioral stats
/settingsSettingsGeneral, capture, detection, and storage configuration panels

Current State

The frontend is connected to the real backend — there is no mock mode. Every page reads live data from the Rust REST API via TanStack Query; when the server is unreachable it degrades to empty lists plus an "offline" banner driven by /api/status.

What works now:

  • Live dashboard, threats, flows, processes, files, DNS, analysis, rules, reports, settings, and the admin area (agents, users, enrollment, organization, fleet map)
  • Real-time charts and metrics polled from GET /api/v1/metrics
  • Full user management: Better Auth (admin + organization/teams) on PostgreSQL/Drizzle, roles, email invitations (Resend), guards enforced
  • AI report analysis (Claude) that ranks alerts and flags likely false positives
  • Runs both as a native Electron app and as a standalone Next.js server (production)
  • Settings persistence (in-memory, not synced to backend)
  • Dark mode support via Tailwind

What needs wiring:

  • Electron IPC handlers → Rust REST API (/api/v1/alerts, /api/v1/metrics)
  • Real threat data from the correlation engine
  • Real capture stats from the agent
  • Settings sync with config.yaml

Development

Start Desktop App

cd desktop
bun install
bun run dev:electron

This runs two processes concurrently:

  1. next dev --turbopack on localhost:3000
  2. electron . loading the Next.js dev server

Start Web Only

cd desktop
bun run dev

Commands

CommandDescription
bun run devNext.js dev server only
bun run dev:electronNext.js + Electron
bun run buildBuild Next.js + compile Electron TS
bun run packBuild + package (unpacked)
bun run distBuild + package (distributable)
bun run checkBiome lint check
bun run check:fixBiome auto-fix
bun run formatBiome format
bun run typecheckTypeScript type check

Sub-pages

  • Next.js: App Router patterns, routing, server/client components
  • Components: coss ui library and component patterns
  • State Management: Zustand stores, TanStack Query, data flow
  • Electron: Main process, IPC handlers, security model

On this page