# bluerobotics/blueos architecture

> Architecture diagram of the GitHub repository bluerobotics/blueos, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bluerobotics/blueos
- Repository: https://github.com/bluerobotics/blueos

## Overview

##### Main Components

A. Frontend Layer:
- Vue.js based web application (/core/frontend)
- Multiple view components for different functionalities
- Store modules for state management
- Component hierarchy for vehicle control, system monitoring, and configuration

B. Core Services Layer:
- Multiple independent services in Python:
- Ardupilot Manager
- Cable Guy (Network Management)
- Commander
- Kraken (Extension Management)
- WiFi Manager
- Video Manager
- NMEA Injector
- Ping Service
- Version Chooser

C. Communication Layer:
- MAVLink communication components
- Bridge services
- Network management services
- WebSocket connections

D. Hardware Integration Layer:
- Vehicle interfaces
- Sensor management
- Camera systems
- Network interfaces

**┌─────────────────────────────────────────────────────────────┐**
- Web Interface (Vue.js)                   │
- ┬─────────────────────────┬─────────────────┤
- Vehicle Control │ System Management        │ Configuration   │
- Setup        │ - Network Settings       │ - Extensions    │
- Monitoring   │ - Updates                │ - Parameters    │
- Calibration  │ - System Information     │ - Services      │
- ┬─────────────────────┬─────────────────────┬────────┘

**┌───────▼─────────┐  ┌───────▼─────────┐  ┌───────▼─────────┐**
- Core Services  │  │ Communication    │  │ Hardware Bridge  │
- Layer         │  │ Layer            │  │ Layer            │
- ┤  ├─────────────────┤  ├─────────────────┤
- Ardupilot Mgr │  │- MAVLink Router │  │- Camera Manager │
- Kraken        │  │- Network Manager│  │- Sensor Systems │
- WiFi Manager  │  │- Bridge Services│  │- GPIO Control   │
- ┬────────┘  └───────┬─────────┘  └───────┬─────────┘

**┌───────▼───────────────────▼─────────────────────▼─────────┐**
- Hardware Layer                         │
- (Raspberry Pi / Compatible Hardware)              │
- ┘

##### Key Elements to Highlight

A. Data Flow:
- WebSocket connections for real-time updates
- MAVLink message routing paths

B. Service Integration:
- Docker container boundaries
- Inter-service communication
- API endpoints and interfaces

C. Extension System:
- Kraken extension manager architecture
- Plugin integration points
- Extension deployment flow

##### Implementation Notes

