# gridappsd/gridappsd-2030_5 architecture

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

- Interactive diagram: https://gitdiagram.com/gridappsd/gridappsd-2030_5
- Repository: https://github.com/gridappsd/gridappsd-2030_5

## Overview

##### Main System Components

a) Core Server Components:
- IEEE 2030.5 Server (Main Component)
- Basic Proxy Server
- Flask Server
- GUI Interface

b) Functional Modules:
- Certificate Management System
- Device Management
- Program Management
- Control Management
- Curve Management

##### Architecture Layers

**┌─────────────────────────────────────────────┐**
- Client Layer                 │
- (IEEE 2030.5 Clients, Admin GUI, CLI Tools) │
- ┤
- Communication Layer            │
- (TLS, HTTP/HTTPS, Proxy Management)     │
- ┤
- Service Layer                 │
- (Server Endpoints, Function Sets, Admin)   │
- ┤
- Core Layer                   │
- (Models, Adapters, Data Management)      │
- ┤
- Persistence Layer                │
- (Configuration, Device State)          │
- ┘

##### Key Interactions

a) External Interactions:
- Client-Server Communication (HTTPS)
- Admin GUI Interface
- GridAPPS-D Integration
- Certificate Authority Integration

b) Internal Flows:
- Device Registration Flow
- Control Command Flow
- Program Management Flow
- Data Persistence Flow

##### Important Elements

a) Security Components:
- TLS Certificate Management
- Authentication Mechanisms
- LFDI Mode Handling

b) Configuration Management:
- Server Configuration
- Device Configuration
- Program Configuration
- Control Configuration

##### Specific Implementation Details

Following specialized components:
- DER (Distributed Energy Resource) Management
- End Device Management
- Program Control Flow
- Curve Management
- Time Series Data Handling

## Diagram (Mermaid)

```mermaid
graph TB
    %% Define styles
    classDef client fill:#FF9900,stroke:#333,stroke-width:2px
    classDef core fill:#3498DB,stroke:#333,stroke-width:2px
    classDef security fill:#2ECC71,stroke:#333,stroke-width:2px
    classDef config fill:#F1C40F,stroke:#333,stroke-width:2px
    classDef interface fill:#E74C3C,stroke:#333,stroke-width:2px
    classDef storage fill:#9B59B6,stroke:#333,stroke-width:2px

    subgraph ClientLayer["Client Layer"]
        IEEE2030Clients["IEEE 2030.5 Clients"]:::client
        AdminGUI["Admin GUI Interface"]:::client
        CLITools["CLI Tools"]:::client
    end

    subgraph CommunicationLayer["Communication Layer"]
        TLS["TLS Management"]:::security
        ProxyServer["Basic Proxy Server"]:::core
        FlaskServer["Flask Server"]:::core
    end

    subgraph ServiceLayer["Service Layer"]
        ServerCore["IEEE 2030.5 Server Core"]:::core
        CertManager["Certificate Management"]:::security
        DeviceManager["Device Management"]:::core
        ProgramManager["Program Management"]:::core
        ControlManager["Control Management"]:::core
        CurveManager["Curve Management"]:::core
    end

    subgraph CoreLayer["Core Layer"]
        DataModels["Data Models"]:::core
        SecurityUtils["Security Utils"]:::security
        GridAPPSD["GridAPPS-D Integration"]:::interface
        ConfigManager["Configuration Management"]:::config
    end

    subgraph PersistenceLayer["Persistence Layer"]
        DeviceState["Device State"]:::storage
        ConfigStore["Configuration Store"]:::storage
        PersistenceManager["Persistence Manager"]:::storage
    end

    %% Connections
    IEEE2030Clients --> ProxyServer
    AdminGUI --> FlaskServer
    CLITools --> FlaskServer
    
    ProxyServer --> ServerCore
    FlaskServer --> ServerCore
    
    ServerCore --> CertManager
    ServerCore --> DeviceManager
    ServerCore --> ProgramManager
    ServerCore --> ControlManager
    ServerCore --> CurveManager
    
    CertManager --> SecurityUtils
    DeviceManager --> DataModels
    ProgramManager --> DataModels
    ControlManager --> DataModels
    CurveManager --> DataModels
    
    DataModels --> PersistenceManager
    ConfigManager --> ConfigStore
    DeviceManager --> DeviceState
    
    ServerCore --> GridAPPSD
    TLS --> SecurityUtils

    %% Click events for component mapping
    click ServerCore "https://github.com/GRIDAPPSD/gridappsd-2030_5/tree/main/ieee_2030_5/server/"
    click ProxyServer "https://github.com/GRIDAPPSD/gridappsd-2030_5/blob/main/ieee_2030_5/basic_proxy.py"
    click FlaskServer "https://github.com/GRIDAPPSD/gridappsd-2030_5/blob/main/ieee_2030_5/flask_server.py"
    click AdminGUI "https://github.com/GRIDAPPSD/gridappsd-2030_5/tree/main/ieee_2030_5_gui/"
    click CertManager "https://github.com/GRIDAPPSD/gridappsd-2030_5/blob/main/ieee_2030_5/certs.py"
    click DeviceManager "https://github.com/GRIDAPPSD/gridappsd-2030_5/blob/main/ieee_2030_5/server/enddevicesfs.py"
    click ProgramManager "https://github.com/GRIDAPPSD/gridappsd-2030_5/blob/main/ieee_2030_5_gui/pages/programs.py"
    click ControlManager "https://github.com/GRIDAPPSD/gridappsd-2030_5/blob/main/ieee_2030_5/control.py"
    click CurveManager "https://github.com/GRIDAPPSD/gridappsd-2030_5/blob/main/ieee_2030_5_gui/pages/curves.py"
    click DataModels "https://github.com/GRIDAPPSD/gridappsd-2030_5/tree/main/ieee_2030_5/models/"
    click PersistenceManager "https://github.com/GRIDAPPSD/gridappsd-2030_5/tree/main/ieee_2030_5/persistance/"
    click SecurityUtils "https://github.com/GRIDAPPSD/gridappsd-2030_5/blob/main/ieee_2030_5/utils/cryptography_wrapper.py"
    click GridAPPSD "https://github.com/GRIDAPPSD/gridappsd-2030_5/blob/main/ieee_2030_5/adapters/gridappsd_adapter.py"
    click ConfigManager "https://github.com/GRIDAPPSD/gridappsd-2030_5/blob/main/ieee_2030_5/config.py"

    %% Legend
    subgraph Legend
        Client["Client Component"]:::client
        Core["Core Component"]:::core
        Security["Security Component"]:::security
        Config["Configuration Component"]:::config
        Interface["Interface Component"]:::interface
        Storage["Storage Component"]:::storage
    end
```
