# eighteen73/pulsar architecture

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

- Interactive diagram: https://gitdiagram.com/eighteen73/pulsar
- Repository: https://github.com/eighteen73/pulsar

## Overview

##### Project type and purpose
- This is a WordPress “block theme” starter project called Pulsar. Its purpose is to provide a modern development workflow for building and delivering a custom WordPress theme that uses the block editor, theme.json, custom blocks, patterns, template parts, and asset pipelines (JS/CSS).

##### File structure
- Top-level theme files: style.css (theme header), functions.php, theme.json.
- Config folder: block and pattern configuration for the block editor.
- includes/: PHP classes and bootsrap (autoload.php, Setup, Enqueue, Editor, Tools, ThirdParty integrations).
- parts/ & template-parts/: static HTML/PHP fragments (header, footer, etc.).
- patterns/: predefined block patterns and 404 template.
- src/: source assets
- src/js: application JS, block filters/styles/variations, editor plugins.
- src/css: Sass partials organized by settings/elements/generic/components, etc.
- src/blocks: a custom “template-part” block with block.json, edit.js, index.js, render.php.
- Build and config: package.json, webpack.config.js, babel.config.json, postcss.config.js.
- Playground and demo support under .playground/.

##### README for additional insights
- Confirms it’s a WordPress >=6.6 theme requiring PHP >=7.4 and Node >=16.
- Describes npm build commands: start a dev watch (with Browsersync) and production build.

