# twostraws/ignite architecture

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

- Interactive diagram: https://gitdiagram.com/twostraws/ignite
- Repository: https://github.com/twostraws/ignite

## Overview

##### Main Components Identification
The system should be divided into these primary components:

a) Core Framework Layer
- Elements System
- Rendering Engine
- Animation System
- Publishing System
- Theme Management
- Resource Management

b) CLI Application Layer
- Command Interface
- Build System
- Preview Server

**┌─ CLI Layer ─────────────────────────────────────────────┐**

- ┌─ Commands ─────┐    ┌─ Preview ────┐                │
- Build        │    │ Local Server  │                │
- New          │◄───│ Hot Reload    │                │
- Run          │    └──────────────┘                │
- ┘                                     │

- ┬───────────────────────────────┘

**┌─ Core Framework ────────┼───────────────────────────────┐**
- ▼                               │
- ┌─ Elements ──────┐  ┌─ Publishing ─────┐             │
- Components      │  │ Site Generator    │             │
- HTML Elements   │◄─┤ Feed Generator    │             │
- Modifiers       │  │ Sitemap Generator │             │
- ┘  └─────────────────┬─┘             │

- ┌─ Rendering ─────┐  ┌─ Resources ────┼─┐             │
- HTML Generation │  │ CSS            │ │             │
- Markdown Parser │◄─┤ JavaScript     │ │             │
- Layout Engine   │  │ Fonts          │ │             │
- ┘  └───────────────┬┘ │             │

- ┌─ Theming ───────┐  ┌─ Animation ─┼───┤             │
- Light/Dark      │  │ Transitions  │   │             │
- Custom Themes   │◄─┤ Keyframes    │   │             │
- Style System    │  │ Effects      │   │             │
- ┘  └──────────────┘   │             │

- ┘             │
- ▼                              │
**┌─ Output ──────────────────────────────────────────────┤**
- Static Website Files                                  │
- HTML                                               │
- CSS                                                │
- JavaScript                                         │
- Assets                                             │
- ┘

##### Key Relationships to Highlight

a) Data Flow:
- How content flows from Swift code through the rendering engine
- How resources are bundled
- Build process flow

b) Component Dependencies:
- Elements → Rendering Engine
- Themes → Elements
- Publishing → All Components

##### Important Implementation Details

