# belghalimohammed/modules architecture

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

- Interactive diagram: https://gitdiagram.com/belghalimohammed/modules
- Repository: https://github.com/belghalimohammed/modules

## Overview

##### Project Type and Purpose
- This is a monorepo of custom Drupal modules (“pleiade-custom-modules”) that extend the Pléiade dashboard.
- It provides connectors (API clients), blocks, forms and services that integrate various external applications (Lemon, GLPI, Moodle, Nextcloud, Zimbra, etc.) into the Pléiade Drupal site.

##### File Structure Analysis
- Top-level: LICENSE, README.md, then a folder per module (e.g. api_lemon_pleiade, api_glpi_pleiade, api_moodle_pleiade, module_actu_pleiade, datatable_pleiade, …).
- Each module follows the Drupal 8+ structure:
- .info.yml and .libraries.yml describe metadata and asset libraries
- .routing.yml defines routes
- .links.menu.yml adds menu links
- src/Controller for request handlers (Symfony controllers)
- src/Form for configuration or form classes
- src/Service for service classes that call external APIs
- css/ and js/ folders for front-end assets
- There is a “module_api_pleiade” which appears to be the core API that other modules depend on, plus an “api_lemon_pleiade” module that provides core settings (LL:NG endpoints).

##### README Insights
- Instructs to install module_api_pleiade first, then api_lemon_pleiade.
- api_lemon_pleiade holds global configuration for LL:NG endpoints.
- All other “api_*” modules are optional connectors that need their own endpoint configuration pages.

##### Main Components
a. Drupal Core (HTTP server, theme layer)
b. module_api_pleiade (Core API module)
c. api_lemon_pleiade (Core settings & services for LL:NG)
– api_glpi_pleiade
– api_moodle_pleiade
– api_nextcloud_pleiade
– api_parapheur_pleiade
– api_pastell_pleiade
– api_user_pleiade
– api_watcha_pleiade
– api_zimbra_pleiade
– …plus datatable_pleiade, module_actu_pleiade, guide_utilisateur_pleiade, etc.
e. External Services / Endpoints (e.g. GLPI API, LL:NG API, Moodle API, Nextcloud API, Zimbra API)
f. Front-end Assets (CSS/JS libraries served to browser)

##### Relationships & Data Flows
- User Browser → Drupal Core (HTTP request)
- Drupal Core routes to Controller in a connector module
- Controller invokes Form or Service (dependency injected)
- Service in connector module → module_api_pleiade / api_lemon_pleiade for shared logic or settings
- Service → External API over HTTP/REST
- External API response → Service → Controller → render Twig block or return JSON (AJAX)
- Front-end JS library in module listens for user interaction → AJAX call to Drupal route → repeat

##### Architectural Patterns & Principles
- MVC (Symfony-based routing + controllers + templating)
- Dependency Injection (services registered in .services.yml)
- Drupal Plugin system for Blocks (e.g. AccessibilityToolsBlock)
- Separation of Concerns:
- Presentation layer (CSS/JS, Twig)
- Application logic (Controllers, Forms)
- Integration layer (Service classes calling external APIs)

## Diagram (Mermaid)

