# techdivision/eds-multisite-demo-brand-red architecture

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

- Interactive diagram: https://gitdiagram.com/techdivision/eds-multisite-demo-brand-red
- Repository: https://github.com/techdivision/eds-multisite-demo-brand-red

## Overview

##### Main Components
- Main Repository: The central codebase (this repository) which contains the shared site code, GitHub workflow configurations, and common assets (e.g., blocks, global styles, scripts).
- Child Repositories: These are the per-brand repositories (evidenced by links to eds-multisite-demo-brand-red and eds-multisite-demo-brand-blue) that receive synced content from the main repository.
- Multi-Site Configuration: The “.multisite” folder holds the configuration file (config.yaml) and brand-specific directories (brand-blue & brand-red) including overrides (e.g., custom theme.css files) and fstab settings.
- GitHub Actions/Workflows: The .github folder, including workflows like sync.yaml, drives automated synchronization between the main repository and child repositories.
- Shared Components and Assets: The “blocks” directory (with header, hero, footer, cards, etc.), global styles, scripts, and fonts represent the building blocks for the various web pages served by AEM.
- AEM Edge Delivery Services: Although not present as source files, the deployment endpoints and integration with AEM are central to the project, handling the delivery to different environments for each brand.

##### Relationships and Interactions
- The Main Repository serves as the primary code repository where all shared features and implementations reside.
- GitHub Actions (configured via workflows such as sync.yaml) authenticate with the GitHub App to initiate sync jobs that update child repositories.
- The .multisite folder and its subdirectories allow for both shared configurations (in config.yaml) and brand-specific customizations (via override files per brand).
- After code is synchronized and merged into brand-specific repositories, each deployment pipeline pushes the content to the corresponding AEM Edge Delivery Service environment endpoints.
- The shared blocks and assets are used to construct the pages and can be overridden in specific brand directories to meet brand-specific styling or functionality.

##### Important Architectural Patterns and Design Principles
- Shared Codebase with Override Pattern: Emphasize the structured approach where a unified repository manages all major content while brand-specific customizations are handled via an override mechanism in the .multisite folder.
- CI/CD Automation: Highlight the GitHub Actions workflows that automate repository sync and deployment processes.
- Modular Component Design: The “blocks” directory represents a modular approach to building page elements. Emphasize reusability and clear separation of concerns.
- Multi-Tenancy: Different environments (brand-specific endpoints) are achieved by abstracting common functionalities and allowing configurations per brand.

##### Final Touches
- Maintain clear and intuitive labels for ease of understanding by both developers and architects.

## Diagram (Mermaid)

```mermaid
graph TD
    subgraph "Main Repository"
        A["Shared Assets (blocks, styles, scripts, fonts)"]:::shared
        B["Multi-Site Configuration (.multisite)"]:::config
        C["GitHub Actions Workflows (.github/workflows)"]:::workflow
    end

    subgraph "Child Repositories"
        D["Brand Blue Repo"]:::child
        E["Brand Red Repo"]:::child
    end

    F["AEM Edge Delivery Service (Brand Blue Endpoint)"]:::aem
    G["AEM Edge Delivery Service (Brand Red Endpoint)"]:::aem
    H["GitHub App for Authentication"]:::external

    %% Relationships from Main Repository components to Child Repositories
    A -->|"sharedAssets"| D
    A -->|"sharedAssets"| E
    B -->|"configOverride"| D
    B -->|"configOverride"| E
    C -->|"sync"| D
    C -->|"sync"| E

    %% Deployment from Child Repositories to AEM Edge Delivery Services
    D -->|"deploy"| F
    E -->|"deploy"| G

    %% GitHub App authenticates GitHub Actions
    H -->|"authenticates"| C

    %% Click Events
    click A "https://github.com/techdivision/eds-multisite-demo-brand-red/tree/main/blocks"
    click B "https://github.com/techdivision/eds-multisite-demo-brand-red/blob/main/.multisite"
    click C "https://github.com/techdivision/eds-multisite-demo-brand-red/blob/main/.github/workflows/sync.yaml"
    click D "https://github.com/techdivision/eds-multisite-demo-brand-red/tree/main/.multisite/brand-blue"
    click E "https://github.com/techdivision/eds-multisite-demo-brand-red/tree/main/.multisite/brand-red"

    %% Styles
    classDef shared fill:#a3c4dc,stroke:#000,stroke-width:1px;
    classDef config fill:#f8b133,stroke:#000,stroke-width:1px;
    classDef workflow fill:#d4a5a5,stroke:#000,stroke-width:1px;
    classDef child fill:#c2e699,stroke:#000,stroke-width:1px;
    classDef aem fill:#f4cccc,stroke:#000,stroke-width:1px;
    classDef external fill:#c9daf8,stroke:#000,stroke-width:1px;
```
