# wiris/html-integrations architecture

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

- Interactive diagram: https://gitdiagram.com/wiris/html-integrations
- Repository: https://github.com/wiris/html-integrations

## Overview

##### Main Components Identification
- Devkit & Core Libraries: Identify the central reusable functionality in packages such as the devkit (packages/devkit) and core integrations which are reused by the individual editor plugins.
- Editor Plugins: Clearly list separate packages for CKEditor4, CKEditor5, Froala, TinyMCE (versions 5, 6, 7), Generic, Viewer, etc. (see folders inside packages such as packages/ckeditor4, packages/ckeditor5, packages/froala, packages/tinymce*, packages/generic, packages/viewer, and packages/wordpress).
- Demo Applications: Represent the “demos” folder, which holds multiple demo implementations (HTML demos, Vue demos, etc.) for quick testing and integration examples.
- Testing Infrastructure: Include the Cypress test suites (cypress directory and its subfolders) showing end-to-end tests, sandbox, smoke, and validation tests.
- Documentation & Developer Guides: Incorporate the “docs” directory (including ADRs, contributing guidelines, development instructions) which illustrates the project’s architectural decisions.
- CI/CD & Build Configuration: Represent the GitHub workflows (.github/workflows) for automated tests, deployments, publishing packages, and other build scripts (e.g. babel.config.js, webpack.config.js files across various packages).
- Configuration & Infrastructure: Show configuration files (nx.json, tsconfig.*, etc.) and environment-specific files like Terraform configs for AWS which are in the “terraform” folder.

##### Relationships and Data Flow
- CI/CD tools (GitHub workflows, Cypress tests, and build scripts) as a separate block that interacts with all other components, enforcing the build and test pipelines.

##### Architectural Patterns and Design Principles
- Monorepo Structure: Highlight that the structure uses an NX (or similar) monorepo setup to manage multiple interdependent packages.
- Separation of Concerns: Emphasize that different integrations are modularized into distinct packages while sharing a common devkit.
- CI/CD & Automated Testing: Stress the automated testing and deployment pipelines; represent how changes are first run through the Cypress tests and then are built and deployed via GitHub workflows.
- Dependency Management: Indicate that the build scripts, configuration files (babel, webpack, tsconfig) and package.json files keep the dependencies clear and ensure consistency across all integrations.

- Core Integration Layer: Central block labeled “MathType Devkit / Core” including references to packages/devkit, common libraries, and shared configuration.
- Individual Plugin Modules: Separate blocks for “MathType for CKEditor4”, “MathType for CKEditor5”, “MathType for Froala”, “MathType for TinyMCE (5/6/7)”, “MathType Generic”, “MathType Viewer”, and “MathType for WordPress” (if applicable).
- Infrastructure & Configuration: Components for monorepo configuration with Nx (nx.json), type configurations (tsconfig files), and build scripts (webpack, babel) as supporting layers.
- External Dependencies: An “External Services” block for the npm registry and external editors (CKEditor, Froala, TinyMCE) to indicate consumption points.

- Every file or configuration cluster from the repository that impacts system architecture (CI/CD pipelines, demos, build scripts) is represented, either directly or in an aggregated “Infrastructure” or “Configuration” component.

## Diagram (Mermaid)

