# leopardslab/nodecloud architecture

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

- Interactive diagram: https://gitdiagram.com/leopardslab/nodecloud
- Repository: https://github.com/leopardslab/nodecloud

## Overview

##### High-Level Architecture Components

a. Core Components:
- NodeCloud Common Module (@nodecloud/common)
- Plugin System
- Configuration Manager (.nc.config.js)
- Service Abstraction Layer

b. Cloud Provider Plugins:
- AWS Plugin
- Azure Plugin
- Google Cloud Plugin
- DigitalOcean Plugin
- Oracle Plugin
- Linode Plugin

**[Client Application] --> [NodeCloud Common Module]**

**[Configuration Manager] <--> [Plugin Manager]**

- [Service Abstraction Layer]

**[Plugin Manager] --> [Provider Plugins]**
- AWS Plugin
- Azure Plugin
- GCP Plugin
- DigitalOcean Plugin
- Oracle Plugin
- Linode Plugin

**[Service Abstraction Layer] --> [Service Categories]**
- Compute (IaaS, FaaS, Containers)
- Storage (Object, Block)
- Networking (Load Balancer, DNS)
- Databases (RDBMS, NoSQL)
- Security/Authorization
- Management

##### Important Relationships to Highlight

- How the configuration manager (.nc.config.js) connects to the plugin system
- Abstraction layer between plugins and cloud providers
- Demonstrate how service categories are implemented across different providers
- Relationship between the code generator and the plugin system

##### Additional Sections

A separate section showing:
- Code Generation Flow:
**[node-cloud.yml] --> [Generator] --> [Generated Plugin Classes]**

- Plugin Architecture:
**[Plugin Interface] --> [Provider-Specific Implementation]**
- > [Service Abstractions]
- > [API Mappings]

##### Notes for Implementation

- Maintain consistent spacing and alignment
- Related components visually
- Version information
- Brief descriptions for main components

Remember to include the code generation aspect as it's a unique feature of this project, showing how it automates the creation of provider-specific implementations.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Client["Client Application Layer"]
        App[Client Application]
    end

    subgraph Core["Core Components"]
        NCCommon["NodeCloud Common Module"]:::core
        Config["Configuration Manager"]:::core
        PluginMgr["Plugin Manager"]:::core
        BaseProvider["Base Provider Implementation"]:::core
        ProviderReg["Provider Registry"]:::core
    end

    subgraph Plugins["Cloud Provider Plugins"]
        AWS["AWS Plugin"]:::plugin
        Azure["Azure Plugin"]:::plugin
        GCP["Google Cloud Plugin"]:::plugin
        DO["DigitalOcean Plugin"]:::plugin
        Oracle["Oracle Plugin"]:::plugin
        Linode["Linode Plugin"]:::plugin
    end

    subgraph Services["Service Categories"]
        direction TB
        Compute["Compute Services"]:::service
        Storage["Storage Services"]:::service
        Network["Network Services"]:::service
        Database["Database Services"]:::service
        Security["Security Services"]:::service
        Management["Management Services"]:::service
    end

    subgraph Generator["Code Generation"]
        GenConfig["Generator Config"]:::generator
        GenCore["Generator Core"]:::generator
        GenOutput["Generated Plugin Classes"]:::generator
    end

    %% Relationships
    App --> NCCommon
    NCCommon --> PluginMgr
    Config -.-> PluginMgr
    PluginMgr --> BaseProvider
    BaseProvider --> ProviderReg

    ProviderReg --> AWS & Azure & GCP & DO & Oracle & Linode

    AWS & Azure & GCP & DO & Oracle & Linode --> Compute
    AWS & Azure & GCP & DO & Oracle & Linode --> Storage
    AWS & Azure & GCP & DO & Oracle & Linode --> Network
    AWS & Azure & GCP & DO & Oracle & Linode --> Database
    AWS & Azure & GCP & DO & Oracle & Linode --> Security
    AWS & Azure & GCP & DO & Oracle & Linode --> Management

    GenConfig --> GenCore
    GenCore --> GenOutput
    GenOutput -.-> PluginMgr

    %% Click Events
    click NCCommon "https://github.com/leopardslab/nodecloud/tree/master/packages/common/"
    click PluginMgr "https://github.com/leopardslab/nodecloud/tree/master/packages/common/core/"
    click BaseProvider "https://github.com/leopardslab/nodecloud/blob/master/packages/common/core/base-provider.js"
    click ProviderReg "https://github.com/leopardslab/nodecloud/blob/master/packages/common/core/providers.js"
    click AWS "https://github.com/leopardslab/nodecloud/tree/master/packages/aws-plugin/"
    click Azure "https://github.com/leopardslab/nodecloud/tree/master/packages/azure-plugin/"
    click GCP "https://github.com/leopardslab/nodecloud/tree/master/packages/gcp-plugin/"
    click DO "https://github.com/leopardslab/nodecloud/tree/master/packages/do-plugin/"
    click Oracle "https://github.com/leopardslab/nodecloud/tree/master/packages/oracle-plugin/"
    click Linode "https://github.com/leopardslab/nodecloud/tree/master/packages/linode-plugin/"
    click GenCore "https://github.com/leopardslab/nodecloud/tree/master/generator/"
    click GenConfig "https://github.com/leopardslab/nodecloud/blob/master/generator/node-cloud.yml"
    click Compute "https://github.com/leopardslab/nodecloud/tree/master/packages/aws-plugin/compute/"
    click Storage "https://github.com/leopardslab/nodecloud/tree/master/packages/aws-plugin/storage/"
    click Network "https://github.com/leopardslab/nodecloud/tree/master/packages/aws-plugin/network/"
    click Database "https://github.com/leopardslab/nodecloud/tree/master/packages/aws-plugin/database/"
    click Security "https://github.com/leopardslab/nodecloud/tree/master/packages/aws-plugin/security/"
    click Management "https://github.com/leopardslab/nodecloud/tree/master/packages/aws-plugin/managment/"

    %% Styles
    classDef core fill:#2374ab,stroke:#000,color:#fff
    classDef plugin fill:#57a773,stroke:#000,color:#fff
    classDef service fill:#ffc857,stroke:#000,color:#000
    classDef generator fill:#ef6461,stroke:#000,color:#fff

    %% Legend
    subgraph Legend
        CoreComp["Core Component"]:::core
        PluginComp["Plugin"]:::plugin
        ServiceComp["Service"]:::service
        GenComp["Generator Component"]:::generator
    end
```