- SwiftUI-like syntax implementation
- Markdown processing capabilities
- Theme system flexibility
- Resource management
- Build process optimization

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles
    classDef cli fill:#e1f5fe,stroke:#01579b
    classDef core fill:#e8f5e9,stroke:#1b5e20
    classDef elements fill:#fff3e0,stroke:#e65100
    classDef publishing fill:#f3e5f5,stroke:#4a148c
    classDef output fill:#f5f5f5,stroke:#212121
    classDef preview fill:#e3f2fd,stroke:#0d47a1

    %% CLI Layer
    subgraph CLI
        CLI_APP[CLI Application]
        BUILD[Build System]
        PREVIEW[Preview Server]
        CLI_APP --> BUILD
        CLI_APP --> PREVIEW
    end

    %% Core Framework Layer
    subgraph CoreFramework
        %% Elements Subsystem
        subgraph Elements
            ELEM_SYS[Elements System]
            HTML_ELEM[HTML Elements]
            MODIFIERS[Modifiers]
            ELEM_SYS --> HTML_ELEM
            ELEM_SYS --> MODIFIERS
        end

        %% Rendering Subsystem
        subgraph Rendering
            RENDER_ENG[Rendering Engine]
            HTML_GEN[HTML Generation]
            MD_PARSE[Markdown Parser]
            LAYOUT[Layout Engine]
            RENDER_ENG --> HTML_GEN
            RENDER_ENG --> MD_PARSE
            RENDER_ENG --> LAYOUT
        end

        %% Publishing Subsystem
        subgraph Publishing
            PUB_SYS[Publishing System]
            SITE_GEN[Site Generator]
            FEED_GEN[Feed Generator]
            MAP_GEN[Sitemap Generator]
            PUB_SYS --> SITE_GEN
            PUB_SYS --> FEED_GEN
            PUB_SYS --> MAP_GEN
        end

        %% Theme Management
        subgraph Themes
            THEME_MGT[Theme Management]
            LIGHT_DARK[Light/Dark Modes]
            CUSTOM[Custom Themes]
            THEME_MGT --> LIGHT_DARK
            THEME_MGT --> CUSTOM
        end

        %% Resource Management
        subgraph Resources
            RES_MGT[Resource Management]
            CSS[CSS]
            JS[JavaScript]
            FONTS[Fonts]
            RES_MGT --> CSS
            RES_MGT --> JS
            RES_MGT --> FONTS
        end

        %% Animation System
        subgraph Animations
            ANIM_SYS[Animation System]
            TRANS[Transitions]
            EFFECTS[Effects]
            ANIM_SYS --> TRANS
            ANIM_SYS --> EFFECTS
        end
    end

    %% Output Layer
    subgraph Output
        STATIC[Static Website Files]
        HTML_OUT[HTML]
        CSS_OUT[CSS]
        JS_OUT[JavaScript]
        ASSETS[Assets]
        STATIC --> HTML_OUT
        STATIC --> CSS_OUT
        STATIC --> JS_OUT
        STATIC --> ASSETS
    end

    %% Relationships
    CLI --> CoreFramework
    Elements --> Rendering
    Rendering --> Publishing
    Publishing --> Output
    Resources --> Output
    Themes --> Elements
    Animations --> Elements

    %% Click Events
    click ELEM_SYS "https://github.com/twostraws/Ignite/tree/main/Sources/Ignite/Elements/"
    click RENDER_ENG "https://github.com/twostraws/Ignite/tree/main/Sources/Ignite/Rendering/"
    click ANIM_SYS "https://github.com/twostraws/Ignite/tree/main/Sources/Ignite/Framework/Animations/"
    click PUB_SYS "https://github.com/twostraws/Ignite/tree/main/Sources/Ignite/Publishing/"
    click THEME_MGT "https://github.com/twostraws/Ignite/tree/main/Sources/Ignite/Themes/"
    click RES_MGT "https://github.com/twostraws/Ignite/tree/main/Sources/Ignite/Resources/"
    click CLI_APP "https://github.com/twostraws/Ignite/tree/main/Sources/IgniteCLI/"
    click BUILD "https://github.com/twostraws/Ignite/blob/main/Sources/IgniteCLI/BuildCommand.swift"
    click PREVIEW "https://github.com/twostraws/Ignite/blob/main/Sources/IgniteCLI/RunCommand.swift"
    click HTML_GEN "https://github.com/twostraws/Ignite/blob/main/Sources/Ignite/Framework/ElementTypes/HTML.swift"
    click MD_PARSE "https://github.com/twostraws/Ignite/blob/main/Sources/Ignite/Rendering/Markdown/MarkdownRenderer.swift"
    click SITE_GEN "https://github.com/twostraws/Ignite/blob/main/Sources/Ignite/Publishing/PublishingContext.swift"
    click FEED_GEN "https://github.com/twostraws/Ignite/blob/main/Sources/Ignite/Publishing/FeedGenerator.swift"
    click MAP_GEN "https://github.com/twostraws/Ignite/blob/main/Sources/Ignite/Publishing/SiteMapGenerator.swift"

    %% Style Applications
    class CLI_APP,BUILD,PREVIEW cli
    class ELEM_SYS,HTML_ELEM,MODIFIERS elements
    class RENDER_ENG,HTML_GEN,MD_PARSE,LAYOUT core
    class PUB_SYS,SITE_GEN,FEED_GEN,MAP_GEN publishing
    class STATIC,HTML_OUT,CSS_OUT,JS_OUT,ASSETS output
```