##### Elements
- Dev Tools / Build System
- Source Assets
- Compiled Assets
- Theme PHP (includes, template-parts, patterns)
- WordPress Core & Database
- Browser / Client
- External Integrations
- From Source Assets → Dev Tools → Compiled Assets
- From Compiled Assets + Theme PHP → WordPress Core
- From WordPress Core + Database → Browser
- Any callbacks or hook integrations (e.g., Block Editor → Theme Editor classes)
- Another for theme source & runtime PHP
- Another for WordPress Core & DB
- Another for external integrations

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Dev Tools / Build System
    subgraph "Developer Workstation & Build System"
        direction TB
        DevTools["Developer Workstation & Build System"]:::build
        pkg["package.json"]:::build
        wpcfg["webpack.config.js"]:::build
        babelcfg["babel.config.json"]:::build
        postcsscfg["postcss.config.js"]:::build
    end

    %% Theme Configuration
    subgraph "Theme Configuration"
        direction TB
        themejson["theme.json"]:::source
        configDir["config/"]:::source
        configThemeJson["config/theme-json/"]:::source
    end

    %% Theme PHP Entry Points
    subgraph "PHP Theme Entry Points"
        direction TB
        funcs["functions.php"]:::php
        themeEntry["includes/theme.php"]:::php
    end

    %% PHP Classes Layer
    subgraph "PHP Classes (Theme PHP Layer)"
        direction TB
        autoload["includes/autoload.php"]:::php
        setupCls["includes/classes/Setup.php"]:::php
        enqueueCls["includes/classes/Enqueue.php"]:::php
        blocksCls["includes/classes/Editor/Blocks.php"]:::php
        patternsCls["includes/classes/Editor/Patterns.php"]:::php
        tplPartsCls["includes/classes/Editor/TemplateParts.php"]:::php
        renderNav["includes/classes/Editor/Render/Navigation.php"]:::php
        toolAsset["includes/classes/Tools/Asset.php"]:::php
        toolAttr["includes/classes/Tools/Attribute.php"]:::php
        toolConfig["includes/classes/Tools/Config.php"]:::php
        toolSvg["includes/classes/Tools/Svg.php"]:::php
        gfInt["includes/classes/ThirdParty/GravityForms.php"]:::php
        tplTags["includes/template-tags/"]:::php
    end

    %% Theme Presentation
    subgraph "Theme Presentation – Templates & Parts"
        direction TB
        partHdr["parts/header.html"]:::php
        partFtr["parts/footer.html"]:::php
        tplHdrLogo["template-parts/header/logo.php"]:::php
        tplFtrCopy["template-parts/footer/copyright.php"]:::php
        pat404["patterns/404.php"]:::php
        templatesDir["templates/"]:::php
    end

    %% Source Assets
    subgraph "Source Assets – Uncompiled"
        direction TB
        jsApp["src/js/app.js"]:::source
        jsFilters["src/js/block-filters/"]:::source
        jsStyles["src/js/block-styles/"]:::source
        jsVariations["src/js/block-variations/"]:::source
        jsEditor["src/js/editor.js"]:::source
        jsPlugins["src/js/editor-plugins/index.js"]:::source
        jsFormat["src/js/format-library/index.js"]:::source
        blkCfg["src/blocks/template-part/block.json"]:::source
        blkIndex["src/blocks/template-part/index.js"]:::source
        blkEdit["src/blocks/template-part/edit.js"]:::source
        blkRender["src/blocks/template-part/render.php"]:::source
        scssApp["src/css/app.scss"]:::source
        scssDirs["src/css/"]:::source
    end

    %% Build Output
    subgraph "Build Output – Compiled Assets"
        direction TB
        assetsDir["assets/"]:::source
        cssOut["assets/css/*.css"]:::source
        jsOut["assets/js/*.js"]:::source
    end

    %% WordPress Core & Database
    subgraph "WordPress Core & Database"
        direction TB
        WPCore["WordPress Core & Block Editor"]:::core
        WPDB["MySQL Database"]:::core
    end

    %% Browser Client
    Browser["Browser Client"]:::external

    %% External Integrations
    GF["Gravity Forms Integration"]:::external

    %% Connections
    jsApp -->|watched by| DevTools
    jsFilters -->|watched by| DevTools
    jsStyles -->|watched by| DevTools
    jsVariations -->|watched by| DevTools
    jsEditor -->|watched by| DevTools
    jsPlugins -->|watched by| DevTools
    jsFormat -->|watched by| DevTools
    blkCfg -->|watched by| DevTools
    blkIndex -->|watched by| DevTools
    blkEdit -->|watched by| DevTools
    blkRender -->|watched by| DevTools
    scssApp -->|watched by| DevTools
    scssDirs -->|watched by| DevTools

    DevTools -->|compiles assets to| assetsDir
    assetsDir --> cssOut
    assetsDir --> jsOut

    cssOut -->|enqueued by| enqueueCls
    jsOut -->|enqueued by| enqueueCls

    themejson -->|provides settings to| WPCore
    configDir -->|provides configs to| WPCore
    configThemeJson -->|provides configs to| WPCore

    funcs -->|bootstraps theme into| WPCore
    themeEntry -->|initializes includes| funcs

    autoload -->|loads classes| funcs
    setupCls -->|hooks into| funcs
    enqueueCls -->|hooks into| funcs
    blocksCls -->|registers blocks| WPCore
    patternsCls -->|registers patterns| WPCore
    tplPartsCls -->|registers template parts| WPCore
    renderNav -->|handles rendering| WPCore
    toolAsset -->|utility for assets| enqueueCls
    toolAttr -->|utility for attributes| blocksCls
    toolConfig -->|utility for config| setupCls
    toolSvg -->|utility for svg| setupCls
    gfInt -->|integrates with| blocksCls
    tplTags -->|template tags avail to| funcs

    partHdr -->|used in| WPCore
    partFtr -->|used in| WPCore
    tplHdrLogo -->|used in| WPCore
    tplFtrCopy -->|used in| WPCore
    pat404 -->|used in| WPCore
    templatesDir -->|theme templates| WPCore

    WPCore -->|queries| WPDB
    WPCore -->|serves HTML/CSS/JS to| Browser
    Browser -->|interacts with| WPCore

    GF -->|hooks into| gfInt

    %% Click Events
    click pkg "https://github.com/eighteen73/pulsar/blob/main/package.json"
    click wpcfg "https://github.com/eighteen73/pulsar/blob/main/webpack.config.js"
    click babelcfg "https://github.com/eighteen73/pulsar/blob/main/babel.config.json"
    click postcsscfg "https://github.com/eighteen73/pulsar/blob/main/postcss.config.js"
    click themejson "https://github.com/eighteen73/pulsar/blob/main/theme.json"
    click configDir "https://github.com/eighteen73/pulsar/tree/main/config/"
    click configThemeJson "https://github.com/eighteen73/pulsar/tree/main/config/theme-json/"
    click funcs "https://github.com/eighteen73/pulsar/blob/main/functions.php"
    click themeEntry "https://github.com/eighteen73/pulsar/blob/main/includes/theme.php"
    click autoload "https://github.com/eighteen73/pulsar/blob/main/includes/autoload.php"
    click setupCls "https://github.com/eighteen73/pulsar/blob/main/includes/classes/Setup.php"
    click enqueueCls "https://github.com/eighteen73/pulsar/blob/main/includes/classes/Enqueue.php"
    click blocksCls "https://github.com/eighteen73/pulsar/blob/main/includes/classes/Editor/Blocks.php"
    click patternsCls "https://github.com/eighteen73/pulsar/blob/main/includes/classes/Editor/Patterns.php"
    click tplPartsCls "https://github.com/eighteen73/pulsar/blob/main/includes/classes/Editor/TemplateParts.php"
    click renderNav "https://github.com/eighteen73/pulsar/blob/main/includes/classes/Editor/Render/Navigation.php"
    click toolAsset "https://github.com/eighteen73/pulsar/blob/main/includes/classes/Tools/Asset.php"
    click toolAttr "https://github.com/eighteen73/pulsar/blob/main/includes/classes/Tools/Attribute.php"
    click toolConfig "https://github.com/eighteen73/pulsar/blob/main/includes/classes/Tools/Config.php"
    click toolSvg "https://github.com/eighteen73/pulsar/blob/main/includes/classes/Tools/Svg.php"
    click gfInt "https://github.com/eighteen73/pulsar/blob/main/includes/classes/ThirdParty/GravityForms.php"
    click tplTags "https://github.com/eighteen73/pulsar/tree/main/includes/template-tags/"
    click partHdr "https://github.com/eighteen73/pulsar/blob/main/parts/header.html"
    click partFtr "https://github.com/eighteen73/pulsar/blob/main/parts/footer.html"
    click tplHdrLogo "https://github.com/eighteen73/pulsar/blob/main/template-parts/header/logo.php"
    click tplFtrCopy "https://github.com/eighteen73/pulsar/blob/main/template-parts/footer/copyright.php"
    click pat404 "https://github.com/eighteen73/pulsar/blob/main/patterns/404.php"
    click templatesDir "https://github.com/eighteen73/pulsar/tree/main/templates/"
    click jsApp "https://github.com/eighteen73/pulsar/blob/main/src/js/app.js"
    click jsFilters "https://github.com/eighteen73/pulsar/tree/main/src/js/block-filters/"
    click jsStyles "https://github.com/eighteen73/pulsar/tree/main/src/js/block-styles/"
    click jsVariations "https://github.com/eighteen73/pulsar/tree/main/src/js/block-variations/"
    click jsEditor "https://github.com/eighteen73/pulsar/blob/main/src/js/editor.js"
    click jsPlugins "https://github.com/eighteen73/pulsar/blob/main/src/js/editor-plugins/index.js"
    click jsFormat "https://github.com/eighteen73/pulsar/blob/main/src/js/format-library/index.js"
    click blkCfg "https://github.com/eighteen73/pulsar/blob/main/src/blocks/template-part/block.json"
    click blkIndex "https://github.com/eighteen73/pulsar/blob/main/src/blocks/template-part/index.js"
    click blkEdit "https://github.com/eighteen73/pulsar/blob/main/src/blocks/template-part/edit.js"
    click blkRender "https://github.com/eighteen73/pulsar/blob/main/src/blocks/template-part/render.php"
    click scssApp "https://github.com/eighteen73/pulsar/blob/main/src/css/app.scss"
    click scssDirs "https://github.com/eighteen73/pulsar/tree/main/src/css/"
    click assetsDir "https://github.com/eighteen73/pulsar/tree/main/assets/"
    click cssOut "https://github.com/eighteen73/pulsar/blob/main/assets/css/*.css"
    click jsOut "https://github.com/eighteen73/pulsar/blob/main/assets/js/*.js"

    %% Styles
    classDef build fill:#f9f,stroke:#333,stroke-width:1px
    classDef source fill:#afa,stroke:#333,stroke-width:1px
    classDef php fill:#aef,stroke:#333,stroke-width:1px
    classDef core fill:#fea,stroke:#333,stroke-width:1px
    classDef external fill:#eef,stroke:#333,stroke-width:1px
```
