# k0a1a/hotglue2 architecture

> Architecture diagram of the GitHub repository k0a1a/hotglue2, 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/k0a1a/hotglue2
- Repository: https://github.com/k0a1a/hotglue2

## Overview

##### Main Components Structure

a. Client-Side Layer
- Main frontend components (/js, /css directories)
- JavaScript modules (jQuery, editing interfaces)

b. Server-Side Layer
- Core PHP components (controller.inc.php, common.inc.php)
- Module system (modules.inc.php and individual modules)
- Authentication system (indicated by AUTH_METHOD in README)

c. Storage Layer
- Content storage (/content directory)
- Configuration storage (user-config.inc.php)

##### Module System Architecture
- Core module handler
- Individual module types with their relationships:
- Content modules (text, image, video, webvideo)
- Utility modules (transform, lock)
- Interface modules (page_browser, revisions_browser)

##### Request Flow
Flow of requests through:
- Apache/.htaccess routing
- Controller layer
- Module processing
- Response generation

Use these visual elements:

##### Components
- Blue rectangles: Core system components
- Green rectangles: Modules
- Yellow rectangles: Client-side components
- Gray rectangles: External services/dependencies

##### Connections
- Double lines: Data flow

##### Labels
- Component names
- Key interfaces
- Authentication points
- Cache locations

Specific Guidelines:

##### A high-level overview showing
**[Client Browser] ←→ [Web Server (Apache)] ←→ [HOTGLUE Core] ←→ [Module System]**
- ↕
- [Storage Layer]

##### Then break down the Module System
**[Module Handler]**
- ↓
**[Module Types]**
- Content Modules (text, image, video)
- Utility Modules (transform, lock)
- Interface Modules (browsers, welcome)

**URL Request → .htaccess → controller.inc.php → Module Processing → HTML Generation → Response**

Important Considerations:
- Authentication system as it's a critical component
- Caching mechanisms (mentioned in README as important)
- File upload handling (noted as having specific requirements)
- HTTPS considerations for external services (mentioned for Vimeo)
- Where configuration options affect the system

This approach will provide a comprehensive view of the system while maintaining clarity about how components interact and how data flows through the application.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        Browser["Web Browser"]
        JS["JavaScript Layer"]:::frontend
        CSS["CSS Layer"]:::frontend
        UI["UI Components"]:::frontend
    end

    subgraph Core
        Controller["Controller"]:::core
        Common["Common Functions"]:::core
        ModuleHandler["Module Handler"]:::core
        Config["Configuration"]:::core
    end

    subgraph Modules
        direction TB
        subgraph ContentModules
            Text["Text Module"]:::module
            Image["Image Module"]:::module
            Video["Video Module"]:::module
            WebVideo["WebVideo Module"]:::module
        end

        subgraph UtilityModules
            Transform["Transform Module"]:::module
            Lock["Lock Module"]:::module
        end

        subgraph InterfaceModules
            PageBrowser["Page Browser"]:::module
            RevisionsBrowser["Revisions Browser"]:::module
            Welcome["Welcome Module"]:::module
        end
    end

    subgraph Storage
        Content["Content Storage"]:::storage
        Logs["System Logs"]:::storage
    end

    Browser --> Controller
    Controller --> ModuleHandler
    ModuleHandler --> ContentModules
    ModuleHandler --> UtilityModules
    ModuleHandler --> InterfaceModules
    Controller --> Common
    Controller --> Config
    ModuleHandler --> Storage

    JS --> Browser
    CSS --> Browser
    UI --> Browser

    classDef core fill:#6495ED
    classDef module fill:#90EE90
    classDef frontend fill:#FFD700
    classDef storage fill:#A9A9A9

    click Controller "https://github.com/k0a1a/hotglue2/blob/dev/controller.inc.php"
    click Common "https://github.com/k0a1a/hotglue2/blob/dev/common.inc.php"
    click ModuleHandler "https://github.com/k0a1a/hotglue2/blob/dev/modules.inc.php"
    click Config "https://github.com/k0a1a/hotglue2/blob/dev/config.inc.php"
    click JS "https://github.com/k0a1a/hotglue2/blob/dev/js/glue.js"
    click CSS "https://github.com/k0a1a/hotglue2/blob/dev/css/main.css"
    click UI "https://github.com/k0a1a/hotglue2/blob/dev/js/jquery-1.5.2.js"
    click Text "https://github.com/k0a1a/hotglue2/tree/dev/modules/text"
    click Image "https://github.com/k0a1a/hotglue2/tree/dev/modules/image"
    click Video "https://github.com/k0a1a/hotglue2/tree/dev/modules/video"
    click WebVideo "https://github.com/k0a1a/hotglue2/tree/dev/modules/webvideo"
    click Transform "https://github.com/k0a1a/hotglue2/tree/dev/modules/transform"
    click Lock "https://github.com/k0a1a/hotglue2/tree/dev/modules/lock"
    click PageBrowser "https://github.com/k0a1a/hotglue2/tree/dev/modules/page_browser"
    click RevisionsBrowser "https://github.com/k0a1a/hotglue2/tree/dev/modules/revisions_browser"
    click Welcome "https://github.com/k0a1a/hotglue2/tree/dev/modules/welcome"
    click Content "https://github.com/k0a1a/hotglue2/tree/dev/content"
    click Logs "https://github.com/k0a1a/hotglue2/blob/dev/content/log.txt"
```
