# gornobath/syntheticmr architecture

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

- Interactive diagram: https://gitdiagram.com/gornobath/syntheticmr
- Repository: https://github.com/gornobath/syntheticmr

## Overview

##### Overall Project Type and Purpose
- This is a WordPress theme project (with additional complement modules) that integrates several custom and third‐party libraries (notably CMB2) to enhance backend functionality (like custom metaboxes and testimonials) and provide a rich front-end experience.
- The theme itself includes all the standard WordPress template files (header.php, index.php, footer.php, etc.) plus an assets directory for CSS, Sass, JavaScript, fonts, and images.
- There is a “complementos” component (under syntheticmr_complementos) that extends functionality—likely dealing with custom post types, shortcodes, and testimonials—using a similar CMB2 integration.

##### Break Down the Project into its Main Architectural Components
a. WordPress Core – The underlying CMS platform that loads the theme and plugins.
b. Theme Layer (Syntethicmr-theme):
– Template Files (e.g., index.php, page.php, single.php, header.php, footer.php, etc.) that determine the front-end layout.
– Assets and Styling:
◦ CSS files (both plain and Sass sources with compiled outputs in style.css).
◦ JavaScript files.
◦ Fonts and Images.
– Custom Functionality:
◦ functions.php and additional PHP libraries (like custom-fields.php, shortcode.php) that hook into WordPress.
– Third-Party Library – CMB2:
◦ The CMB2 folder is integrated here to provide custom metabox functionality. Notice that it includes many files (PHP include scripts, CSS, JavaScript, languages, etc.) and follows a modular architecture.
c. Complementos Module (syntheticmr_complementos):
– Contains its own includes (custom post type registration, shortcodes, additional scripts and styles).
– Assets like CSS and JS that are specific to the complement functionality.

##### Relationships and Interaction Paths
- The WordPress Core loads the theme (Syntethicmr-theme) which in turn leverages:
– Template files to render pages.
– functions.php to hook into WordPress actions/filters and load additional components.
- The theme integrates the CMB2 library (and its duplicate in complementos) to display custom fields in the admin and on the front-end as needed.
- The syntheticmr_complementos module extends the base theme functionality by registering custom post types, enqueuing its own assets, and handling shortcodes—for example, to manage testimonials.
- There is a clear separation between the presentation layer (assets, HTML/PHP templates) and the functional layer (custom functions, metabox libraries, shortcode handlers).

##### Architectural Patterns and Key Technologies
- Modular Design: Separation into theme and complement modules, each with clearly scoped responsibilities.
- Use of a third‐party library (CMB2) for handling custom metaboxes. Note the duplicated integration (in both the theme and complementos) suggesting independent modules.
- Asset Management: Sass is used for styling with compiled CSS, and there’s a clear division of assets (CSS, JS, fonts, images). This aids in maintainable front-end design.
- WordPress Template Hierarchy: Evident from files like front-page.php, single.php, archive files, etc.
- Internationalization: Multiple language files exist within the CMB2 directories, indicating multilingual support.

##### Final Checklist
– Emphasize modularity, showcasing the separation between the main theme and add-on modules.
– Include notes on asset compilation (Sass to CSS) and internationalization support (language folders in CMB2).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% WordPress Core
    WP["WordPress Core"]:::core

    %% Theme Layer: Syntethicmr-theme
    subgraph "Theme Layer: Syntethicmr-theme"
        TF["Template Files (index.php, header.php, footer.php, etc.)"]:::theme
        TA["Theme Assets (CSS, Sass, JS, Fonts, Images)"]:::theme
        CF["Custom Functions & Includes (functions.php, inc/custom-fields.php, shortcode.php)"]:::theme
        CMB2["Integrated CMB2 Library"]:::theme
    end

    %% Complement Module: syntheticmr_complementos
    subgraph "Complement Module: syntheticmr_complementos"
        CM["Complementos Module (Custom post types, shortcodes, testimonials)"]:::complement
        eCMB2["Embedded CMB2 (Testimonials)"]:::complement
    end

    %% Connections - vertical flow
    WP -->|"loads"| TF
    TF -->|"uses"| TA
    TF -->|"hooks"| CF
    CF -->|"invokes"| CMB2
    %% Theme extended by Complement Module
    TF -->|"extended_by"| CM
    CF -->|"extended_by"| CM
    TA -->|"assets_for"| CM
    CM -->|"includes"| eCMB2

    %% Click Events
    click TF "https://github.com/gornobath/syntheticmr/tree/main/Syntethicmr-theme"
    click TA "https://github.com/gornobath/syntheticmr/tree/main/Syntethicmr-theme/assets"
    click CF "https://github.com/gornobath/syntheticmr/tree/main/Syntethicmr-theme/inc"
    click CMB2 "https://github.com/gornobath/syntheticmr/tree/main/Syntethicmr-theme/CMB2"
    click CM "https://github.com/gornobath/syntheticmr/tree/main/syntheticmr_complementos"
    click eCMB2 "https://github.com/gornobath/syntheticmr/tree/main/syntheticmr_complementos/includes/testimonials/CMB2"

    %% Styles
    classDef core fill:#ffcccc,stroke:#cc0000,stroke-width:2px;
    classDef theme fill:#ccffcc,stroke:#009900,stroke-width:2px;
    classDef complement fill:#cce5ff,stroke:#0033cc,stroke-width:2px;
```
