Architecture
The dashboard is built using the following technologies:- Framework: Next.js 14+ with App Router
- UI Components: React with shadcn/ui component library
- Styling: Tailwind CSS with custom design tokens
- Real-time Communication: WebSocket for live log streaming
- API Client: Axios and Fetch API for REST and SSE endpoints
Frontend Stack
Next.js App Router with TypeScript and React 18+
Backend API
FastAPI (Python) with CORS and WebSocket support
Real-time Updates
WebSocket connections for live log streaming
Responsive Design
Mobile-first design with Tailwind CSS
Main Layout
The dashboard follows a three-column responsive layout:Key Components
Header Component
The header displays the agent’s current status and provides control buttons:The header polls the
/agent/state endpoint every 2 seconds to keep the UI synchronized with the backend state.Agent States
The dashboard supports the following agent states:Idle
Agent is not running. Ready to start a new scan.
Running
Agent is actively monitoring and executing remediation tasks.
Waiting
Agent requires user approval before executing critical commands.
Error
Agent encountered an error during execution.
Responsive Breakpoints
The dashboard uses Tailwind CSS breakpoints:| Breakpoint | Width | Layout |
|---|---|---|
sm | 640px | Single column |
md | 768px | Two-column status grid |
lg | 1024px | Four-column status grid |
xl | 1280px | Three-column main layout |
Environment Variables
Configure the dashboard using the following environment variables:Starting the Dashboard
To run the development server:http://localhost:3000.
API Integration
The dashboard communicates with the FastAPI backend through:- REST endpoints - For status queries and control actions
- WebSocket - For real-time log streaming
- Server-Sent Events (SSE) - For streaming chat responses
/lib/api.ts for maintainability.
Next Steps
Terminal
Learn about the live terminal component
Chat Interface
Explore the RAG-powered chat panel
Service Status
Understand service status monitoring
Configuration
Configure dashboard settings