# abstratt/cloudfier architecture

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

- Interactive diagram: https://gitdiagram.com/abstratt/cloudfier
- Repository: https://github.com/abstratt/cloudfier

## Overview

##### Main Components Overview

a. Core Components:
- Kirra MDD (Model-Driven Development)
- Code Generation Subsystem
- Runtime (Model Interpreter)
- Server Components
- TextUML Integration (external dependency)

##### Detailed Component Breakdown

Frontend Layer:
- Web-based IDE (Orion integration)
- REST Endpoints
- UI Generation Components
- Authentication/Authorization (com.abstratt.kirra.auth)

Middle Layer:
- Model Management:
- TextUML Compiler
- Model Repository
- Model Validation
- Model Transformation

Code Generation Layer:
- Code Generators:
- JEE Target (Expert4JEE)
- JSE Target
- Documentation Generator
- API Generator

Runtime Layer:
- Model Interpreter
- Node Store:
- In-memory Store
- JDBC Store
- Blob Store
- Runtime Core Services

##### Connection and Data Flow

- User requests flow through REST endpoints
- Model compilation and validation flow
- Code generation pipeline
- Runtime execution path
- Data persistence flow

##### Integration Points

External integrations:
- Database (PostgreSQL)
- Orion IDE
- Maven Plugin Interface
- External Services

##### Deployment Context

A separate section showing:
- Server deployment
- Client access
- Database connection
- Development environment integration

##### Additional Details

Annotations for:
- Key configuration points
- Extension points
- Plugin architecture
- Security boundaries

- The modular architecture (visible in the file structure)
- The separation between model definition, code generation, and runtime execution
- The plugin-based extension system
- The REST-based service architecture
- The multi-target code generation capability

This system design should help developers understand both the high-level architecture and the detailed interactions between components while highlighting the extensible nature of the platform.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Frontend
        WEB["Web Frontend"]:::frontend
        ORION["Orion IDE Integration"]:::frontend
        REST["REST Endpoints"]:::api
        UI["UI Generation"]:::frontend
        AUTH["Authentication/Authorization"]:::security
    end

    subgraph "Model Management"
        COMP["TextUML Compiler"]:::core
        REPO["Model Repository"]:::core
        VAL["Model Validation"]:::core
        TRANS["Model Transformation"]:::core
    end

    subgraph "Code Generation"
        GEN_CORE["Core Generation Framework"]:::generator
        JEE["JEE Generator"]:::generator
        JSE["JSE Generator"]:::generator
        DOC["Documentation Generator"]:::generator
        API["API Generator"]:::generator
    end

    subgraph Runtime
        INT["Model Interpreter"]:::runtime
        RCORE["Runtime Core"]:::runtime
        subgraph "Storage Layer"
            NS["Node Store"]:::storage
            IMS["In-memory Store"]:::storage
            JDBC["JDBC Store"]:::storage
            BS["Blob Store"]:::storage
        end
    end

    subgraph "External Systems"
        DB[(PostgreSQL)]:::external
        TEXTUML["TextUML"]:::external
        MAVEN["Maven Plugin"]:::external
    end

    %% Connections
    WEB --> REST
    ORION --> REST
    REST --> AUTH
    AUTH --> COMP
    COMP --> REPO
    REPO --> VAL
    VAL --> TRANS

    TRANS --> GEN_CORE
    GEN_CORE --> JEE
    GEN_CORE --> JSE
    GEN_CORE --> DOC
    GEN_CORE --> API

    TRANS --> INT
    INT --> RCORE
    RCORE --> NS
    NS --> IMS
    NS --> JDBC
    NS --> BS
    JDBC --> DB

    %% External connections
    COMP --> TEXTUML
    GEN_CORE --> MAVEN

    %% Styling
    classDef frontend fill:#A5D6A7
    classDef api fill:#90CAF9
    classDef core fill:#1976D2
    classDef generator fill:#FFA726
    classDef runtime fill:#7E57C2
    classDef storage fill:#78909C
    classDef security fill:#EF5350
    classDef external fill:#BDBDBD

    %% Click events
    click WEB "https://github.com/abstratt/cloudfier/blob/master/server/com.abstratt.mdd.frontend.web"
    click ORION "https://github.com/abstratt/cloudfier/blob/master/server/com.abstratt.mdd.frontend.orion"
    click AUTH "https://github.com/abstratt/cloudfier/blob/master/server/com.abstratt.kirra.auth"
    click REST "https://github.com/abstratt/cloudfier/blob/master/server/com.abstratt.kirra.server"
    click GEN_CORE "https://github.com/abstratt/cloudfier/blob/master/codegen/com.abstratt.mdd.target.core"
    click JEE "https://github.com/abstratt/cloudfier/blob/master/codegen/com.abstratt.mdd.target.jee"
    click JSE "https://github.com/abstratt/cloudfier/blob/master/codegen/com.abstratt.mdd.target.jse"
    click DOC "https://github.com/abstratt/cloudfier/blob/master/codegen/com.abstratt.mdd.target.doc"
    click INT "https://github.com/abstratt/cloudfier/blob/master/runtime/com.abstratt.mdd.runtime.core"
    click NS "https://github.com/abstratt/cloudfier/blob/master/runtime/com.abstratt.nodestore"
    click IMS "https://github.com/abstratt/cloudfier/blob/master/runtime/com.abstratt.nodestore.inmemory"
    click JDBC "https://github.com/abstratt/cloudfier/blob/master/runtime/com.abstratt.nodestore.jdbc"
    click BS "https://github.com/abstratt/cloudfier/blob/master/runtime/com.abstratt.blobstore"
```
