# artusjs/artusx architecture

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

- Interactive diagram: https://gitdiagram.com/artusjs/artusx
- Repository: https://github.com/artusjs/artusx

## Overview

##### Main components
- Core Libraries: Represent the “packages/libs” section (for example, @artusx/core, @artusx/otl, @artusx/utils). These form the foundational layer upon which other parts of the system depend.
- Applications: Under “packages/apps,” you have different application implementations (e.g., artusx-express, artusx-grpc, artusx-koa, artusx-nest, artusx-react, artusx-websocket). These can be depicted as separate nodes for each type of app, showing that they are built on top of the core libraries.
- Plugins: The “packages/plugins” directory contains a wide variety of plugins (for protocols, templating, scheduling, logging, and more). These are additional modules that extend or integrate with both the applications and the core libraries through well-defined interfaces.
- Tooling & Boilerplates: Include the “toolchains” (init, eslint-config, tsconfig, rush-utils, etc.) and “packages/boilerplates” components. These support development, configuration, continuous integration (CI, as seen in .github/workflows), and consistent code styling.
- Configuration and DevOps: Show the roles of configuration files (such as those under “common/config” and the Rush configuration files along with package management and build scripts) as well as the CI/CD pipelines from the “.github” directory and the Docker container configuration in “.devcontainer.”

##### Relationships and data flow
- Plugins to the apps layer to show that they are “pluggable” extensions – optionally tied to certain application types (e.g., plugins for Express, Koa, Nest, etc.).
- That the toolchains and configuration files serve the entire ecosystem by providing standards and build/release orchestration (using Rush, pnpm, Docker).
- Flow for development and release: from source code in different packages to CI/CD processes (GitHub workflows, release scripts) and eventual npm publishing.

##### Architectural patterns and design principles
- Plugin/Extension Pattern: Separate the core functionality (libs) from the plugins; use a standard interface/contract that each plugin adheres to.