```mermaid
graph TB
    %% Layers
    Browser["User Browser"]:::browser
    DrupalCore["Drupal Core"]:::drupal

    %% Custom Modules grouping
    subgraph "Custom Modules"
        direction TB
        subgraph "Core Modules"
            direction TB
            API_CORE["module_api_pleiade"]:::core
            LEMON["api_lemon_pleiade"]:::core
        end
        subgraph "Connector Modules"
            direction TB
            GLPI["api_glpi_pleiade"]:::connector
            MOODLE["api_moodle_pleiade"]:::connector
            NEXTCLOUD["api_nextcloud_pleiade"]:::connector
            PARAPHEUR["api_parapheur_pleiade"]:::connector
            PASTELL["api_pastell_pleiade"]:::connector
            USERMOD["api_user_pleiade"]:::connector
            WATCHA["api_watcha_pleiade"]:::connector
            ZIMBRA["api_zimbra_pleiade"]:::connector
            DATATABLE["datatable_pleiade"]:::connector
            ACTU["module_actu_pleiade"]:::connector
            GUIDE["guide_utilisateur_pleiade"]:::connector
        end
    end

    %% External APIs
    subgraph "External Services" 
        direction TB
        GLPI_API["GLPI API"]:::external
        LLNG_API["LL:NG API"]:::external
        MOODLE_API["Moodle API"]:::external
        NEXTCLOUD_API["Nextcloud API"]:::external
        ZIMBRA_API["Zimbra API"]:::external
    end

    %% Front-end Assets
    FrontendAssets["Front-end Assets (CSS/JS)"]:::assets

    %% Data Flows
    Browser -->|HTTP Request| DrupalCore
    Browser -->|loads| FrontendAssets
    DrupalCore -->|routes| API_CORE
    DrupalCore -->|routes| LEMON
    DrupalCore -->|routes| GLPI
    DrupalCore -->|routes| MOODLE
    DrupalCore -->|routes| NEXTCLOUD
    DrupalCore -->|routes| PARAPHEUR
    DrupalCore -->|routes| PASTELL
    DrupalCore -->|routes| USERMOD
    DrupalCore -->|routes| WATCHA
    DrupalCore -->|routes| ZIMBRA
    DrupalCore -->|routes| DATATABLE
    DrupalCore -->|routes| ACTU
    DrupalCore -->|routes| GUIDE

    %% Dependencies
    GLPI -->|depends| API_CORE
    MOODLE -->|depends| API_CORE
    NEXTCLOUD -->|depends| API_CORE
    PARAPHEUR -->|depends| API_CORE
    PASTELL -->|depends| API_CORE
    USERMOD -->|depends| API_CORE
    WATCHA -->|depends| API_CORE
    ZIMBRA -->|depends| API_CORE
    DATATABLE -->|depends| API_CORE
    ACTU -->|depends| API_CORE
    GUIDE -->|depends| API_CORE

    LEMON -->|shared settings| API_CORE
    GLPI -->|shared config| LEMON
    MOODLE -->|shared config| LEMON
    NEXTCLOUD -->|shared config| LEMON
    ZIMBRA -->|shared config| LEMON

    %% Connector to External
    GLPI -->|HTTP REST| GLPI_API
    MOODLE -->|HTTP REST| MOODLE_API
    NEXTCLOUD -->|HTTP REST| NEXTCLOUD_API
    ZIMBRA -->|HTTP REST| ZIMBRA_API
    LEMON -->|HTTP REST| LLNG_API

    FrontendAssets -->|AJAX JSON| DrupalCore

    %% Click Events
    click API_CORE "https://github.com/belghalimohammed/modules/blob/main/module_api_pleiade/module_api_pleiade.info.yml"
    click API_CORE "https://github.com/belghalimohammed/modules/blob/main/module_api_pleiade/src/ApiPleiadeManager.php"
    click LEMON "https://github.com/belghalimohammed/modules/blob/main/api_lemon_pleiade/api_lemon_pleiade.info.yml"
    click LEMON "https://github.com/belghalimohammed/modules/blob/main/api_lemon_pleiade/config/install/api_lemon_pleiade.settings.yml"
    click LEMON "https://github.com/belghalimohammed/modules/blob/main/api_lemon_pleiade/src/Controller/PleiadeAjaxController.php"
    click GLPI "https://github.com/belghalimohammed/modules/blob/main/api_glpi_pleiade/api_glpi_pleiade.info.yml"
    click GLPI "https://github.com/belghalimohammed/modules/blob/main/api_glpi_pleiade/src/Controller/GlpiController.php"
    click GLPI "https://github.com/belghalimohammed/modules/blob/main/api_glpi_pleiade/src/Service/GlpiService.php"
    click MOODLE "https://github.com/belghalimohammed/modules/blob/main/api_moodle_pleiade/api_moodle_pleiade.info.yml"
    click MOODLE "https://github.com/belghalimohammed/modules/blob/main/api_moodle_pleiade/src/Controller/MoodleController.php"
    click MOODLE "https://github.com/belghalimohammed/modules/blob/main/api_moodle_pleiade/src/Form/MoodleFields.php"
    click NEXTCLOUD "https://github.com/belghalimohammed/modules/blob/main/api_nextcloud_pleiade/api_nextcloud_pleiade.info.yml"
    click NEXTCLOUD "https://github.com/belghalimohammed/modules/blob/main/api_nextcloud_pleiade/src/Controller/NextcloudController.php"
    click NEXTCLOUD "https://github.com/belghalimohammed/modules/blob/main/api_nextcloud_pleiade/api_nextcloud_pleiade.services.yml"
    click PARAPHEUR "https://github.com/belghalimohammed/modules/blob/main/api_parapheur_pleiade/api_parapheur_pleiade.info.yml"
    click PARAPHEUR "https://github.com/belghalimohammed/modules/blob/main/api_parapheur_pleiade/src/Controller/PleiadeAjaxParapheurController.php"
    click PARAPHEUR "https://github.com/belghalimohammed/modules/blob/main/api_parapheur_pleiade/src/Service/PleiadeAjaxParapheurService.php"
    click PASTELL "https://github.com/belghalimohammed/modules/blob/main/api_pastell_pleiade/api_pastell_pleiade.info.yml"
    click PASTELL "https://github.com/belghalimohammed/modules/blob/main/api_pastell_pleiade/config/install/api_pastell_pleiade.settings.yml"
    click PASTELL "https://github.com/belghalimohammed/modules/blob/main/api_pastell_pleiade/src/Controller/PleiadeAjaxPastellController.php"
    click USERMOD "https://github.com/belghalimohammed/modules/blob/main/api_user_pleiade/api_user_pleiade.info.yml"
    click USERMOD "https://github.com/belghalimohammed/modules/blob/main/api_user_pleiade/src/Controller/PleiadeUserController.php"
    click USERMOD "https://github.com/belghalimohammed/modules/blob/main/api_user_pleiade/src/Service/PleiadeUserService.php"
    click WATCHA "https://github.com/belghalimohammed/modules/blob/main/api_watcha_pleiade/api_watcha_pleiade.info.yml"
    click WATCHA "https://github.com/belghalimohammed/modules/blob/main/api_watcha_pleiade/src/Controller/PleiadeAjaxWatchaController.php"
    click WATCHA "https://github.com/belghalimohammed/modules/blob/main/api_watcha_pleiade/src/Service/WatchaService.php"
    click ZIMBRA "https://github.com/belghalimohammed/modules/blob/main/api_zimbra_pleiade/api_zimbra_pleiade.info.yml"
    click ZIMBRA "https://github.com/belghalimohammed/modules/blob/main/api_zimbra_pleiade/src/Controller/PleiadeAjaxZimbraController.php"
    click ZIMBRA "https://github.com/belghalimohammed/modules/blob/main/api_zimbra_pleiade/src/Service/ZimbraService.php"
    click DATATABLE "https://github.com/belghalimohammed/modules/blob/main/datatable_pleiade/datatable_pleiade.info.yml"
    click DATATABLE "https://github.com/belghalimohammed/modules/blob/main/datatable_pleiade/src/Controller/DatatableController.php"
    click DATATABLE "https://github.com/belghalimohammed/modules/blob/main/datatable_pleiade/src/Service/NextCloudService.php"
    click ACTU "https://github.com/belghalimohammed/modules/blob/main/module_actu_pleiade/module_actu_pleiade.info.yml"
    click ACTU "https://github.com/belghalimohammed/modules/blob/main/module_actu_pleiade/src/Controller/ActuPleiadeController.php"
    click ACTU "https://github.com/belghalimohammed/modules/blob/main/module_actu_pleiade/src/Service/ActuPleiadeService.php"
    click GUIDE "https://github.com/belghalimohammed/modules/blob/main/guide_utilisateur_pleiade/guide_utilisateur_pleiade.info.yml"
    click GUIDE "https://github.com/belghalimohammed/modules/blob/main/guide_utilisateur_pleiade/src/Controller/UserGuideController.php"

    %% Styles
    classDef browser fill:#74c476,stroke:#333,stroke-width:1px
    classDef drupal fill:#41b6c4,stroke:#333,stroke-width:1px
    classDef core fill:#a8ddb5,stroke:#333,stroke-width:1px
    classDef connector fill:#d9f0a3,stroke:#333,stroke-width:1px
    classDef external fill:#fc8d59,stroke:#333,stroke-width:1px
    classDef assets fill:#fed976,stroke:#333,stroke-width:1px
```
