# funk-team/funklang architecture

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

- Interactive diagram: https://gitdiagram.com/funk-team/funklang
- Repository: https://github.com/funk-team/funklang

## Overview

##### Main System Components

a) Core Editor Components:
- Canvas System (src/Canvas/*)
- API Explorer (src/ApiExplorer/*)
- Code Editor (src/CodeEditor/*)
- Design System (src/DesignSystem/*)
- Model Editor (src/ModelEditor/*)

b) Runtime & Rendering:
- Runtime Engine (src/Runtime/*)
- Renderer System (src/Renderer/*)
- Custom Elements (src/customElements/*)

c) Infrastructure:
- File System (src/FileSystem/*)
- CLI Integration (cli-src/*)
- Persistence Layer (src/Persistence/*)

##### Component Relationships

**┌─────────────────────── User Interface Layer ──────────────────────┐**

- ┌─────────┐  ┌──────────┐  ┌────────────┐  ┌────────────────┐  │
- Canvas  │  │   API    │  │   Code     │  │ Design System  │  │
- Editor  │  │ Explorer │  │  Editor    │  │    Editor      │  │
- ┬────┘  └────┬─────┘  └─────┬──────┘  └───────┬────────┘  │

- ┼───────────┼──────────────┼───────────────────┼───────────┘

**┌───────┼───────────┼──────────────┼───────────────────┼───────────┐**
- Runtime & Rendering Layer                                     │
- ┌────────────────┐  ┌──────────────────┐  ┌─────────────────┐  │
- Runtime Engine │  │ Renderer System  │  │ Custom Elements │  │
- ┬────────┘  └────────┬─────────┘  └────────┬────────┘  │

- ┼────────────────────┼──────────────────────┼───────────┘

**┌──────────┼────────────────────┼──────────────────────┼───────────┐**
- Infrastructure Layer                                          │
- ┌────────────────┐  ┌──────────────────┐  ┌─────────────────┐  │
- File System   │  │  CLI Integration │  │   Persistence   │  │
- ┘  └──────────────────┘  └─────────────────┘  │

- ┘

##### Additional Elements
- Version information
- Main entry points
- Experimental features (like CLI) with appropriate symbols

##### Implementation Details
- Maintain consistent spacing and alignment
- Brief annotations for complex interactions
- Creating separate detailed views for complex subsystems

## Diagram (Mermaid)

```mermaid
graph TB
    %% Style definitions
    classDef ui fill:#3498db,stroke:#2980b9,color:white
    classDef runtime fill:#2ecc71,stroke:#27ae60,color:white
    classDef infra fill:#e67e22,stroke:#d35400,color:white
    
    subgraph UI["User Interface Layer"]
        Canvas["Canvas Editor"]:::ui
        API["API Explorer"]:::ui
        Code["Code Editor"]:::ui
        Design["Design System Editor"]:::ui
        Model["Model Editor"]:::ui
    end

    subgraph RT["Runtime & Rendering Layer"]
        Runtime["Runtime Engine"]:::runtime
        Renderer["Renderer System"]:::runtime
        Custom["Custom Elements"]:::runtime
    end

    subgraph INF["Infrastructure Layer"]
        FileSystem["File System"]:::infra
        CLI["CLI Integration"]:::infra
        Persistence["Persistence Layer"]:::infra
    end

    %% Connections between components
    Canvas --> Runtime
    API --> Runtime
    Code --> Runtime
    Design --> Runtime
    Model --> Runtime

    Runtime --> Renderer
    Runtime --> Custom
    Renderer --> Custom

    Runtime --> FileSystem
    Runtime --> Persistence
    CLI --> FileSystem
    CLI --> Persistence

    %% Click events for component mapping
    click Canvas "https://github.com/funk-team/funkLang/tree/master/src/Canvas/"
    click API "https://github.com/funk-team/funkLang/tree/master/src/ApiExplorer/"
    click Code "https://github.com/funk-team/funkLang/tree/master/src/CodeEditor/"
    click Design "https://github.com/funk-team/funkLang/tree/master/src/DesignSystem/"
    click Model "https://github.com/funk-team/funkLang/tree/master/src/ModelEditor/"
    click Runtime "https://github.com/funk-team/funkLang/tree/master/src/Runtime/"
    click Renderer "https://github.com/funk-team/funkLang/tree/master/src/Renderer/"
    click Custom "https://github.com/funk-team/funkLang/tree/master/src/customElements/"
    click FileSystem "https://github.com/funk-team/funkLang/tree/master/src/FileSystem/"
    click CLI "https://github.com/funk-team/funkLang/tree/master/cli-src/"
    click Persistence "https://github.com/funk-team/funkLang/tree/master/src/Persistence/"

    %% Legend
    subgraph Legend
        UI_L["UI Component"]:::ui
        RT_L["Runtime Component"]:::runtime
        INF_L["Infrastructure Component"]:::infra
    end
```
