# openharmony/arkui_ace_engine_lite architecture

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

- Interactive diagram: https://gitdiagram.com/openharmony/arkui_ace_engine_lite
- Repository: https://github.com/openharmony/arkui_ace_engine_lite

## Overview

This project is a JS UI framework designed for developing OpenHarmony applications on mini systems. Its purpose is to provide a complete solution for JavaScript-based UI development by combining a JavaScript data binding engine, a JavaScript runtime (providing code parsing and execution), and a JavaScript framework layer (built in C++ that exposes APIs and UI components). The README and the file tree together show a multi-layered architecture with many interdependent subsystems.

##### Primary System Components
- JavaScript Data Binding Framework – responsible for propagating data changes to the UI.
- JavaScript Runtime – includes the engine that parses and executes JS code (found in the “native_engine” and “packages” directories).
- JavaScript Framework – implemented in C++ to expose APIs and UI components; look into directories such as “src”, “common”, “module_manager”, “include”, etc.
- External Interfaces – the “interfaces” directory shows the APIs that are exposed externally (including innerkits and builtins that support third-party integrations).
- Example Applications and Test Suites – represented by “frameworks/examples” and the “test” directory that provide usage and validation of the framework.
- Tooling and Target Configurations – the “tools” directory (also “targets”) includes PC simulators and configuration files that help test, simulate, and compile the framework for different devices.

##### Relationships and Data Flow Between Components
- How JavaScript application code (running on top of the framework) interacts with the data binding layer.
- The data binding framework then communicates with the runtime to execute JS and with the native engine adapter (in “native_engine”) to provide low-level support.
- The JavaScript framework layer (using components from “src”, “common”, “module_manager”) wraps these functionalities and exposes higher-level APIs to the application.
- External components call APIs from the “interfaces” layer, which in-turn invoke functionality from the framework.
- The target configurations (in “targets”) drive the behavior of the framework on different hardware or simulator environments.

##### Architectural Patterns and Technologies
- Modular design: The separation into subdirectories (e.g., “common”, “module_manager”, “packages”) shows a clear modular decomposition.
- Layered architecture: Display the three main layers (data binding, runtime, framework) and how each one calls or feeds data into the next.
- Integration of C++ components with JavaScript logic: Note the interplay via the native JS engine adapter and the JS API wrappers.
- Extensibility: The “interfaces” and “tools” directories emphasize that the framework is designed for both application developers and framework-level debugging and simulation.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Application Layer"
        app("JS Application Code"):::app
    end

    subgraph "JS Framework Core"
        binding("JS Data Binding"):::dataBinding
        runtime("JS Runtime Engine"):::runtime
        framework("JS Framework API"):::framework
    end

    subgraph "Native and Platform Layer"
        target("Target Configurations"):::target
    end

    subgraph "External Interfaces"
        external("External Interfaces"):::external
    end

    subgraph "Tooling & Testing"
        examples("Example Applications"):::tooling
        tests("Testing Suite"):::tooling
        tools("Tooling"):::tooling
    end

    %% Breakdown of JS Runtime Engine internal structure
    runtime -->|"contains"| native("Native Engine"):::runtime
    native -->|"includes"| jsi("JSI"):::runtime

    %% Inter-layer Connections
    app -->|"uses"| binding
    binding -->|"triggers"| runtime
    runtime -->|"calls"| framework
    external -->|"invokes"| framework
    framework -->|"executes"| target
    examples -->|"demonstrates"| app
    tests -->|"validates"| framework
    tools -->|"supports"| tests

    %% Click Events
    click binding "https://github.com/openharmony/arkui_ace_engine_lite/tree/master/frameworks/packages/runtime-core/src/observer"
    click runtime "https://github.com/openharmony/arkui_ace_engine_lite/tree/master/frameworks/native_engine"
    click jsi "https://github.com/openharmony/arkui_ace_engine_lite/tree/master/frameworks/native_engine/jsi"
    click framework "https://github.com/openharmony/arkui_ace_engine_lite/tree/master/frameworks/src/core/components"
    click external "https://github.com/openharmony/arkui_ace_engine_lite/tree/master/interfaces"
    click examples "https://github.com/openharmony/arkui_ace_engine_lite/tree/master/frameworks/examples"
    click tests "https://github.com/openharmony/arkui_ace_engine_lite/tree/master/test"
    click tools "https://github.com/openharmony/arkui_ace_engine_lite/tree/master/frameworks/tools"
    click target "https://github.com/openharmony/arkui_ace_engine_lite/tree/master/frameworks/targets"

    %% Styles
    classDef app fill:#ADD8E6,stroke:#000,stroke-width:2px;
    classDef dataBinding fill:#FFCC00,stroke:#000,stroke-width:2px;
    classDef runtime fill:#66CCFF,stroke:#000,stroke-width:2px;
    classDef framework fill:#CCFFCC,stroke:#000,stroke-width:2px;
    classDef external fill:#FFCCCC,stroke:#000,stroke-width:2px;
    classDef tooling fill:#E1D5E7,stroke:#000,stroke-width:2px;
    classDef target fill:#FCE5CD,stroke:#000,stroke-width:2px;
```
