How dclause/hermes-studio works
Main Components
• Frontend Application:
• Built with Vue. Encompasses UI pages, layouts, components (for animations, hardware, commands, groups, etc.), plugins (e.g., i18n, router, Pinia, Vuetify), and composables.
• Manages user interactions, drag-and-drop functionalities, and visualization (e.g., timeline for animations, configuration panels for boards/devices).
• Backend Application:
• Written in Rust with a clear module separation. Key modules include:
• API Layer:
– REST API under backend/src/api/rest for handling HTTP requests, dealing with endpoints such as animations, boards, devices, configuration, etc.
– WebSocket API under backend/src/api/sockets to manage real-time communications and control signals.
– Payloads and data definitions for ensuring correct data exchange.
• Business Logic Modules:
– Animations, devices, hardware interfaces, and additional utilities.
– Device-specific modules (for LED, servo, mp3, etc.) and hardware controllers (boards, expanders).
• Utility Modules:
– CLI, configuration, logging, database interfacing, and other helper functions.
• Supporting Infrastructure:
• Scripts for building/deployment (both frontend and backend).
• CI/CD configuration with GitHub Actions integrating various workflows for build, test, deploy, and coverage.
• Documentation site (docs folder) for user guidance and advanced configuration details.
• External entity: Arduino boards and potentially other IoT hardware needing compatible firmware (e.g., the StandardFirmataPlus sketch).
Relationships and Data Flows
• The Frontend and Backend communicate over HTTP/REST and WebSocket channels.
• The Frontend sends API requests to the Backend (for configuring devices, running animations, etc.) and receives real-time updates via WebSocket.
• The Backend routes these requests through the appropriate API controllers; for REST routes, it uses structured endpoints while for live events, sockets are used.
• Device-specific modules on the Backend abstract the control logic, interacting with the underlying hardware through serial connections or specific protocols.
• Build and deployment scripts contribute to the continuous integration ecosystem.
Architectural Patterns and Design Principles
• Decoupled architecture with clear separation between frontend and backend responsibilities.
• Modular design within the backend (e.g., organizing code by API payloads, REST and sockets, devices, animations, and hardware) hints at a layered architecture.
• Clean separation of concerns in the frontend via components, stores, composables, and clearly divided routes.
Detailed Explanation for the Principal Software Engineer
• For the Backend, create a block with subdivisions:
• API Layer: split further into “REST Endpoints” (with modules for animations, board config, devices, etc.) and “WebSocket Endpoints” (live control, real-time updates).
• Business Logic / Device Modules: include “Animations”, “Devices”, “Hardware (Board, Expander, Controller)”, and “Utils (CLI, logging, configuration, etc.)”
• Modular separation and clearly annotate any interactions, especially the interplay of WebSockets for real-time commands versus HTTP for regular state management.
Happy diagramming!