```mermaid
flowchart TD
    demos["Demos (HTML/Vue)"]:::demo
    tests["Cypress Testing"]:::test
    cicd["CI/CD Workflows"]:::cicd
    docs["Documentation & Developer Guides"]:::docs
    config["Configuration & Infrastructure"]:::config
    external["External Services (npm Registry & Editors)"]:::external
    core["MathType Devkit / Core"]:::core

    subgraph "Editor Plugins"
        ck4["MathType for CKEditor4"]:::plugin
        ck5["MathType for CKEditor5"]:::plugin
        froala["MathType for Froala"]:::plugin
        generic["MathType Generic"]:::plugin
        tinymce5["MathType for TinyMCE 5"]:::plugin
        tinymce6["MathType for TinyMCE 6"]:::plugin
        tinymce7["MathType for TinyMCE 7"]:::plugin
        viewer["MathType Viewer"]:::plugin
        wordpress["MathType WordPress"]:::plugin
    end

    %% Demos consume Editor Plugins
    demos -->|"consumes"| ck4
    demos -->|"consumes"| ck5
    demos -->|"consumes"| froala
    demos -->|"consumes"| generic
    demos -->|"consumes"| tinymce5
    demos -->|"consumes"| tinymce6
    demos -->|"consumes"| tinymce7
    demos -->|"consumes"| viewer
    demos -->|"consumes"| wordpress

    %% Editor Plugins use the Core Devkit
    ck4 -->|"uses"| core
    ck5 -->|"uses"| core
    froala -->|"uses"| core
    generic -->|"uses"| core
    tinymce5 -->|"uses"| core
    tinymce6 -->|"uses"| core
    tinymce7 -->|"uses"| core
    viewer -->|"uses"| core
    wordpress -->|"uses"| core

    %% Testing validates the Editor Plugins
    tests ---|"validates"| ck4
    tests ---|"validates"| ck5
    tests ---|"validates"| froala
    tests ---|"validates"| generic
    tests ---|"validates"| tinymce5
    tests ---|"validates"| tinymce6
    tests ---|"validates"| tinymce7
    tests ---|"validates"| viewer
    tests ---|"validates"| wordpress

    %% CI/CD triggers and builds various components
    cicd -->|"triggers"| tests
    cicd -->|"builds"| core
    cicd -->|"builds"| ck4
    cicd -->|"builds"| ck5
    cicd -->|"builds"| froala
    cicd -->|"builds"| generic
    cicd -->|"builds"| tinymce5
    cicd -->|"builds"| tinymce6
    cicd -->|"builds"| tinymce7
    cicd -->|"builds"| viewer
    cicd -->|"builds"| wordpress

    %% Configuration supports CI/CD and Core Configuration
    config -->|"supports"| cicd
    config -->|"configures"| core

    %% Editor Plugins distribute to External Services
    ck4 -->|"distributed"| external
    ck5 -->|"distributed"| external
    froala -->|"distributed"| external
    generic -->|"distributed"| external
    tinymce5 -->|"distributed"| external
    tinymce6 -->|"distributed"| external
    tinymce7 -->|"distributed"| external
    viewer -->|"distributed"| external
    wordpress -->|"distributed"| external

    %% Documentation guides the Core and Plugins
    docs -->|"guides"| core
    docs -->|"guides"| ck4
    docs -->|"guides"| ck5
    docs -->|"guides"| froala
    docs -->|"guides"| generic
    docs -->|"guides"| tinymce5
    docs -->|"guides"| tinymce6
    docs -->|"guides"| tinymce7
    docs -->|"guides"| viewer
    docs -->|"guides"| wordpress

    %% Demos show example usage documented in Guides
    demos -->|"exampleUsage"| docs

    %% Click Events for Component Mapping
    click core "https://github.com/wiris/html-integrations/tree/master/packages/devkit"
    click ck4 "https://github.com/wiris/html-integrations/tree/master/packages/ckeditor4"
    click ck5 "https://github.com/wiris/html-integrations/tree/master/packages/ckeditor5"
    click froala "https://github.com/wiris/html-integrations/tree/master/packages/froala"
    click generic "https://github.com/wiris/html-integrations/tree/master/packages/generic"
    click tinymce5 "https://github.com/wiris/html-integrations/tree/master/packages/tinymce5"
    click tinymce6 "https://github.com/wiris/html-integrations/tree/master/packages/tinymce6"
    click tinymce7 "https://github.com/wiris/html-integrations/tree/master/packages/tinymce7"
    click viewer "https://github.com/wiris/html-integrations/tree/master/packages/viewer"
    click wordpress "https://github.com/wiris/html-integrations/tree/master/packages/wordpress"
    click demos "https://github.com/wiris/html-integrations/tree/master/demos"
    click tests "https://github.com/wiris/html-integrations/tree/master/cypress"
    click docs "https://github.com/wiris/html-integrations/tree/master/docs"
    click cicd "https://github.com/wiris/html-integrations/tree/master/.github/workflows"
    click config "https://github.com/wiris/html-integrations/tree/master/terraform"

    %% Styling
    classDef core fill:#1f77b4,stroke:#333,stroke-width:2px,color:#fff;
    classDef plugin fill:#aec7e8,stroke:#333,stroke-width:2px;
    classDef demo fill:#2ca02c,stroke:#333,stroke-width:2px,color:#fff;
    classDef test fill:#d62728,stroke:#333,stroke-width:2px,color:#fff;
    classDef cicd fill:#ff7f0e,stroke:#333,stroke-width:2px,color:#fff;
    classDef docs fill:#9467bd,stroke:#333,stroke-width:2px,color:#fff;
    classDef config fill:#8c564b,stroke:#333,stroke-width:2px,color:#fff;
    classDef external fill:#e377c2,stroke:#333,stroke-dasharray: 5 5,stroke-width:2px,color:#fff,stroke-dasharray: 5 5;
```
