# arunpatidar02/aem-helix-1 architecture

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

- Interactive diagram: https://gitdiagram.com/arunpatidar02/aem-helix-1
- Repository: https://github.com/arunpatidar02/aem-helix-1

## Overview

##### Project Type and Purpose
- This is a front-end project built on Adobe Helix (static site generator) that integrates with Adobe Experience Manager (AEM) via the AEM CLI proxy and the AEM Code Sync GitHub App.
- Purpose: Author, preview, and publish content using Helix Pages and AEM as the content store (JCR), with a local development flow and automated CI/CD pipelines.

##### File Structure
- Top-level directories:
- blocks/ – reusable UI components (each with its own CSS/JS).
- scripts/ – DOM utilities, AEM integration helpers, experimentation scripts.
- styles/ – global styles and fonts.
- tools/ – Helix Sidekick (in-browser AEM editor) and preview helpers.
- Configuration files: fstab.yaml (mountpoint to AEM), helix-query.yaml, helix-sitemap.yaml, package.json, GitHub workflows.
- Patterns:
- Modular block-based front end (Helix Page Builder).
- Local AEM proxy for content API calls (via @adobe/aem-cli).
- CI/CD via GitHub Actions (lint, test, semantic release).

##### Extract Insights from README
- Local dev flow:
a. `fstab.yaml` configures a mountpoint for AEM content.
b. AEM CLI (`aem up`) runs a proxy at http://localhost:3000 that serves Helix pages and forwards API calls to AEM.
c. Helix Sidekick is injected into pages for in-context editing.
- Preview & Live environments are Helix-hosted endpoints (`*.hlx.page` and `*.hlx.live`).

##### Main System Components
a. Developer Workstation
b. GitHub Repository (aem-boilerplate template + this code)
c. GitHub Actions (CI/CD workflows: lint, test, release)
d. AEM Code Sync GitHub App (syncs code to AEM author instance)
e. AEM Author & Publish Instances (content repository)
f. Helix CLI / AEM Proxy (local dev server on port 3000)
g. Helix Page Builder (blocks/ + scripts/ + styles/)
h. Helix Sidekick (in-browser AEM editing tool)
i. Preview Environment (`*.hlx.page`)
j. Live Environment (`*.hlx.live`)

##### Relationships & Data Flows
- Developer pushes code → GitHub → triggers GitHub Actions → builds/test/deploy.
- AEM Code Sync App deploys code to AEM Author (JCR).
- For local dev, Helix CLI spins up a proxy:
- Serves static pages generated from blocks/ + content fetched from AEM via the mountpoint.
- Helix Sidekick scripts load into the page for authoring.
- Preview & Live: static assets and dynamic GraphQL queries (defined in helix-query.yaml) are executed by Helix Runtime at request time.

##### Architectural Patterns & Design Principles
- Modular, component-based front end (each block is self-contained).
- Clear separation of concerns: UI (blocks + styles), data (AEM), orchestration (Helix CLI/Runtime).
- Infrastructure as code: all mountpoints, queries, and sitemap configs are in YAML.
- CI/CD via GitHub Actions ensures code quality and automated releases.

