# esdlmapeditoressim/docker-toolsuite architecture

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

- Interactive diagram: https://gitdiagram.com/esdlmapeditoressim/docker-toolsuite
- Repository: https://github.com/esdlmapeditoressim/docker-toolsuite

## Overview

##### Main Components
- Frontend/Client Interface: ESDL MapEditor (the map-based UI) and the ESSIM dashboard.
- Simulation Engine: ESSIM for energy system simulation.
- Identity & Access Management: Keycloak to manage user accounts, roles, and authentication.
- Cloud Storage/Versioning: ESDL Drive, which maintains and versions ESDL files.
- Data Persistence:
- PostgresDB (with PostGIS) for relational storage (also used by ESDL Drive)
- InfluxDB for time series data (panel service data source)
- MongoDB for document-based storage.
- Supporting Services:
- Panel Service for visualizing time-series data via Grafana.
- Boundary Service to provide geospatial boundaries.
- Infrastructure and Deployment:
- BaseInfrastructure that provides docker-compose configurations for the databases and services, along with environment templating.
- Experimental directories that show configurations for automated deployments and for Kubernetes (indicating future scalability or alternate deployment scenarios).
- Reverse proxy (e.g., Traefik) and other tools (docker swarm, portainer) for cloud deployments if needed.

- The top-level directories such as “BaseInfrastructure”, “ESDLDrive”, “ESDLMapEditor”, and “ESSIM” directly correlate with discrete services.
- The “Experimental” folder contains various deployment setups (both docker-compose and Kubernetes manifests) that emphasize how the system can be scaled or deployed in different environments.

- UI layer where the ESDL MapEditor interacts with end users and communicates with backend services.
- ESSIM as a simulation engine that may receive scenario data from MapEditor and stores or retrieves simulation results in the database layer.
- Panel Service (and its integration with Grafana) to the underlying InfluxDB for visualization, and also indicate its connection from the MapEditor for dashboarding.
- Boundary Service as a separate microservice that provides geodata to the MapEditor.

##### Architectural Patterns and Design Principles
- Microservices: Many components operate as individual services (ESDL MapEditor, ESSIM, Keycloak, ESDL Drive, etc.) communicating typically over HTTP or through API gateways.
- Security and Access Control: Clearly show the IAM (Keycloak) service and its role in securing access for MapEditor, ESSIM, and even underlying APIs.
- Data Flow: Highlight that data flows from the user interface into the simulation engine and then to visual analytics (Grafana/Panel Service) while authentication and file accessing tie them together.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend / Client Interface
    subgraph "User Interface"
        A1["ESDL MapEditor"]:::frontend
        A2["ESSIM Dashboard"]:::frontend
    end

    %% Backend Services
    subgraph "Backend Services"
        B1["ESSIM Simulation Engine"]:::backend
        B2["Keycloak (IAM)"]:::backend
        B3["ESDL Drive"]:::backend
    end

    %% Supporting Services
    subgraph "Supporting Services"
        C1["Panel Service"]:::support
        C2["Boundary Service"]:::support
    end

    %% Data Persistence
    subgraph "Data Persistence"
        D1["PostgresDB (PostGIS)"]:::database
        D2["InfluxDB"]:::database
        D3["MongoDB"]:::database
    end

    %% Infrastructure & Deployment
    subgraph "Infrastructure & Deployment"
        E1["Base Infrastructure"]:::infrastructure
        E2["Experimental Deployments"]:::infrastructure
        E3["Reverse Proxy (Traefik)"]:::infrastructure
    end

    %% Interactions from User Interface to Backend and Supporting Services
    A1 -->|"auth"| B2
    A1 -->|"file_storage"| B3
    A1 -->|"dashboard"| C1
    A1 -->|"geodata"| C2
    A2 -->|"control_simulation"| B1

    %% Interactions from Backend Services to Data Persistence
    B1 -->|"persist_data"| D1
    B1 -->|"time_series"| D2
    C1 -->|"visualize_data"| D2

    %% Infrastructure connections to backend and databases
    E1 --> B1
    E1 --> B2
    E1 --> B3
    E1 --> D1
    E1 --> D2
    E1 --> D3

    %% Relationship within Infrastructure
    E2 -->|"orchestrates"| E3

    %% Styling
    classDef frontend fill:#B6E2FF,stroke:#333,stroke-width:2px;
    classDef backend fill:#F9D5E5,stroke:#333,stroke-width:2px;
    classDef support fill:#C1E1C1,stroke:#333,stroke-width:2px;
    classDef database fill:#FFE4B5,stroke:#333,stroke-width:2px;
    classDef infrastructure fill:#D3D3D3,stroke:#333,stroke-width:2px;

    %% Click Events
    click A1 "https://github.com/esdlmapeditoressim/docker-toolsuite/tree/main/ESDLMapEditor/esdl_mapeditor"
    click B1 "https://github.com/esdlmapeditoressim/docker-toolsuite/blob/main/ESSIM/docker-compose.yml"
    click B2 "https://github.com/esdlmapeditoressim/docker-toolsuite/tree/main/BaseInfrastructure/keycloak/"
    click B3 "https://github.com/esdlmapeditoressim/docker-toolsuite/tree/main/ESDLDrive/"
    click D1 "https://github.com/esdlmapeditoressim/docker-toolsuite/tree/main/BaseInfrastructure/postgres/"
    click D2 "https://github.com/esdlmapeditoressim/docker-toolsuite/tree/main/Experimental/kubernetes-deployment/influxdb/"
    click D3 "https://github.com/esdlmapeditoressim/docker-toolsuite/tree/main/Experimental/kubernetes-deployment/mongo/"
    click C1 "https://github.com/esdlmapeditoressim/docker-toolsuite/blob/main/ESDLMapEditor/panel_service.env"
    click C2 "https://github.com/esdlmapeditoressim/docker-toolsuite/blob/main/ESDLMapEditor/boundary_service.env"
    click E1 "https://github.com/esdlmapeditoressim/docker-toolsuite/tree/main/BaseInfrastructure/"
    click E2 "https://github.com/esdlmapeditoressim/docker-toolsuite/tree/main/Experimental/"
    click E3 "https://github.com/esdlmapeditoressim/docker-toolsuite/blob/main/Experimental/kubernetes-deployment/traefik/traefik-values.yaml"
```
