Skip to content

Frontend ​

The frontend uses Vue 3, Vite, TypeScript, Pinia, Vue Router, and Element Plus.

Before frontend work, read the frontend boundary in Project Structure. If a page needs cross-resource derived state, prefer adding a backend projection in Backend.

Main Directories ​

DirectoryPurpose
front/src/viewsPage views.
front/src/componentsReusable components.
front/src/apiAPI client wrappers.
front/src/storesPinia stores.
front/src/routerRoute definitions.
front/src/i18nChinese and English messages.
front/src/typesFrontend API types.
front/src/composablesShared Composition API logic.

Core Rule ​

The frontend displays, accepts input, handles interactions, and calls APIs. It should not reimplement:

  • Node online calculation.
  • Sync status calculation.
  • Mesh topology validation.
  • Artifact cache state.
  • Snapshot parsing.
  • EMQX status derivation.
  • MCP permission decisions.

Ask the backend for fields or projections when a page needs derived state.

Stable fields and errors are documented in API Reference, Data Model, and Errors.

Pages ​

Major page groups:

  • Home: system overview and config entrypoints.
  • Config overview: configs, nodes, tags, and basic state.
  • Node workspace: mesh, sync, control, and advanced settings.
  • Tools: downloads, quick mesh, port forwarding, AI integration.
  • Settings: system settings, MQTT, backups, and password.
  • Help entry: the sidebar opens the public documentation site in a new tab; there is no local Help page.

Tool pages should focus on user actions and avoid exposing backend cache paths or temporary internals.

Tool-page behavior links to Downloads, Quick Mesh, MCP Reference, and Snapshots.

Realtime ​

The frontend receives SSE events. Treat them as refresh signals or small patches, not as the business source of truth.

Common strategies are to refresh a list after a list-level event, refresh the current projection after a page-level event, and append or update logs after a control-log event.

The full event list, scopes, and subscription strategy are in Realtime Reference.

i18n ​

All visible text belongs in front/src/i18n/messages. Add Chinese and English messages together.

Use stable backend error codes for localized errors.

UX Direction ​

This is an operations console. Prefer dense, scannable, task-oriented UI:

  • Important actions stay close to context.
  • Bulk and dangerous operations need clear prompts.
  • Long operations block duplicate submissions.
  • Mobile layouts must not overlap text or controls.