- Maintain consistent styling throughout
- Component version information
- Document external dependencies
- Scaling capabilities

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles and classes
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef core fill:#2ecc71,stroke:#27ae60,color:white
    classDef comm fill:#e74c3c,stroke:#c0392b,color:white
    classDef hardware fill:#9b59b6,stroke:#8e44ad,color:white
    classDef system fill:#95a5a6,stroke:#7f8c8d,color:white

    %% Frontend Layer
    subgraph Frontend
        WebUI["Web Interface (Vue.js)"]
        VehicleControl["Vehicle Control"]
        SystemMonitor["System Monitoring"]
        Config["Configuration"]
    end
    
    %% Core Services Layer
    subgraph CoreServices
        ArdupilotMgr["Ardupilot Manager"]
        CableGuy["Cable Guy"]
        Commander["Commander"]
        Kraken["Kraken"]
        WiFiMgr["WiFi Manager"]
        VideoMgr["Video Manager"]
        NMEAInj["NMEA Injector"]
        PingService["Ping Service"]
        VersionChooser["Version Chooser"]
    end

    %% Communication Layer
    subgraph Communication
        MAVLink["MAVLink Components"]
        NetworkMgmt["Network Management"]
        BridgeServices["Bridge Services"]
    end

    %% Hardware Integration Layer
    subgraph Hardware
        VehicleInt["Vehicle Interfaces"]
        CameraSys["Camera Systems"]
        SensorMgmt["Sensor Management"]
    end

    %% State Management
    subgraph StateManagement
        Store["Store Modules"]
        APIUtils["API Utilities"]
        TypeDefs["Type Definitions"]
    end

    %% Common Libraries
    subgraph CommonLibs
        Commonwealth["Commonwealth Library"]
        BridgeLib["Bridge Library"]
    end

    %% Relationships
    WebUI --> VehicleControl
    WebUI --> SystemMonitor
    WebUI --> Config
    
    VehicleControl --> Store
    SystemMonitor --> Store
    Config --> Store
    
    Store --> MAVLink
    Store --> APIUtils
    
    MAVLink --> BridgeServices
    NetworkMgmt --> BridgeServices
    
    BridgeServices --> VehicleInt
    BridgeServices --> CameraSys
    BridgeServices --> SensorMgmt

    %% Click events
    click WebUI "https://github.com/bluerobotics/blueos/tree/master/core/frontend/src/"
    click VehicleControl "https://github.com/bluerobotics/blueos/tree/master/core/frontend/src/components/vehiclesetup/"
    click SystemMonitor "https://github.com/bluerobotics/blueos/tree/master/core/frontend/src/components/system-information/"
    click Config "https://github.com/bluerobotics/blueos/tree/master/core/frontend/src/components/app/"
    click ArdupilotMgr "https://github.com/bluerobotics/blueos/tree/master/core/services/ardupilot_manager/"
    click CableGuy "https://github.com/bluerobotics/blueos/tree/master/core/services/cable_guy/"
    click Commander "https://github.com/bluerobotics/blueos/tree/master/core/services/commander/"
    click Kraken "https://github.com/bluerobotics/blueos/tree/master/core/services/kraken/"
    click WiFiMgr "https://github.com/bluerobotics/blueos/tree/master/core/services/wifi/"
    click VideoMgr "https://github.com/bluerobotics/blueos/tree/master/core/frontend/src/components/video-manager/"
    click NMEAInj "https://github.com/bluerobotics/blueos/tree/master/core/services/nmea_injector/"
    click PingService "https://github.com/bluerobotics/blueos/tree/master/core/services/ping/"
    click VersionChooser "https://github.com/bluerobotics/blueos/tree/master/core/services/versionchooser/"
    click MAVLink "https://github.com/bluerobotics/blueos/tree/master/core/frontend/src/libs/MAVLink2Rest/"
    click NetworkMgmt "https://github.com/bluerobotics/blueos/tree/master/core/services/cable_guy/"
    click BridgeServices "https://github.com/bluerobotics/blueos/tree/master/core/libs/bridges/"
    click VehicleInt "https://github.com/bluerobotics/blueos/tree/master/core/frontend/src/components/autopilot/"
    click CameraSys "https://github.com/bluerobotics/blueos/tree/master/core/tools/mavlink_camera_manager/"
    click SensorMgmt "https://github.com/bluerobotics/blueos/tree/master/core/frontend/src/components/vehiclesetup/configuration/"
    click Store "https://github.com/bluerobotics/blueos/tree/master/core/frontend/src/store/"
    click APIUtils "https://github.com/bluerobotics/blueos/tree/master/core/frontend/src/utils/"
    click TypeDefs "https://github.com/bluerobotics/blueos/tree/master/core/frontend/src/types/"
    click Commonwealth "https://github.com/bluerobotics/blueos/tree/master/core/libs/commonwealth/"
    click BridgeLib "https://github.com/bluerobotics/blueos/tree/master/core/libs/bridges/"

    %% Style applications
    class WebUI,VehicleControl,SystemMonitor,Config frontend
    class ArdupilotMgr,CableGuy,Commander,Kraken,WiFiMgr,VideoMgr,NMEAInj,PingService,VersionChooser core
    class MAVLink,NetworkMgmt,BridgeServices comm
    class VehicleInt,CameraSys,SensorMgmt hardware
    class Store,APIUtils,TypeDefs,Commonwealth,BridgeLib system
```
