# fluidtypo3/vhs architecture

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

- Interactive diagram: https://gitdiagram.com/fluidtypo3/vhs
- Repository: https://github.com/fluidtypo3/vhs

## Overview

##### Main Components

a. Core Components:
- ViewHelpers (Primary Component)
- Services
- Middleware
- Utilities
- Events

b. Integration Points:
- TYPO3 Core
- Fluid Template Engine
- Frontend/Backend Contexts
- Asset Pipeline

**┌─ TYPO3 CMS ──────────────────────────────────┐**

- ┌─ VHS Extension ─────────────────────────┐ │

- ┌─ Middleware Layer ─┐                 │ │
- AssetInclusion  │                 │ │
- RequestAvail.   │                 │ │
- ┘                 │ │

- ┌─ ViewHelper Categories ────────────┐ │ │
- Asset     - Iterator    - Page   │ │ │
- Content   - Math       - Media   │ │ │
- Format    - Resource   - System  │ │ │
- Security  - Variable   - Uri     │ │ │
- ┘ │ │

- ┌─ Services ──────┐  ┌─ Utilities ──┐ │ │
- AssetService  │  │ - Context    │ │ │
- PageService   │  │ - Core       │ │ │
- ┘  │ - Resource   │ │ │
- ┘ │ │
- ┘ │
- ┘

##### Important Relationships

- ViewHelpers inherit from TYPO3 Fluid base classes
- Middleware integrates with TYPO3's request handling
- Services support ViewHelpers and provide shared functionality
- Utilities provide support functions across all layers

##### Additional Elements

- Version compatibility information (TYPO3 10-12)
- Asset handling flow
- Caching integration points
- Extension configuration points

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph TYPO3["TYPO3 CMS"]
        subgraph VHS["VHS Extension"]
            subgraph Middleware["Middleware Layer"]
                AssetInc["Asset Inclusion"]:::middleware
                ReqAvail["Request Availability"]:::middleware
            end

            subgraph ViewHelpers["ViewHelper Categories"]
                Asset["Asset"]:::viewhelper
                Content["Content"]:::viewhelper
                Format["Format"]:::viewhelper
                Math["Math"]:::viewhelper
                Media["Media"]:::viewhelper
                Page["Page"]:::viewhelper
                Security["Security"]:::viewhelper
                System["System"]:::viewhelper
                Variable["Variable"]:::viewhelper
            end

            subgraph Services["Services Layer"]
                AssetService["Asset Service"]:::service
                PageService["Page Service"]:::service
            end

            subgraph Utilities["Utilities Layer"]
                ContextUtil["Context Utility"]:::utility
                CoreUtil["Core Utility"]:::utility
                ResourceUtil["Resource Utility"]:::utility
            end

            Events["Cache Event Listener"]:::event
        end

        FluidEngine["Fluid Template Engine"]:::core
        AssetPipeline["Asset Pipeline"]:::core
    end

    %% Relationships
    FluidEngine --> ViewHelpers
    AssetPipeline --> AssetService
    AssetService --> Asset
    PageService --> Page
    AssetInc --> AssetService
    ReqAvail --> ContextUtil
    Events --> FluidEngine

    %% Click Events
    click Asset "https://github.com/FluidTYPO3/vhs/tree/development/Classes/ViewHelpers/Asset/"
    click Content "https://github.com/FluidTYPO3/vhs/tree/development/Classes/ViewHelpers/Content/"
    click Format "https://github.com/FluidTYPO3/vhs/tree/development/Classes/ViewHelpers/Format/"
    click Math "https://github.com/FluidTYPO3/vhs/tree/development/Classes/ViewHelpers/Math/"
    click Media "https://github.com/FluidTYPO3/vhs/tree/development/Classes/ViewHelpers/Media/"
    click Page "https://github.com/FluidTYPO3/vhs/tree/development/Classes/ViewHelpers/Page/"
    click Security "https://github.com/FluidTYPO3/vhs/tree/development/Classes/ViewHelpers/Security/"
    click System "https://github.com/FluidTYPO3/vhs/tree/development/Classes/ViewHelpers/System/"
    click Variable "https://github.com/FluidTYPO3/vhs/tree/development/Classes/ViewHelpers/Variable/"
    click AssetService "https://github.com/FluidTYPO3/vhs/blob/development/Classes/Service/AssetService.php"
    click PageService "https://github.com/FluidTYPO3/vhs/blob/development/Classes/Service/PageService.php"
    click AssetInc "https://github.com/FluidTYPO3/vhs/blob/development/Classes/Middleware/AssetInclusion.php"
    click ReqAvail "https://github.com/FluidTYPO3/vhs/blob/development/Classes/Middleware/RequestAvailability.php"
    click ContextUtil "https://github.com/FluidTYPO3/vhs/blob/development/Classes/Utility/ContextUtility.php"
    click CoreUtil "https://github.com/FluidTYPO3/vhs/blob/development/Classes/Utility/CoreUtility.php"
    click ResourceUtil "https://github.com/FluidTYPO3/vhs/blob/development/Classes/Utility/ResourceUtility.php"
    click Events "https://github.com/FluidTYPO3/vhs/blob/development/Classes/Events/AfterCacheableContentIsGeneratedEventListener.php"

    %% Styling
    classDef core fill:#4a90e2,stroke:#2c3e50,color:white
    classDef viewhelper fill:#2ecc71,stroke:#27ae60,color:white
    classDef service fill:#e67e22,stroke:#d35400,color:white
    classDef middleware fill:#f1c40f,stroke:#f39c12,color:black
    classDef utility fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef event fill:#9b59b6,stroke:#8e44ad,color:white

    %% Legend
    subgraph Legend
        CoreL["TYPO3 Core"]:::core
        ViewHelperL["ViewHelper"]:::viewhelper
        ServiceL["Service"]:::service
        MiddlewareL["Middleware"]:::middleware
        UtilityL["Utility"]:::utility
        EventL["Event"]:::event
    end
```
