How mainsail-crew/mainsail works
Main Components
a. Frontend Layer:
• Vue.js Application (Main UI)
• WebSocket Client
• Component Structure
• Store (Vuex) Management
• Router System
b. Communication Layer:
• WebSocket Connection
• API Interfaces
• Remote Printer Support
c. Backend Integration:
• Moonraker API Connection
• Klipper Firmware Interface
• File Management System
• Printer Control Systems
Key Architectural Elements
┌─ Client Layer ─────────────────────────────────────┐
• Vue.js Frontend │
• ┌─ Components ─┐ ┌─ Store ──┐ ┌─ Services ──┐ │
• Dashboard │ │ - Printer│ │ - WebSocket │ │
• Console │ │ - Files │ │ - File │ │
• Settings │ │ - Server │ │ - Updates │ │
• ┘ └──────────┘ └────────────┘ │
• ┬───────────────────────────┘
┌───────────────────────▼───────────────────────────┐
• Communication Layer │
• ┌─ WebSocket ─┐ ┌─ REST API ┐ ┌─ File Transfer ┐ │
• Real-time │ │ - Config │ │ - Upload │ │
• Events │ │ - Status │ │ - Download │ │
• ┘ └───────────┘ └───────────────┘ │
• ┬───────────────────────────┘
┌───────────────────────▼───────────────────────────┐
• Backend Integration │
• ┌─ Moonraker ─┐ ┌─ Klipper ──┐ ┌─ Systems ────┐ │
• API │ │ - Control │ │ - File Mgmt │ │
• Events │ │ - Status │ │ - Updates │ │
• ┘ └───────────┘ └─────────────┘ │
• ┘
Important Relationships
• Bidirectional communication between frontend and Moonraker via WebSocket
• File management flow
• Printer control commands flow
• State management system
• Component hierarchy
Additional Elements
• Version control integration
• Webcam integration points
• Timelapse functionality connection
Implementation Details
• Use standard UML notation where appropriate
• Component names from the file structure
• Relationship between stores and components
• Plugin architecture
• Localization system integration
Specific Features to Highlight
• Multi-printer support architecture
• Temperature monitoring system
• File management system
• Webcam integration points
• G-code viewer architecture
• Update management system