# rabbibotton/clog architecture

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

- Interactive diagram: https://gitdiagram.com/rabbibotton/clog
- Repository: https://github.com/rabbibotton/clog

## Overview

##### Project Type and Core Architecture
CLOG is a full-stack GUI framework that uses web technologies to create graphical user interfaces. The system should be represented as a client-server architecture with these main components:

##### Main Components

a. Server-Side Components:
- Core CLOG Engine
- Connection Manager (websockets)
- Event Handler System
- DOM Manipulation Interface
- State Management

b. High-Level Extensions:
- CLOG-GUI (Desktop Applications)
- CLOG-Web (Web Applications)
- CLOG-Web-Site (Website Framework)
- Authentication System
- Database Integration Layer

c. Client-Side Components:
- Browser Runtime
- WebSocket Client
- Static Resources
- JavaScript Bridge
- DOM Interface

##### Component Relationships

**[Client Browser] <--WebSocket--> [CLOG Connection Manager]**

- [Event System]    [DOM Interface]    [State Manager]

- [High-Level Extensions]

- [Database Layer]

##### Specific Implementation Details

Key architectural elements:
- Parallel nature of the GUI system
- Event-driven architecture
- Demonstrate the component hierarchy
- Template system
- Builder tools integration

##### Important Relationships to Highlight

- WebSocket communication between client and server
- Event propagation paths
- Component inheritance structure
- Database interaction flows
- Template system integration

##### Implementation Notes

- The separation between client and server
- The real-time nature of the communication
- The component-based architecture
- The extensibility points
- The integration with web technologies

##### Key Technical Details

Specific elements:
- WebSocket protocol for real-time communication
- Browser rendering engine integration
- Common Lisp runtime environment
- Database connectivity options
- Static file serving mechanism

##### Architectural Patterns

Patterns:
- Event-driven architecture
- Component-based design
- MVC pattern in GUI components
- Plugin system architecture
- Template-based generation

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Client["Client Layer"]
        Browser["Browser Runtime"]:::client
        WSClient["WebSocket Client"]:::client
        Static["Static Resources"]:::client
        JSBridge["JavaScript Bridge"]:::client
        DOMClient["DOM Interface"]:::client
        
        Browser --- WSClient
        Browser --- Static
        Browser --- JSBridge
        Browser --- DOMClient
    end

    subgraph Core["Core CLOG Engine"]
        ConnMgr["Connection Manager"]:::core
        EventSys["Event Handler System"]:::core
        DOMInterface["DOM Manipulation Interface"]:::core
        StateMgr["State Management"]:::core
        SysBase["System Base"]:::core
        
        ConnMgr --- EventSys
        EventSys --- DOMInterface
        DOMInterface --- StateMgr
        StateMgr --- SysBase
    end

    subgraph Extensions["High-Level Extensions"]
        GUI["CLOG-GUI"]:::ext
        Web["CLOG-Web"]:::ext
        WebSite["CLOG-Web-Site"]:::ext
        Auth["Authentication System"]:::ext
        DB["Database Integration"]:::ext
    end

    subgraph Components["Component System"]
        Forms["Form Handling"]:::comp
        Style["Style Management"]:::comp
        Window["Window Management"]:::comp
        jQuery["jQuery Integration"]:::comp
        WebGL["WebGL Support"]:::comp
        Media["Multimedia Handling"]:::comp
        Nav["Navigation System"]:::comp
        Doc["Document Interface"]:::comp
        Templates["Template System"]:::comp
    end

    WSClient <--> ConnMgr
    Core --> Extensions
    Core --> Components
    
    %% Click events for component mapping
    click ConnMgr "https://github.com/rabbibotton/clog/blob/main/source/clog-connection-websockets.lisp"
    click DOMInterface "https://github.com/rabbibotton/clog/blob/main/source/clog-element.lisp"
    click JSBridge "https://github.com/rabbibotton/clog/blob/main/static-files/js/boot.js"
    click Auth "https://github.com/rabbibotton/clog/blob/main/source/clog-auth.lisp"
    click DB "https://github.com/rabbibotton/clog/blob/main/source/clog-dbi.lisp"
    click GUI "https://github.com/rabbibotton/clog/blob/main/source/clog-gui.lisp"
    click Web "https://github.com/rabbibotton/clog/blob/main/source/clog-web.lisp"
    click Static "https://github.com/rabbibotton/clog/tree/main/static-files"
    click Doc "https://github.com/rabbibotton/clog/blob/main/source/clog-document.lisp"
    click Forms "https://github.com/rabbibotton/clog/blob/main/source/clog-form.lisp"
    click Style "https://github.com/rabbibotton/clog/blob/main/source/clog-style.lisp"
    click Window "https://github.com/rabbibotton/clog/blob/main/source/clog-window.lisp"
    click SysBase "https://github.com/rabbibotton/clog/blob/main/source/clog-base.lisp"
    click Browser "https://github.com/rabbibotton/clog/blob/main/static-files/boot.html"
    click jQuery "https://github.com/rabbibotton/clog/blob/main/source/clog-jquery.lisp"
    click WebGL "https://github.com/rabbibotton/clog/blob/main/source/clog-webgl.lisp"
    click Media "https://github.com/rabbibotton/clog/blob/main/source/clog-multimedia.lisp"
    click Nav "https://github.com/rabbibotton/clog/blob/main/source/clog-navigator.lisp"
    click Templates "https://github.com/rabbibotton/clog/tree/main/templates"
    click Core "https://github.com/rabbibotton/clog/blob/main/source/clog.lisp"

    %% Styling
    classDef core fill:#2196F3,stroke:#1565C0,color:white
    classDef client fill:#4CAF50,stroke:#2E7D32,color:white
    classDef ext fill:#FF9800,stroke:#EF6C00,color:white
    classDef comp fill:#9C27B0,stroke:#6A1B9A,color:white

    %% Legend
    subgraph Legend
        L1["Core Components"]:::core
        L2["Client Components"]:::client
        L3["Extensions"]:::ext
        L4["System Components"]:::comp
    end
```
