Skip to main content

Frontend Overview

Introduction

This document provides a comprehensive overview of the Ravenxcope frontend service. The frontend is a React single-page application built for the RavenXcope defense center platform. It provides authentication, organization onboarding, sensor management, user and role management, dashboard monitoring, and security analytics.

The application is built as a Vite-powered static web app and served through Nginx in production. Runtime configuration is injected into window.__APP_CONFIG__, allowing the same built artifact to point to different backend environments.


Technology Stack

CategoryTechnologyVersionPurpose
Runtime UIReact19.2.0Component model and rendering
LanguageTypeScript5.9.xType-safe application code
Build ToolVite7.2.xDev server and production bundling
Routingreact-router-dom7.11.xClient-side routes and nested layout
HTTP ClientAxios1.13.xREST API calls and interceptors
Auth Storagejs-cookie3.0.xToken and session persistence
I18nreact-i18next16.xMulti-language support
UI BaseRadix UI2.xAccessible primitive components
UI SystemTailwind CSS4.xUtility-first styling
ChartsRecharts3.6.xData visualization
PDF ExportjsPDF4.xAnalytics report generation

Application Responsibilities

The frontend service is responsible for:

  1. Authentication: Managing user login/logout and session persistence.
  2. Access Control: Protecting private dashboard routes and enforcing UI-level permissions.
  3. Shell Orchestration: Providing a responsive layout with sidebars, mobile drawers, and user menus.
  4. Data Integration: Calling the backend API via a centralized client with interceptors.
  5. Management: Handling organizations, sensors, users, and roles.
  6. Monitoring: Visualizing sensor health, heartbeats, and metrics.
  7. Analytics: Displaying security alerts, trends, and exporting PDF reports.
  8. AI Chat: Integrating with the analytics AI chat when enabled.

Current Route Surface

RouteAccessPurpose
/PublicLogin entry point
/registerPublicOrganization registration
/user-formPublicAdmin user onboarding
/dashboardPrivateHealth overview dashboard
/dashboard/all-sensorPrivateSensor management
/dashboard/sensor/:idPrivateSensor details and virtual sensors
/dashboard/organizationPrivateOrganization profile
/dashboard/profilePrivateUser profile settings
/dashboard/userPrivateUser management
/dashboard/rolePrivateRole and permission management
/dashboard/analyticsPrivateSecurity dashboard and AI chat

Runtime Configuration

Runtime configuration is loaded from src/config/appConfig.ts with the following precedence:

  1. Injected Global: window.__APP_CONFIG__ (production injection).
  2. Local Environment: Vite environment variables (import.meta.env).
  3. Fallbacks: Hardcoded defaults in the API layer.

Core Config Keys:

  • VITE_API_BASE_URL: Backend origin.
  • VITE_ANALYTICS_AI_CHAT_ENABLED: Chat feature flag.