How karlcswanson/spectrum-frontend works
Project Type & Purpose
• This is the frontend portion of a larger multi-component system called “micboard spectrum.” In our specific project ("spectrum-frontend") the main focus is on rendering and interacting with spectrum scan data in real time using Vue3.
• The README explains that this frontend interfaces with data coming from remote scan units (running “spectrum-capture” in a soapySDR container) via an MQTT broker. The overall system supports both distributed and standalone configurations.
File Structure Insights
• The file tree confirms it is a Vue3 SPA:
• Files like App.vue, main.ts, and the router and stores directories indicate use of state management, views routing, and component-based UI.
• Assets such as CSS files in the assets folder help define styling, while components (e.g., SpectrumPlot.vue) and views (e.g., HomeView.vue) represent UI segments.
• Configuration files (package.json, tsconfig.*, vite.config.ts) indicate standard modern JavaScript/TypeScript development practices.
Key Components
• Client UI (spectrum-frontend): Represented by the Vue3 SPA, including its subcomponents:
• Main entry (App.vue, main.ts)
• Router (managing user navigation)
• State management (stores directory)
• Key UI components (e.g., SpectrumPlot.vue)
• Data Ingestion Layer:
• MQTT Broker (using Eclipse Mosquitto as noted in the README)
• WebSocket interface: The frontend connects using secure WebSocket (wss) connections which are proxied to the MQTT broker.
• Remote Scan Units:
• spectrum-capture running in soapySDR-containers that collect and stream RF data via MQTT.
• Web Server (Caddy in production): Hosts the spectrum-frontend and proxies the WebSocket connections.
Architectural Relationships & Data Flow
• In the Distributed System:
• Multiple remote scan units (each with a soapySDR-container running spectrum-capture) capture RF spectrum data.
• These units stream power level data via MQTT to the central MQTT broker.
• The central server hosts a webserver (Caddy) that delivers the spectrum-frontend to users.
• The frontend establishes a WebSocket (wss) connection (proxied to the MQTT broker) to receive and display live data.
• In the Standalone Setup:
• All the above components run on a single machine, eliminating the central server role but keeping the same internals.
Architectural Patterns & Technologies
• Use a layered approach: presentation layer (Vue3 components), connection layer (WebSockets bridging to the MQTT broker), and data acquisition layer (spectrum-capture in containerized scan units).
• The separation of concerns is clear: the frontend is solely responsible for visualization and user interaction, while the backend components handle data gathering and messaging.
• Technologies involved: Vue3, TypeScript, MQTT (Eclipse Mosquitto), Caddy web server, and containerized scanning (soapySDR-container).