# adobe/aem-guides-wknd architecture

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

- Interactive diagram: https://gitdiagram.com/adobe/aem-guides-wknd
- Repository: https://github.com/adobe/aem-guides-wknd

## Overview

##### Project Type and Purpose
- This is a full-stack Adobe Experience Manager (AEM) Sites reference implementation (“WKND”) built with a multi-module Maven structure. It includes OSGi services, content packages, front-end assets, configuration modules, sample content, testing suites, and a Dispatcher cache layer.

##### Main Architectural Components
a. CI/CD Pipeline
- GitHub Actions & Cloud Manager (build & release workflows)
- Maven goals: compile OSGi bundles, assemble content packages, run integration tests, publish to Cloud Manager.
b. Maven Modules (build artifacts)
- “core” – Java OSGi bundles (models, services).
- “ui.apps” – content definitions & HTL scripts under /apps/wknd.
- “ui.config” – OSGi config for author & publish run modes.
- “ui.content.sample” – sample site content (pages, assets).
- “ui.content” – production content filters & WCM policies.
- “ui.frontend” – Webpack/Sass/TypeScript clientlibs for styling & interactivity.
- “dispatcher” – Apache HTTP Dispatcher config for caching & request routing.
- “it.tests” – Java integration tests using AEM Test Framework.
- “ui.tests” – end-to-end tests with Cypress.
c. AEM Environments
- Author instance – content authors.
- Publish instance – delivery of published content.
- Dispatcher – caching & web-server front.
d. End Users & External Services
- Site visitors – HTTP/HTTPS requests.
- Adobe Stock (third-party assets).

##### Component Relationships & Data Flow (vertical orientation)
[Top] 1. Developer commits → triggers GitHub Actions/Cloud Manager
↓
2. Maven multi-module build
- compiles “core” → OSGi bundles
- packages “ui.*” → content JARs
- bundles “ui.frontend” → clientlib ZIP
- assembles “dispatcher”
- runs “it.tests” & “ui.tests”
↓
3. Deployment
- Content packages & OSGi bundles → AEM Author/Publish via Cloud Manager
- Dispatcher config → CDN/Dispatcher servers
↓
4. Runtime
- Dispatcher serves static assets & caches HTML
- Dynamic requests routed to AEM Publish (templates, Sling/HTL, Java models)
- AEM invokes “core” services/models to fetch JCR content
- “ui.frontend” clientlibs downloaded by browser
↓
5. End Users interact with site

##### Architectural Patterns & Principles
- Modular Maven structure (separation of services, content, config, front-end, tests)
- OSGi microkernel: “core” bundles on Sling
- Content-package driven delivery: “ui.apps”, “ui.content”
- Clientlibs for CSS/JS bundling (Webpack)
- Dispatcher caching & cache-invalidations rules
- Multi-stage CI/CD: build → test → deploy

##### Technologies & Frameworks
- Java/Osgi/Sling/HTL (AEM Core Components)
- Maven (3.x), GitHub Actions, Cloud Manager
- Webpack, Sass, TypeScript (ui.frontend)
- Apache HTTP Dispatcher
- JUnit (it.tests), Cypress (ui.tests)
- CRX/Jackrabbit Oak (JCR repository)

##### Final Recommendations
- Expand each stage with sub-components (e.g., list Maven modules under Build).

## Diagram (Mermaid)

```mermaid
flowchart TB
    classDef pipeline fill:#f9f,stroke:#333,stroke-width:1px;
    classDef build fill:#bbf,stroke:#000;
    classDef content fill:#bfb,stroke:#000;
    classDef config fill:#fbf,stroke:#000;
    classDef frontend fill:#ffb,stroke:#000;
    classDef tests fill:#fbb,stroke:#000;
    classDef deploy fill:#fdf,stroke:#000;
    classDef runtime fill:#dfd,stroke:#000;
    classDef external fill:#efe,stroke:#333,stroke-dasharray:5 5;
    classDef db fill:#ffdfba,stroke:#333;

    hexGH["GitHub Actions"]:::external
    hexCM["Cloud Manager"]:::external

    hexGH -->|commit triggers| buildStart

    subgraph "Build"
        direction TB
        core["core (OSGi Bundle)"]:::build
        uiapps["ui.apps (HTL & Content)"]:::content
        uiconfig["ui.config (OSGi Config)"]:::config
        uicontentsample["ui.content.sample"]:::content
        uicontent["ui.content"]:::content
        uifrontend["ui.frontend (clientlibs)"]:::frontend
        dispatcherMod["dispatcher (Config)"]:::build
        ittests["it.tests"]:::tests
        uitests["ui.tests"]:::tests
    end

    buildStart[ ]:::pipeline
    buildStart --> core --> uiapps --> uiconfig --> uicontentsample --> uicontent --> uifrontend --> dispatcherMod --> ittests --> uitests
    uitests -->|build complete| hexCM

    subgraph "Deploy"
        direction TB
        Author["AEM Author"]:::runtime
        Publish["AEM Publish"]:::runtime
        DispatcherCfg["Dispatcher Config"]:::deploy
    end

    hexCM -->|deploy packages| Author
    hexCM -->|deploy packages| Publish
    hexCM -->|deploy config| DispatcherCfg

    subgraph "Runtime"
        direction TB
        EndUser["Site Visitors"]:::external
        DispatcherServer["Dispatcher"]:::runtime
        Publish
        core
        JCR["JCR Repository"]:::db
        AdobeStock["Adobe Stock"]:::external
    end

    EndUser -->|HTTP/HTTPS requests| DispatcherServer
    DispatcherCfg --> DispatcherServer
    DispatcherServer -->|cache miss| Publish
    Publish -->|invoke OSGi models| core
    core -->|reads/writes| JCR
    Publish -->|fetch assets| AdobeStock
    Publish -->|serve clientlibs| uifrontend
    DispatcherServer -->|serve cached| EndUser

    click hexGH "https://github.com/adobe/aem-guides-wknd/blob/main/.github/workflows/maven.yml"
    click hexGH "https://github.com/adobe/aem-guides-wknd/blob/main/.github/workflows/maven-release.yml"
    click hexGH "https://github.com/adobe/aem-guides-wknd/blob/main/.github/workflows/deploy-to-wknd-prod.yml"
    click hexCM "https://github.com/adobe/aem-guides-wknd/blob/main/config/cdn.yaml"
    click core "https://github.com/adobe/aem-guides-wknd/blob/main/core/pom.xml"
    click uiapps "https://github.com/adobe/aem-guides-wknd/blob/main/ui.apps/pom.xml"
    click uiconfig "https://github.com/adobe/aem-guides-wknd/blob/main/ui.config/pom.xml"
    click uicontentsample "https://github.com/adobe/aem-guides-wknd/blob/main/ui.content.sample/pom.xml"
    click uicontent "https://github.com/adobe/aem-guides-wknd/blob/main/ui.content/pom.xml"
    click uifrontend "https://github.com/adobe/aem-guides-wknd/blob/main/ui.frontend/pom.xml"
    click dispatcherMod "https://github.com/adobe/aem-guides-wknd/blob/main/dispatcher/pom.xml"
    click ittests "https://github.com/adobe/aem-guides-wknd/blob/main/it.tests/pom.xml"
    click uitests "https://github.com/adobe/aem-guides-wknd/blob/main/ui.tests/pom.xml"
```
