Skip to content

Frontend Architecture ​

Architecture Goals ​

The frontend provides experience entry points for platform management, device operations, visualization, Web configuration, and mobile usage. It follows the principles of unified permissions, unified APIs, unified component conventions, and business-domain-based page organization to keep features extensible and delivery maintainable.

Application Structure ​

Project Forms ​

ProjectScenarioMaintenance Focus
Vue2 admin UIMain commercial admin UI and existing functionsRoute permissions, page consistency, component reuse
Vue3 admin UINew feature evolution and modernizationComposition API, type constraints, build optimization
Visualization dashboardsData dashboards, monitoring boards, display pagesData sources, component performance, screen adaptation
Web configurationDevice panels, variable binding, animation, interactionComponent properties, events, dynamic data
H5/mobileLightweight operations, messages, personal centerLow bandwidth, weak network, mobile interaction

Core Modules ​

  • Routes and permissions: dynamically generate accessible pages based on login state, roles, and menu permissions.
  • API wrapper: unify request prefixes, tokens, error handling, pagination parameters, and file upload/download.
  • State management: store user information, permissions, dictionaries, cached views, and partial page state.
  • Component system: reuse tables, forms, dialogs, selectors, device cards, chart components, and other common UI elements.
  • Visualization and configuration: support dynamic data, public APIs, component events, variable binding, and animation configuration.
  • Video pages: integrate media playback, split-screen, fullscreen, playback speed, voice intercom, and recording.

Page Organization Suggestions ​

Page TypeSuggestion
List pageKeep a fixed query area, table, batch actions, and pagination; avoid spreading complex logic across templates
Form pageManage validation rules, defaults, and submit logic together to reduce repeated checks
Detail pageClearly separate basic information, runtime status, history data, alarm records, and operation logs
Visualization pagePrioritize rendering performance, responsive sizing, and data refresh rhythm
Configuration pageKeep operation confirmation, default descriptions, and error prompts to reduce mistakes

UI Optimization Direction ​

  • Navigation groups should follow user tasks, such as device access, platform operations, development, and resources.
  • Forms and tables should use consistent field names to avoid multiple terms for the same concept.
  • High-risk operations should require confirmation and show the affected scope.
  • Dashboards and configuration editors should keep stable control dimensions to avoid layout shifts during dragging, scaling, or dynamic content updates.
  • Mobile pages should reduce long tables and use cards, filter drawers, and segmented information blocks for readability.

Integration Checklist ​

  1. Frontend menu permissions and backend API permissions must be verified together.
  2. Long connections such as WebSocket, MQTT WS, and video streams need proxy paths and timeout settings checked.
  3. Visualization refresh rates should match API performance to avoid unnecessary polling.
  4. After deploying build output to Nginx, verify static asset paths, API prefixes, and route refresh behavior.

FastBee | fastbee.cn