# multidots/multicollab architecture

> Architecture diagram of the GitHub repository multidots/multicollab, 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/multidots/multicollab
- Repository: https://github.com/multidots/multicollab

## Overview

##### Main Components
- Plugin Entry Point & Core Initialization
- Root-level file (commenting-block.php) which acts as the main entry point.
- Initialization and loading of core functionalities found in the “includes” directory (activator, deactivator, loader, i18n, etc.). These classes manage plugin lifecycle events and core logic.
- Admin Module
- “admin” folder as the administrative interface. This is where the WordPress back-end settings, dashboard, and various features (such as email notifications, permissions, and real-time collaboration features) are implemented.
▪ Assets Subsystem – CSS, SCSS, and JavaScript files inside “admin/assets”. Note the separation of files for styling (scss and css) and JS functionality (admin/comments, editor, upgrade, etc.).
▪ Core Admin Classes – Located in “admin/classes”, these files (like class-commenting-block-admin.php, class-commenting-block-rest-routes.php) deal with backend business logic and REST API endpoints.
▪ UI Partials – In “admin/partials” and “admin/settings”, which contain various UI components and settings pages for the administration panel.
- Public/Frontend Module
- “public” directory where the public-facing logic and assets reside.
- Components such as the main public class in public/class-commenting-block-public.php, along with CSS/JS that control the plugin’s front-end appearance and functionality.
- Public partials which might be injected into the theme’s front end.
- Multilingual Support
- “languages” directory, which holds translation files (.po, .mo, and .json files) to serve the internationalization needs.

##### Relationships and Interactions
- Similarly, illustrate how public classes and assets interact. For example, show the AJAX or REST communication paths (noting the presence of the “class-commenting-block-rest-routes.php” file) that are used to update or retrieve comments in real time.
- Integration of multilingual support with the core loader and admin/public modules, emphasizing that text and content rendered is dynamically localized.

##### Technologies and Frameworks
- WordPress APIs (hooks, actions, filters, REST APIs) – These are the backbone of the system’s integration with the WordPress ecosystem.
- JavaScript (modern ES standards as hinted by .babelrc, potential use of Node via .nvmrc in admin assets) – These ensure dynamic client-side behavior.
- SASS/SCSS – Used for styling, especially in the admin assets and public CSS.
- PHP – The main language in use for backend and core plugin functionality.
- External libraries – Indicated by files in “admin/assets/js/libs” can be represented as auxiliary components.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Core Components
    A["Plugin Entry (commenting-block.php)"]:::core
    B["Loader (includes/ - core initialization)"]:::core
    I["Internationalization (languages)"]:::lang

    %% Admin Module Components
    AA["Admin Assets (admin/assets/)"]:::admin
    AB["Admin Core Classes (admin/classes/)"]:::admin
    AC["Admin UI (admin/partials & admin/settings)"]:::admin

    %% Public Module Components
    PA["Public Main Class (public/class-commenting-block-public.php)"]:::public
    PB["Public Assets (public/css & public/js)"]:::public
    PC["Public Partials (public/partials/)"]:::public

    %% Connections from Plugin Entry to Core Loader and Internationalization
    A -->|"initializes"| B
    B -->|"loads"| I

    %% Connections from Loader to Admin and Public Modules
    B -->|"registers"| AA
    B -->|"registers"| AB
    B -->|"registers"| PA

    %% Admin Module Internal Interactions
    AB -->|"executes"| AC
    AA -->|"supports"| AC

    %% Public Module Internal Interactions
    PA -->|"renders"| PB
    PA -->|"renders"| PC

    %% Integration: REST communication between Admin and Public
    AB -->|"exposesREST"| PA

    %% Click Events
    click A "https://github.com/multidots/multicollab/blob/master/commenting-block.php"
    click B "https://github.com/multidots/multicollab/tree/master/includes/"
    click I "https://github.com/multidots/multicollab/tree/master/languages/"
    click AA "https://github.com/multidots/multicollab/tree/master/admin/assets/"
    click AB "https://github.com/multidots/multicollab/tree/master/admin/classes/"
    click AC "https://github.com/multidots/multicollab/tree/master/admin/partials/"
    click PA "https://github.com/multidots/multicollab/blob/master/public/class-commenting-block-public.php"
    click PB "https://github.com/multidots/multicollab/tree/master/public/css/"
    click PC "https://github.com/multidots/multicollab/tree/master/public/partials/"

    %% Styles
    classDef core fill:#118ab2,stroke:#333,stroke-width:2px;
    classDef admin fill:#ffd166,stroke:#333,stroke-width:2px;
    classDef public fill:#06d6a0,stroke:#333,stroke-width:2px;
    classDef lang fill:#ef476f,stroke:#333,stroke-width:2px;
```
