Skip to main content

WebUI Overview

The WebUI is a single-page application served by the Flask backend on port 5001. It provides six tabs for operators to monitor and control the vision system in real time. src/webui/web_server.py creates EagleEyeInterface, registers the HTTP routes, and combines route handlers from web_server_utils/. The server provides the compiled page, JSON APIs, MJPEG streams, and a single-client server-sent event stream.

Tabs

Tab markup lives in src/webui/html/tabs/:

TabPartialPurpose
Camera Viewscamera_views_tab_content.htmlLive MJPEG camera feeds
3D View3d_tab_content.htmlThree.js field visualization with robot pose, camera poses, and detected objects
Pipelinepipeline_tab_content.htmlDrag-and-drop DAG editor, operation configuration, model library, MX3 compilation, profiling overlay
System Statussystem_status_tab_content.htmlCPU, memory, storage, pipeline, and NetworkTables status from the system_status event
Settingssettings_tab_content.htmlNetworkTables address, Wi-Fi, system update, terminal, robot/field/test-video assets, restart
Utilsutils_tab_content.htmlCamera calibration capture and intrinsics/extrinsics management

There is no in-browser operation source editor.

Build toolchain

Vite (rolldown), Handlebars partials, Tailwind CSS v4, and ES modules. The Vite project is rooted at the repository root, not at src/webui:

npm install
npm run build

Build output goes to src/webui/static/ (bundle.js, main.css) and is served through the /js/main.js, /style.css, and /assets/<path> routes. The browser uses EventSource for /sse/stream and ordinary HTTP requests for changes. Flask initializes Socket.IO for backend compatibility, but the bundled frontend uses SSE.

Core files

FileRole
src/webui/web_server.pyEagleEyeInterface: Flask app, route registration, SSE engine
src/webui/web_server_utils/*_mixin.pyRoute handler groups composed into EagleEyeInterface
src/webui/web_server_utils/constants.pyHost, port, stream FPS, CORS, default general config
src/webui/web_server_utils/serve_static_files.pyStatic file helpers
src/webui/web_server_utils/drako_loader/Draco decoder assets for compressed 3D models
src/webui/assets/background.webp, favicon.ico, no_image.png, AprilTag images, robot and field models
src/webui/js/Frontend source

Assets under src/webui/assets/ are served below /assets/<path>. Robot models live in robots/; field models live in fields/<year>/field_files/; optional game-piece models live in game_pieces/. A robot model may have a sibling .metadata.json file for display scale. AprilTag reference images use names such as tag36_11_00000.webp. The asset API handles listing, upload, deletion, and scale changes. Draco decoder files are generated at startup and served below /draco/, so they are not part of the source asset inventory.

The server also serves delete.svg, settings.svg, background.webp, favicon.ico, and no_image.png. Keep season-specific field files below their year directory. URLs must preserve filenames containing spaces or punctuation.

Real-time communication

The frontend keeps a persistent EventSource on GET /sse/stream. Named events keep the UI synchronized:

EventRateContent
heartbeatEvery 5 s{"ts": float} keepalive
log_updateOn new log linesFormatted log lines
system_statusEvery 1.5 scpu, memory, storage, pipelines, network_table
pipeline_operation_errorsWhen the error cache changesPer-pipeline operation errors
profiling_updateUp to every 0.3 s per pipelinePer-operation timing snapshot
mx3_compilation_progressDuring compilationJob status and recent log lines
system_update_progressDuring a system updateUpdate progress
update_robot_transform, update_camera_pose, update_detected_objectsOn call from pipeline output operations3D view state