# jenova-framework/jenova-runtime architecture

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

- Interactive diagram: https://gitdiagram.com/jenova-framework/jenova-runtime
- Repository: https://github.com/jenova-framework/jenova-runtime

## Overview

##### Main Components

a) Core Components:
- Scripting System
- Script Compiler
- Script Interpreter
- Script Manager
- Script Instance Handler
- Script Templates
- Asset Management System
- Asset Monitor
- Package Manager
- Task System
- Profiler System
- GDExtension Integration Layer

b) Dependencies Layer:
- Code Generation (AsmJIT)
- Compression (LibFastZLib)
- Archive Handling (LibArchive)
- Network Operations (LibCurl)
- Compilation Backend (LibTinyCC)
- Threading (LibPThread)
- Memory Management (MemoryModule++)
- Hook System (MinHook)
- Development Tools Integration (LibVSWhere)

**┌─────────────────────────────────────────────┐**
- Godot Engine Layer             │
- ┘
- ↕
**┌─────────────────────────────────────────────┐**
- GDExtension Integration Layer       │
- ┘
- ↕
**┌─────────────────────────────────────────────┐**
- Jenova Runtime Core              │
- ┬─────────────┬────────────────┤
- Scripting  │    Asset    │  Task System   │
- System    │ Management  │    & Profiler  │
- ┴─────────────┴────────────────┘
- ↕
**┌─────────────────────────────────────────────┐**
- Dependencies & Libraries            │
- ┘

##### Detailed Component Relationships

The Script System should be shown with internal connections:
**Script Manager ─→ Script Compiler**
- ↓
**Script Interpreter ←→ Script Instance**
- ↓
**Script Templates ─→ Script Resource**

##### Implementation Details

Use standardized UML notation where appropriate:
- Components as rectangles
- Interfaces as lollipops
- Subsystems as nested rectangles

##### Additional Elements

- Component types
- Connection types
- Build target specifications
- Optional/Proprietary features
- Integration points

This architecture should clearly show how Jenova Runtime serves as a bridge between C++ code and the Godot engine while highlighting its extensive feature set and modularity.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Main Layers
    subgraph GodotLayer["Godot Engine Layer"]
        GodotEngine["Godot 4.x Engine"]
    end

    subgraph IntegrationLayer["GDExtension Integration Layer"]
        GDExtension["GDExtension Interface"]:::integration
        GDExporter["GDExtension Exporter"]:::integration
        GDRuntime["Runtime Extension"]:::integration
    end

    subgraph CoreLayer["Jenova Runtime Core"]
        subgraph ScriptingSystem["Scripting System"]
            ScriptManager["Script Manager"]:::core
            ScriptCompiler["Script Compiler"]:::core
            ScriptInterpreter["Script Interpreter"]:::core
            ScriptInstance["Script Instance Handler"]:::core
            ScriptTemplates["Script Templates"]:::core
            ScriptLanguage["Script Language"]:::core
            ScriptResource["Script Resource"]:::core
        end

        subgraph AssetSystem["Asset Management"]
            AssetMonitor["Asset Monitor"]:::core
            PackageManager["Package Manager"]:::core
        end

        subgraph SystemTools["System Tools"]
            TaskSystem["Task System"]:::core
            Profiler["Profiler System"]:::core
        end

        CoreRuntime["Core Runtime"]:::core
    end

    subgraph DependencyLayer["Dependencies & Libraries"]
        AsmJIT["AsmJIT"]:::dependency
        FastZLib["LibFastZLib"]:::dependency
        LibArchive["LibArchive"]:::dependency
        LibCurl["LibCurl"]:::dependency
        TinyCC["LibTinyCC"]:::dependency
        PThread["LibPThread"]:::dependency
        MemoryModule["MemoryModule++"]:::dependency
        MinHook["MinHook"]:::dependency
        VSWhere["LibVSWhere"]:::dependency
        MojoELF["MojoELF"]:::dependency
    end

    %% Relationships
    GodotEngine <--> GDExtension
    GDExtension <--> GDExporter
    GDExtension <--> GDRuntime
    GDRuntime <--> CoreRuntime

    CoreRuntime --> ScriptingSystem
    CoreRuntime --> AssetSystem
    CoreRuntime --> SystemTools

    ScriptManager --> ScriptCompiler
    ScriptManager --> ScriptInterpreter
    ScriptInterpreter --> ScriptInstance
    ScriptInstance --> ScriptTemplates
    ScriptTemplates --> ScriptResource
    ScriptLanguage --> ScriptManager
    
    AssetMonitor --> PackageManager
    
    %% Dependencies
    ScriptCompiler --> TinyCC
    ScriptCompiler --> AsmJIT
    PackageManager --> FastZLib
    PackageManager --> LibArchive
    AssetMonitor --> LibCurl
    TaskSystem --> PThread
    CoreRuntime --> MemoryModule
    CoreRuntime --> MinHook
    CoreRuntime --> MojoELF

    %% Styles
    classDef core fill:#3498db,stroke:#2980b9,color:white
    classDef integration fill:#2ecc71,stroke:#27ae60,color:white
    classDef dependency fill:#e67e22,stroke:#d35400,color:white
    classDef system fill:#9b59b6,stroke:#8e44ad,color:white

    %% Click Events
    click ScriptCompiler "https://github.com/Jenova-Framework/Jenova-Runtime/blob/master/script_compiler.cpp"
    click ScriptInterpreter "https://github.com/Jenova-Framework/Jenova-Runtime/blob/master/script_interpreter.cpp"
    click ScriptManager "https://github.com/Jenova-Framework/Jenova-Runtime/blob/master/script_manager.cpp"
    click ScriptInstance "https://github.com/Jenova-Framework/Jenova-Runtime/blob/master/script_instance.cpp"
    click ScriptTemplates "https://github.com/Jenova-Framework/Jenova-Runtime/blob/master/script_templates.cpp"
    click ScriptLanguage "https://github.com/Jenova-Framework/Jenova-Runtime/blob/master/script_language.cpp"
    click ScriptResource "https://github.com/Jenova-Framework/Jenova-Runtime/blob/master/script_resource.cpp"
    click AssetMonitor "https://github.com/Jenova-Framework/Jenova-Runtime/blob/master/asset_monitor.cpp"
    click PackageManager "https://github.com/Jenova-Framework/Jenova-Runtime/blob/master/package_manager.cpp"
    click TaskSystem "https://github.com/Jenova-Framework/Jenova-Runtime/blob/master/task_system.cpp"
    click Profiler "https://github.com/Jenova-Framework/Jenova-Runtime/blob/master/tiny_profiler.cpp"
    click GDExporter "https://github.com/Jenova-Framework/Jenova-Runtime/blob/master/gdextension_exporter.cpp"
    click GDRuntime "https://github.com/Jenova-Framework/Jenova-Runtime/blob/master/Jenova.Runtime.gdextension"
    click MemoryModule "https://github.com/Jenova-Framework/Jenova-Runtime/blob/master/Dependencies/MemoryModule/MemoryModule.cpp"
    click MojoELF "https://github.com/Jenova-Framework/Jenova-Runtime/blob/master/Dependencies/MojoELF/mojoelf.c"
    click CoreRuntime "https://github.com/Jenova-Framework/Jenova-Runtime/blob/master/jenova.cpp"
```
