# cb-kozel/openmct architecture

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

- Interactive diagram: https://gitdiagram.com/cb-kozel/openmct
- Repository: https://github.com/cb-kozel/openmct

## Overview

##### Main Components
- Core Application: Represent the central “engine” (e.g., the MCT core files in src/MCT.js and its related scripts) that orchestrates the user interface, data processing, and plugin registration.
- API Modules: Group the various API directories (src/api) that handle different functionalities—for example, telemetry, composition, annotations, user, status, forms, menu, overlays, etc. Each of these exposes methods and contracts that plugins and UI components rely on.
- Plugin Architecture: Emphasize the “plugins” folder, which contains many feature extensions (for example, for charts, notebooks, imagery, timeline, etc.). These plugins are discoverable and register with the core application.
- User Interface: Capture the UI layer as seen in src/ui. This includes composable Vue components, inspector panels, layout components, and view controls which render the visualization on desktop and mobile devices.
- Persistence & External Services: From the plugins (such as persistence/couch) and build configuration files (CI configs, npm scripts, etc.), indicate the communication with external databases, web services, or telemetry data sources.

##### Relationships and Interactions
- Plugin Registration: Show how the core MCT module dynamically loads and registers plugins, which then extend the API with additional views, editors, and dashboards.
- Testing and Build Pipelines: Indicate how code quality and functionality are maintained through unit tests, e2e tests, visual tests (via Playwright), and CI/CD workflows (CircleCI, CodeQL, etc.) that feed back into the system.

##### Architectural Patterns & Design Principles
- Modular and Extensible Architecture: Very clearly show that Open MCT is built around a plugin-based model where nearly every functional part (UI components, telemetry, visualization, persistence, etc.) is modular.
- Separation of Concerns: Demonstrate the separation between the Core Engine (business logic and orchestration), the API layer (domain-specific services), and the UI (visual representation and interactivity).
- Event-Driven Communication: Indicate that events from user interactions or telemetry updates flow through central registries (for example, the Observer/Interceptor registries in src/api/objects) and then dispatch to plugins.
- Testability: Emphasize that testing is done at multiple levels (unit, e2e, performance, and visual regression), which implies that components are loosely coupled and well-isolated.

– Core Application Engine (MCT.js and supporting modules)
– API Layers (Telemetry, Objects, Menu, Forms, Overlays, etc.)
– UI Components (layout, context menus, inspectors, dashboards)
– External Services & Persistence Layer (e.g., CouchDB integration)
– Testing & Deployment Pipelines (CI/CD components, testing frameworks, build tools)
– From the UI (user input) to the core engine to the API and plugin calls.
– Data flows from plugins back to persistent storage or external services.
– Core modules versus extensions/plugins.
– UI components versus backend integration.
– Test/CI components could be shaded separately to indicate auxiliary support.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User Interface Layer
    subgraph "User Interface Layer"
        UI["User Interface (Vue Components)"]:::ui
    end

    %% Core Application Layer
    subgraph "Core Application"
        CORE["Core Application Engine (MCT.js)"]:::core
    end

    %% API Layer
    subgraph "API Layer"
        API["API Modules"]:::api
        TELEM["Telemetry API"]:::api
        FORMS["Forms API"]:::api
        OTHER["Other APIs"]:::api
    end

    %% Plugin System
    subgraph "Plugin System"
        PLUGINS["Plugin Extensions"]:::plugin
        CHARTS["Charts Plugin"]:::plugin
        NOTEBOOK["Notebook Plugin"]:::plugin
        PERSIST["Persistence Plugin"]:::plugin
        COUCH["Persistence (CouchDB)"]:::external
    end

    %% Auxiliary Tools
    subgraph "Auxiliary Tools"
        TEST["E2E Tests"]:::test
        CI["CI/CD Workflows"]:::test
    end

    %% Relationships and Data Flow
    UI -->|"triggers"| CORE
    CORE -->|"calls"| API
    CORE -->|"loads"| PLUGINS
    PLUGINS -->|"extends"| API
    API -->|"includes"| TELEM
    API -->|"includes"| FORMS
    API -->|"includes"| OTHER
    PLUGINS --> CHARTS
    PLUGINS --> NOTEBOOK
    PLUGINS --> PERSIST
    PERSIST -->|"stores"| COUCH
    TEST -->|"validates"| CORE
    CI -->|"integrates"| CORE

    %% Click Events
    click CORE "https://github.com/cb-kozel/openmct/blob/master/src/MCT.js"
    click API "https://github.com/cb-kozel/openmct/tree/master/src/api"
    click TELEM "https://github.com/cb-kozel/openmct/tree/master/src/api/telemetry"
    click FORMS "https://github.com/cb-kozel/openmct/tree/master/src/api/forms"
    click PLUGINS "https://github.com/cb-kozel/openmct/tree/master/src/plugins"
    click CHARTS "https://github.com/cb-kozel/openmct/tree/master/src/plugins/charts"
    click NOTEBOOK "https://github.com/cb-kozel/openmct/tree/master/src/plugins/notebook"
    click PERSIST "https://github.com/cb-kozel/openmct/tree/master/src/plugins/persistence"
    click COUCH "https://github.com/cb-kozel/openmct/tree/master/src/plugins/persistence/couch"
    click UI "https://github.com/cb-kozel/openmct/tree/master/src/ui"
    click TEST "https://github.com/cb-kozel/openmct/tree/master/e2e"
    click CI "https://github.com/cb-kozel/openmct/tree/master/.github/workflows"

    %% Styles
    classDef ui fill:#ABEBC6,stroke:#333,stroke-width:2px;
    classDef core fill:#FAD7A0,stroke:#333,stroke-width:2px;
    classDef api fill:#AED6F1,stroke:#333,stroke-width:2px;
    classDef plugin fill:#D2B4DE,stroke:#333,stroke-width:2px;
    classDef external fill:#F5B7B1,stroke:#333,stroke-width:2px;
    classDef test fill:#D5DBDB,stroke:#333,stroke-width:2px;
```