##### Technologies and deployment aspects
- That the project uses Node.js with TypeScript (as seen by the tsconfig.json files across packages) and modern package managers (pnpm, rush).
- Continuous integration via GitHub Actions (.github/workflows) and container development environments (.devcontainer).

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "ArtusX Ecosystem"
        %% Core Libraries
        subgraph "Core Libraries"
            core1["@artusx/core"]:::lib
            otl["@artusx/otl"]:::lib
            utils["@artusx/utils"]:::lib
        end

        %% Applications
        subgraph "Applications"
            express["ArtusX Express"]:::app
            grpc["ArtusX gRPC"]:::app
            koa["ArtusX Koa"]:::app
            nest["ArtusX Nest"]:::app
            react["ArtusX React"]:::app
            websocket["ArtusX Websocket"]:::app
        end

        %% Plugins
        subgraph "Plugins"
            pluginExpress["Plugin Express"]:::plugin
            pluginKoa["Plugin Koa"]:::plugin
            pluginNest["Plugin Nest"]:::plugin
            pluginGrpc["Plugin gRPC"]:::plugin
            pluginRedis["Plugin Redis"]:::plugin
        end

        %% Tooling & Boilerplates
        subgraph "Tooling & Boilerplates"
            subgraph "Toolchains"
                init["Init"]:::tool
                rushUtil["Rush Utils"]:::tool
                eslint["ESLint Config"]:::tool
                tsconfig["TSConfig"]:::tool
                tsconfigReact["TSConfig React"]:::tool
            end
            subgraph "Boilerplates"
                appBoiler["ArtusX App Boilerplate"]:::boiler
                libBoiler["ArtusX Lib Boilerplate"]:::boiler
                pluginBoiler["ArtusX Plugin Boilerplate"]:::boiler
            end
        end

        %% Configuration & DevOps
        subgraph "Configuration & DevOps"
            config["Common Config"]:::config
            github["GitHub Workflows"]:::config
            devcontainer[".devcontainer"]:::config
        end
    end

    %% Relationships: Core Libraries dependencies for Applications
    core1 -->|"depends_on"| express
    core1 -->|"depends_on"| grpc
    core1 -->|"depends_on"| koa
    core1 -->|"depends_on"| nest
    core1 -->|"depends_on"| react
    core1 -->|"depends_on"| websocket

    otl -->|"supports"| express
    otl -->|"supports"| grpc
    otl -->|"supports"| koa
    otl -->|"supports"| nest
    otl -->|"supports"| react
    otl -->|"supports"| websocket

    utils -->|"utilizes"| express
    utils -->|"utilizes"| grpc
    utils -->|"utilizes"| koa
    utils -->|"utilizes"| nest
    utils -->|"utilizes"| react
    utils -->|"utilizes"| websocket

    %% Plugins extend Applications
    pluginExpress -->|"plugs_into"| express
    pluginKoa -->|"plugs_into"| koa
    pluginNest -->|"plugs_into"| nest
    pluginGrpc -->|"plugs_into"| grpc
    pluginRedis -->|"plugs_into"| express

    %% Toolchains support ecosystem components
    init -->|"orchestrates"| rushUtil
    rushUtil -->|"configures"| eslint
    eslint -->|"enforces"| tsconfig
    tsconfig -->|"integrates_with"| tsconfigReact

    %% Boilerplates provide starter templates
    init -->|"scaffolds"| appBoiler
    init -->|"scaffolds"| libBoiler
    init -->|"scaffolds"| pluginBoiler

    %% Configuration & DevOps support Toolchains
    config -->|"triggers"| init
    github -->|"triggers"| init
    devcontainer -->|"supports"| init

    %% Click Events for Core Libraries
    click core1 "https://github.com/artusjs/artusx/tree/main/packages/libs/core"
    click otl "https://github.com/artusjs/artusx/tree/main/packages/libs/otl"
    click utils "https://github.com/artusjs/artusx/tree/main/packages/libs/utils"

    %% Click Events for Applications
    click express "https://github.com/artusjs/artusx/tree/main/packages/apps"
    click grpc "https://github.com/artusjs/artusx/tree/main/packages/apps"
    click koa "https://github.com/artusjs/artusx/tree/main/packages/apps"
    click nest "https://github.com/artusjs/artusx/tree/main/packages/apps"
    click react "https://github.com/artusjs/artusx/tree/main/packages/apps"
    click websocket "https://github.com/artusjs/artusx/tree/main/packages/apps"

    %% Click Events for Plugins
    click pluginExpress "https://github.com/artusjs/artusx/tree/main/packages/plugins"
    click pluginKoa "https://github.com/artusjs/artusx/tree/main/packages/plugins"
    click pluginNest "https://github.com/artusjs/artusx/tree/main/packages/plugins"
    click pluginGrpc "https://github.com/artusjs/artusx/tree/main/packages/plugins"
    click pluginRedis "https://github.com/artusjs/artusx/tree/main/packages/plugins"

    %% Click Events for Toolchains
    click init "https://github.com/artusjs/artusx/tree/main/toolchains/init"
    click rushUtil "https://github.com/artusjs/artusx/tree/main/toolchains/rush-utils"
    click eslint "https://github.com/artusjs/artusx/tree/main/toolchains/eslint-config"
    click tsconfig "https://github.com/artusjs/artusx/tree/main/toolchains/tsconfig"
    click tsconfigReact "https://github.com/artusjs/artusx/tree/main/toolchains/tsconfig-react"

    %% Click Events for Boilerplates
    click appBoiler "https://github.com/artusjs/artusx/tree/main/packages/boilerplates/artusx-app"
    click libBoiler "https://github.com/artusjs/artusx/tree/main/packages/boilerplates/artusx-lib"
    click pluginBoiler "https://github.com/artusjs/artusx/tree/main/packages/boilerplates/artusx-plugin"

    %% Click Events for Configuration & DevOps
    click config "https://github.com/artusjs/artusx/tree/main/common/config"
    click github "https://github.com/artusjs/artusx/blob/main/.github"
    click devcontainer "https://github.com/artusjs/artusx/blob/main/.devcontainer"

    %% Styles
    classDef lib fill:#AED6F1,stroke:#1F618D,stroke-width:2px;
    classDef app fill:#A3E4D7,stroke:#117864,stroke-width:2px;
    classDef plugin fill:#FAD7A0,stroke:#B9770E,stroke-width:2px;
    classDef tool fill:#D7BDE2,stroke:#6C3483,stroke-width:2px;
    classDef boiler fill:#F5B7B1,stroke:#943126,stroke-width:2px;
    classDef config fill:#ABEBC6,stroke:#117A65,stroke-width:2px;
```
