# ethereum/remix-live-alpha architecture

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

- Interactive diagram: https://gitdiagram.com/ethereum/remix-live-alpha
- Repository: https://github.com/ethereum/remix-live-alpha

## Overview

##### Project type and purpose
- This is a single-page, plugin-based browser IDE (Ethereum Remix IDE) delivered as a fully static website. It bundles core runtime, editor, parser, language services, and many compiler/documentation/testing plugins into a client-only application.

##### File structure
- Top-level: index.html + static bundles (runtime.*, polyfills.*, common.*, main.*).
- assets/: CSS themes, fonts, images, audio, Monaco-editor files, parsers, soljson (Solidity compiler).
- plugins/: dozens of self-contained plugins (circuit-compiler, contract-verification, doc-gen, learneth, noir-compiler, quick-dapp, remix-dapp, solhint, vyper, etc.), each with its own HTML, JS/CSS bundles, WebAssembly modules (.wasm), profile.json.
- .github/workflows/gh-actions-deploy.yml: CI/CD for automatic build and deploy.

##### README
- Confirms it is an automatically built offline-capable website archive of the Remix IDE.

##### Main components
a. Core Loader (index.html + runtime.js + polyfills.js)
b. Webpack Bundles (common.js, main.js)
c. Plugin Manager & Registry (part of core code)
d. Plugin Containers (one per plugin under /plugins/*)
e. Monaco Editor & Language Workers (assets/js/monaco-editor)
f. Parser & Language Service (assets/js/parser + antlr.js)
g. Compiler Engines
- Solidity: soljson.js (WebAssembly + JS wrapper)
- Circuit compiler: .wasm modules loaded by circuit-compiler plugin
- Noir, Vyper, Solhint, etc. (each plugin may load its own WASM or JS engine)
h. Static Assets (CSS themes, fonts, images, audio, list.json, version.json)
i. CI/CD Pipeline (GitHub Actions workflow)

##### Relationships & interactions
- Browser loads index.html → core bundles (runtime, polyfills, common, main).
- Core initializes the Plugin Manager → reads plugin profile.json files → dynamically loads plugin JS/CSS/WASM into isolated containers.
- Core exposes shared services (file system, virtual workspace, network provider) to plugins via a common API.
- Monaco Editor service spins up web workers for syntax highlighting, code completion.
- Parser & language service feed Monaco with tokens and AST.
- Plugin UI components render inside the main app shell; user actions in UI trigger calls to compiler engines (WASM or JS) inside plugin contexts.
- Some plugins (e.g., contract-verification, quick-dapp, remix-dapp) communicate externally (e.g., Etherscan, Ethereum nodes via JSON-RPC).

##### Architectural patterns & design principles
- Plugin-based, micro-frontend architecture: each plugin is an isolated, lazy-loaded micro-app.
- Code splitting & dynamic imports: core vs plugin bundles.
- WebAssembly integration for performance-critical compilers.
- SPA with service-oriented internal APIs: shared services injected into plugins.
- Offline capability: all assets are static, so the app can run without a network.

##### Technologies/frameworks
- JavaScript & WebAssembly
- Webpack (bundling, code splitting)
- Monaco Editor (editor UI)
- ANTLR.js (parser)
- GitHub Actions (CI/CD)
- CSS themes, FontAwesome, audio assets

##### Detail
- Assets sub-systems (CSS themes, fonts) feeding into the UI skin service.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Browser
    Browser["Browser"]:::external
    Browser --> Index

    subgraph "Core Shell"
        Index["index.html"]:::core
        Runtime["runtime.0.66.0-dev.1749882005979.js"]:::core
        Polyfills["polyfills.0.66.0-dev.1749882005979.js"]:::core
        Common["common.0.66.0-dev.1749882005979.js"]:::core
        Main["main.0.66.0-dev.1749882005979.js"]:::core
        Loader["Plugin Manager & Registry (loader.js)"]:::core
    end

    Browser --> Runtime
    Browser --> Polyfills
    Runtime --> Common
    Runtime --> Main
    Main --> Loader

    subgraph "Monaco Editor & Workers"
        Monaco["Monaco Editor"]:::monaco
        WorkerEditor["Editor Worker"]:::monaco
        WorkerLang["Language Worker"]:::monaco
    end

    Loader --> Monaco
    Monaco --> WorkerEditor
    Monaco --> WorkerLang

    subgraph "Parser & Language Service"
        ANTLR["antlr.js"]:::parser
        Tokens["Solidity-EZVQ6AE4.tokens"]:::parser
    end

    Loader --> ANTLR
    ANTLR --> Tokens
    WorkerLang --> ANTLR

    subgraph "Solidity Compiler Engine"
        SolJSON["soljson.js + versioned"]:::wasm
    end

    Loader --> SolJSON

    subgraph "Shared Services"
        FS["File System"]:::service
        WS["Virtual Workspace"]:::service
        NP["Network Provider"]:::service
    end

    Loader --> FS
    Loader --> WS
    Loader --> NP

    subgraph "Plugin Containers"
        subgraph "Circuit Compiler Plugin" 
            CC_HTML["index.html"]:::plugin
            CC_WASM["*.module.wasm"]:::wasm
        end
        subgraph "Contract Verification Plugin"
            CV_HTML["index.html"]:::plugin
        end
        subgraph "Doc-Gen Plugin"
            DG_HTML["index.html"]:::plugin
        end
        subgraph "LearnEth Plugin"
            LE_HTML["index.html"]:::plugin
        end
        subgraph "Noir Compiler Plugin"
            NC_HTML["index.html"]:::plugin
        end
        subgraph "Quick-DApp Plugin"
            QD_HTML["index.html"]:::plugin
        end
        subgraph "Remix-DApp Plugin"
            RD_HTML["index.html"]:::plugin
        end
        subgraph "Solhint Plugin"
            SH_HTML["index.html"]:::plugin
        end
        subgraph "Vyper Plugin"
            VY_HTML["index.html"]:::plugin
        end
    end

    Loader --> CC_HTML
    Loader --> CV_HTML
    Loader --> DG_HTML
    Loader --> LE_HTML
    Loader --> NC_HTML
    Loader --> QD_HTML
    Loader --> RD_HTML
    Loader --> SH_HTML
    Loader --> VY_HTML

    CC_HTML --> CC_WASM
    CV_HTML --> SolJSON
    NC_HTML --> SolJSON
    SH_HTML --> SolJSON
    VY_HTML --> SolJSON

    CC_HTML -->|"RPC/Etherscan"| External["External Ethereum Network/Etherscan"]:::external

    subgraph "Static Assets"
        Themes["CSS Themes"]:::assets
        Fonts["Fonts & FontAwesome"]:::assets
        Images["Images"]:::assets
        Audio["Audio"]:::assets
        Config["list.json & version.json"]:::assets
    end

    Index --> Themes
    Index --> Fonts
    Index --> Images
    Index --> Audio
    Index --> Config

    subgraph "CI/CD Pipeline"
        GH["GitHub Actions Workflow"]:::ci
        Build["Auto Build & Deploy"]:::ci
    end

    GH --> Build
    Build --> Production["Production ZIP"]:::external

    %% Click events
    click Index "https://github.com/ethereum/remix-live-alpha/blob/gh-pages/index.html"
    click Runtime "https://github.com/ethereum/remix-live-alpha/blob/gh-pages/runtime.0.66.0-dev.1749882005979.js"
    click Polyfills "https://github.com/ethereum/remix-live-alpha/blob/gh-pages/polyfills.0.66.0-dev.1749882005979.js"
    click Common "https://github.com/ethereum/remix-live-alpha/blob/gh-pages/common.0.66.0-dev.1749882005979.js"
    click Main "https://github.com/ethereum/remix-live-alpha/blob/gh-pages/main.0.66.0-dev.1749882005979.js"
    click Loader "https://github.com/ethereum/remix-live-alpha/blob/gh-pages/assets/js/loader.js"
    click CC_HTML "https://github.com/ethereum/remix-live-alpha/blob/gh-pages/plugins/circuit-compiler/index.html"
    click CC_WASM "https://github.com/ethereum/remix-live-alpha/tree/gh-pages/plugins/circuit-compiler/"
    click CV_HTML "https://github.com/ethereum/remix-live-alpha/blob/gh-pages/plugins/contract-verification/index.html"
    click DG_HTML "https://github.com/ethereum/remix-live-alpha/blob/gh-pages/plugins/doc-gen/index.html"
    click LE_HTML "https://github.com/ethereum/remix-live-alpha/blob/gh-pages/plugins/learneth/index.html"
    click NC_HTML "https://github.com/ethereum/remix-live-alpha/blob/gh-pages/plugins/noir-compiler/index.html"
    click QD_HTML "https://github.com/ethereum/remix-live-alpha/blob/gh-pages/plugins/quick-dapp/index.html"
    click RD_HTML "https://github.com/ethereum/remix-live-alpha/blob/gh-pages/plugins/remix-dapp/index.html"
    click SH_HTML "https://github.com/ethereum/remix-live-alpha/blob/gh-pages/plugins/solhint/index.html"
    click VY_HTML "https://github.com/ethereum/remix-live-alpha/blob/gh-pages/plugins/vyper/index.html"
    click GH "https://github.com/ethereum/remix-live-alpha/blob/gh-pages/.github/workflows/gh-actions-deploy.yml"

    %% Styles
    classDef core fill:#cce5ff,stroke:#004085,color:#004085
    classDef plugin fill:#d4edda,stroke:#155724,color:#155724
    classDef wasm fill:#ffe5b4,stroke:#cc8400,color:#cc8400
    classDef external fill:#e2e3e5,stroke:#6c757d,color:#6c757d
    classDef service fill:#f2f2f2,stroke:#888,color:#555
    classDef monaco fill:#fff3cd,stroke:#856404,color:#856404
    classDef parser fill:#f8d7da,stroke:#721c24,color:#721c24
    classDef assets fill:#d1ecf1,stroke:#0c5460,color:#0c5460
    classDef ci fill:#f5c6cb,stroke:#a71d2a,color:#a71d2a
```