##### Essential Elements
- Notes on key config files (fstab.yaml, helix-query.yaml, helix-sitemap.yaml).

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Developer Tools" 
        Dev("Developer Workstation"):::devtools
        CLI("Helix CLI"):::devtools
        Dev -->|"uses"| CLI
        click Dev "https://github.com/arunpatidar02/aem-helix-1/blob/main/fstab.yaml"
        click CLI "https://github.com/arunpatidar02/aem-helix-1/blob/main/scripts/aem.js"
    end

    subgraph "UI Library" 
        Blocks("Blocks Library"):::ui
        Styles("Global Styles & Fonts"):::ui
        DOMUtils("DOM Utilities & Helpers"):::ui
        Experiments("Experimentation Scripts"):::ui
        click Blocks "https://github.com/arunpatidar02/aem-helix-1/tree/main/blocks/"
        click Styles "https://github.com/arunpatidar02/aem-helix-1/tree/main/styles/"
        click DOMUtils "https://github.com/arunpatidar02/aem-helix-1/blob/main/scripts/DOMUtils.js"
        click DOMUtils "https://github.com/arunpatidar02/aem-helix-1/blob/main/scripts/utils.js"
        click DOMUtils "https://github.com/arunpatidar02/aem-helix-1/blob/main/scripts/scripts.js"
        click Experiments "https://github.com/arunpatidar02/aem-helix-1/tree/main/scripts/experimentation/"
    end

    subgraph "In-Browser Tools"
        Sidekick("Helix Sidekick"):::devtools
        Plugins("Sidekick Plugins"):::devtools
        PreviewUI("Preview Helpers"):::devtools
        click Sidekick "https://github.com/arunpatidar02/aem-helix-1/tree/main/tools/sidekick/"
        click Plugins "https://github.com/arunpatidar02/aem-helix-1/tree/main/tools/sidekick/plugins/"
        click PreviewUI "https://github.com/arunpatidar02/aem-helix-1/tree/main/tools/preview/"
    end

    subgraph "Source Control & CI/CD"
        GitHub("GitHub Repository"):::control
        Actions("GitHub Actions"):::control
        Release("Semantic Release Config"):::control
        Lint("Linting Configs"):::control
        Workflow1("run-tests.yaml"):::control
        Workflow2("cleanup-on-create.yaml"):::control
        Workflow3("semantic-release.yaml"):::control
        click GitHub "https://github.com/arunpatidar02/aem-helix-1/blob/main/.github/workflows/run-tests.yaml"
        click GitHub "https://github.com/arunpatidar02/aem-helix-1/blob/main/.github/workflows/cleanup-on-create.yaml"
        click GitHub "https://github.com/arunpatidar02/aem-helix-1/blob/main/.github/workflows/semantic-release.yaml"
        click Release "https://github.com/arunpatidar02/aem-helix-1/blob/main/.releaserc.cjs"
        click Lint "https://github.com/arunpatidar02/aem-helix-1/blob/main/.eslintrc.js"
        click Lint "https://github.com/arunpatidar02/aem-helix-1/blob/main/.stylelintrc.json"

        Dev -->|"push code"| GitHub
        GitHub -->|"triggers"| Actions
        Actions -->|"runs lint/tests/release"| Release
        Actions -->|"uses workflows"| Workflow1
        Actions -->|"uses workflows"| Workflow2
        Actions -->|"uses workflows"| Workflow3
    end

    subgraph "AEM Instances"
        Author("AEM Author Instance"):::aem
        Publish("AEM Publish Instance"):::aem
    end

    subgraph "Helix Runtime Environments"
        Preview("Preview Environment (*.hlx.page)"):::runtime
        Live("Live Environment (*.hlx.live)"):::runtime
        click Preview "https://github.com/arunpatidar02/aem-helix-1/blob/main/helix-query.yaml"
        click Preview "https://github.com/arunpatidar02/aem-helix-1/blob/main/helix-sitemap.yaml"
    end

    Dev -->|"local dev via proxy"| Author
    CLI -->|"AEM mountpoint"| Author
    click Author "https://github.com/arunpatidar02/aem-helix-1/blob/main/fstab.yaml"
    Author -->|"content store (JCR)"| CLI

    Blocks --> CLI
    Styles --> CLI
    DOMUtils --> CLI
    Experiments --> CLI
    Sidekick --> CLI
    PreviewUI --> CLI

    Preview -->|"serves pages, runs GraphQL"| Publish
    Live -->|"serves pages, runs GraphQL"| Publish
    click Preview "https://github.com/arunpatidar02/aem-helix-1/blob/main/helix-query.yaml"
    click Preview "https://github.com/arunpatidar02/aem-helix-1/blob/main/helix-sitemap.yaml"

    Browser("End-User Browser"):::external
    Browser -->|"HTTPS request"| Preview
    Browser -->|"HTTPS request"| Live

    classDef devtools fill:#e6f7ff,stroke:#333,stroke-width:1px
    classDef ui fill:#fff0f5,stroke:#333,stroke-width:1px
    classDef control fill:#f0f8ff,stroke:#333,stroke-width:1px
    classDef aem fill:#fff2cc,stroke:#333,stroke-width:1px
    classDef runtime fill:#e0ffe0,stroke:#333,stroke-width:1px
    classDef external fill:#dddddd,stroke:#333,stroke-width:1px
```
