# gjohnhazel/zendesk_custom_theme architecture

> Architecture diagram of the GitHub repository gjohnhazel/zendesk_custom_theme, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gjohnhazel/zendesk_custom_theme
- Repository: https://github.com/gjohnhazel/zendesk_custom_theme

## Overview

##### Main Components

a. Frontend Architecture:
- Theme Core Components
- Templates Layer (Handlebars templates)
- Styling Layer (SCSS modules)
- JavaScript Core (Vanilla JS modules)
- React Components Layer
- Asset Management System
- Internationalization System
- Build System

b. Integration Points:
- Zendesk Guide Platform
- Zendesk Theming API
- Translation System
- Preview System

- Presentation Layer           |

- Templates   | |  React Components| |
- (Handlebars)   | |  (Garden UI)    | |

- Core Services Layer          |

- I18n Service  | |  Asset Manager   | |

- Theme Config  | |  Build Pipeline  | |

- Integration Layer               |

- Zendesk Guide  | |  Preview System  | |

##### Component Relationships

- Data flow between components
- Dependencies
- Build process flow
- Asset loading paths

##### Key Elements to Highlight

a. Module System:
- How the import map works
- Bundle generation flow
- Asset resolution system

b. React Integration:
- Garden UI components
- Module bundling
- Theme integration points

c. Internationalization:
- Translation flow
- String extraction
- Locale management

d. Development Tooling:
- Build pipeline
- Preview system
- Accessibility testing

##### Additional Details

- File types (.hbs, .scss, .tsx, etc.)
- Build artifacts
- Configuration files
- Asset types

##### Notes for Implementation

- Keep component grouping logical and clear
- Clear separation between build-time and runtime components
- Version control and deployment paths

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Presentation Layer"
        Templates["Templates (Handlebars)"]
        ReactComponents["React Components"]
        GardenUI["Garden UI Theme"]
        StyleSystem["Styling System"]
    end

    subgraph "Core Services Layer"
        I18nService["I18n Service"]
        AssetManager["Asset Manager"]
        ThemeConfig["Theme Configuration"]
        BuildPipeline["Build Pipeline"]
        CoreJS["Core JavaScript"]
        Utils["Utility Modules"]
    end

    subgraph "Integration Layer"
        ZendeskGuide["Zendesk Guide Platform"]
        PreviewSystem["Preview System"]
        LighthouseTesting["Lighthouse Testing"]
    end

    %% Component Relationships
    Templates --> CoreJS
    ReactComponents --> GardenUI
    StyleSystem --> AssetManager
    CoreJS --> AssetManager
    I18nService --> ReactComponents
    I18nService --> Templates
    BuildPipeline --> AssetManager
    ThemeConfig --> ZendeskGuide
    AssetManager --> ZendeskGuide
    PreviewSystem --> ZendeskGuide
    LighthouseTesting --> PreviewSystem

    %% Click Events
    click Templates "https://github.com/gjohnhazel/zendesk_custom_theme/tree/master/templates"
    click StyleSystem "https://github.com/gjohnhazel/zendesk_custom_theme/tree/master/styles"
    click ReactComponents "https://github.com/gjohnhazel/zendesk_custom_theme/tree/master/src/modules/shared"
    click I18nService "https://github.com/gjohnhazel/zendesk_custom_theme/tree/master/src/modules/shared/i18n"
    click AssetManager "https://github.com/gjohnhazel/zendesk_custom_theme/tree/master/assets"
    click BuildPipeline "https://github.com/gjohnhazel/zendesk_custom_theme/blob/master/rollup.config.mjs"
    click ThemeConfig "https://github.com/gjohnhazel/zendesk_custom_theme/blob/master/manifest.json"
    click GardenUI "https://github.com/gjohnhazel/zendesk_custom_theme/tree/master/src/modules/shared/garden-theme"
    click CoreJS "https://github.com/gjohnhazel/zendesk_custom_theme/blob/master/src/index.js"
    click Utils "https://github.com/gjohnhazel/zendesk_custom_theme/blob/master/src/search.js"
    click LighthouseTesting "https://github.com/gjohnhazel/zendesk_custom_theme/tree/master/bin/lighthouse"

    %% Styling
    classDef presentation fill:#2196F3,stroke:#fff,stroke-width:2px,color:#fff
    classDef core fill:#4CAF50,stroke:#fff,stroke-width:2px,color:#fff
    classDef integration fill:#FF9800,stroke:#fff,stroke-width:2px,color:#fff

    class Templates,ReactComponents,GardenUI,StyleSystem presentation
    class I18nService,AssetManager,ThemeConfig,BuildPipeline,CoreJS,Utils core
    class ZendeskGuide,PreviewSystem,LighthouseTesting integration

    %% Legend
    subgraph Legend
        PresentationLayer["Presentation Components"]:::presentation
        CoreLayer["Core Services"]:::core
        IntegrationLayer["Integration Points"]:::integration
    end
```
