# module-federation/federation-dashboard architecture

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

- Interactive diagram: https://gitdiagram.com/module-federation/federation-dashboard
- Repository: https://github.com/module-federation/federation-dashboard

## Overview

##### Main Components

a) Dashboard Frontend (Consumer Interface)
- As a web interface component
- Connection to the dashboard server
- Port 3000 specification

b) Dashboard Plugin (Core Component)
- As a central processing unit with these sub-components:
- FederationDashboardPlugin (main plugin)
- Graph Conversion System (convertToGraph.js)
- Graph Merging System (mergeGraphs.js)
- Medusa Delegate (medusa-delegate.js)

c) Data Collection System
- Dashboard data creator component
- JSON data storage
- Webhook endpoint (/update)

d) Federation Module Applications (External)
- Host applications
- Remote applications
- Module dependencies

##### Component Details

For the Plugin:
**┌─ Dashboard Plugin ─────────────┐**
- Configuration Handler        │
- Graph Converter             │
- Metadata Processor          │
- Update Mechanism            │
- ┘

For the Dashboard:
**┌─ Dashboard Frontend ──────────┐**
- Visualization Engine       │
- Module Relationship View   │
- Configuration Interface    │
- ┘

##### Integration Points

Clear integration points for:
- Webpack configuration
- Module Federation setup
- Dashboard plugin installation
- Data update endpoints

##### Key Technical Elements

Technical aspects:
- JSON data structure flow
- Graph data transformation
- HTTP communication paths
- Plugin integration points

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Dashboard Frontend"
        UI["Web Interface<br/>(Port 3000)"]:::frontend
        VE["Visualization Engine"]:::frontend
        CI["Configuration Interface"]:::frontend
        MRV["Module Relationship View"]:::frontend
    end

    subgraph "Dashboard Plugin Core"
        FDP["FederationDashboardPlugin"]:::plugin
        GCS["Graph Conversion System"]:::plugin
        GMS["Graph Merging System"]:::plugin
        MD["Medusa Delegate"]:::plugin
        PH["Plugin Helpers"]:::plugin
        PCT["Plugin CLI Tool"]:::plugin
    end

    subgraph "Data Processing Layer"
        DCS["Data Collection System"]:::data
        DCB["Data Creator Builder"]:::data
        SDD["Data Schema Definition"]:::data
        RGD["Raw Graph Data Storage"]:::data
        WH["/update Webhook<br/>(Port 3333)"]:::endpoint
    end

    subgraph "External Federation"
        HA["Host Applications"]:::external
        RA["Remote Applications"]:::external
        MD1["Module Dependencies"]:::external
    end

    %% Relationships
    HA --> FDP
    RA --> FDP
    MD1 --> FDP
    FDP --> GCS
    GCS --> GMS
    GMS --> MD
    MD --> DCS
    DCS --> DCB
    DCB --> RGD
    RGD --> WH
    WH --> UI
    UI --> VE
    VE --> MRV
    CI --> UI
    PH --> FDP
    PCT --> FDP

    %% Click Events
    click FDP "https://github.com/module-federation/federation-dashboard/blob/master/dashboard-plugin/FederationDashboardPlugin.js"
    click GCS "https://github.com/module-federation/federation-dashboard/blob/master/dashboard-plugin/convertToGraph.js"
    click GMS "https://github.com/module-federation/federation-dashboard/blob/master/dashboard-plugin/mergeGraphs.js"
    click MD "https://github.com/module-federation/federation-dashboard/blob/master/dashboard-plugin/medusa-delegate.js"
    click DCS "https://github.com/module-federation/federation-dashboard/tree/master/dashboard-data-creator/"
    click SDD "https://github.com/module-federation/federation-dashboard/blob/master/DATA_SCHEMA.md"
    click RGD "https://github.com/module-federation/federation-dashboard/blob/master/RAW_GRAPH_DATA.json"
    click PH "https://github.com/module-federation/federation-dashboard/tree/master/dashboard-plugin/helpers/"
    click PCT "https://github.com/module-federation/federation-dashboard/blob/master/dashboard-plugin/bin/federation-report.js"
    click DCB "https://github.com/module-federation/federation-dashboard/blob/master/dashboard-data-creator/builder.ts"

    %% Styling
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef plugin fill:#2ecc71,stroke:#27ae60,color:white
    classDef data fill:#f1c40f,stroke:#f39c12,color:black
    classDef external fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef endpoint fill:#e74c3c,stroke:#c0392b,color:white

    %% Legend
    subgraph Legend
        L1["Frontend Components"]:::frontend
        L2["Plugin Components"]:::plugin
        L3["Data Processing"]:::data
        L4["External Systems"]:::external
        L5["Endpoints"]:::endpoint
    end
```
