# needlworks/textcube architecture

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

- Interactive diagram: https://gitdiagram.com/needlworks/textcube
- Repository: https://github.com/needlworks/textcube

## Overview

- Request flow from web server through rewrite.php
- Database interactions
- Demonstrate plugin hook system
- Content rendering pipeline

##### External Dependencies

- Web Servers (Apache/Nginx/Lighttpd)
- Databases (MySQL/MariaDB/Cubrid/PostgreSQL/SQLite)
- Caching systems (APC/XCache/Memcached)
- PHP environment

##### Key Integration Points

- OpenID integration
- XML-RPC interfaces
- RSS/Atom feeds
- Backup/Restore system

##### Architecture Patterns to Highlight

- MVC pattern implementation
- Plugin hook system
- Theme/skin system
- Multilingual support
- Caching architecture

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "External Dependencies"
        WS[Web Servers]
        DB[(Databases)]
        CACHE[Caching Systems]
        PHP[PHP Environment]
    end

    subgraph "Core Framework Layer"
        BOOT["Boot System"]:::core
        CACHE_SYS["Cache System"]:::core
        MODEL["Model System"]:::core
        UTILS["Utils"]:::core
        
        subgraph "Database Adapters"
            MYSQL["MySQL Adapter"]:::db
            PGSQL["PostgreSQL Adapter"]:::db
            SQLITE["SQLite3 Adapter"]:::db
            CUBRID["Cubrid Adapter"]:::db
        end
    end

    subgraph "Interface Layer"
        BLOG["Blog Interface"]:::interface
        ADMIN["Admin Interface"]:::interface
        API["API Interface"]:::interface
        AUTH["Authentication"]:::interface
    end

    subgraph "Resource Layer"
        LOCAL["Localization"]:::resource
        SCRIPT["Scripts"]:::resource
        STYLE["Styles"]:::resource
        SETUP["Setup Resources"]:::resource
    end

    subgraph "Plugin Architecture"
        PLUGIN["Plugin System"]:::plugin
        EDITOR["Editor Plugins"]:::plugin
        FORMAT["Format Plugins"]:::plugin
        WIDGET["Widget Plugins"]:::plugin
        SYS_PLUGIN["System Plugins"]:::plugin
    end

    subgraph "Skin System"
        BLOG_SKIN["Blog Skins"]:::skin
        ADMIN_SKIN["Admin Skins"]:::skin
        MOBILE_SKIN["Mobile Skins"]:::skin
    end

    subgraph "Integration Points"
        OPENID["OpenID"]
        XMLRPC["XML-RPC"]
        RSS["RSS/Atom"]
        BACKUP["Backup/Restore"]
    end

    %% Connections
    WS --> BOOT
    BOOT --> CACHE_SYS
    CACHE_SYS --> MODEL
    MODEL --> DB
    
    MYSQL --> DB
    PGSQL --> DB
    SQLITE --> DB
    CUBRID --> DB
    
    MODEL --> BLOG
    MODEL --> ADMIN
    MODEL --> API
    
    PLUGIN --> EDITOR
    PLUGIN --> FORMAT
    PLUGIN --> WIDGET
    PLUGIN --> SYS_PLUGIN
    
    BLOG --> BLOG_SKIN
    ADMIN --> ADMIN_SKIN
    ADMIN --> MOBILE_SKIN
    
    %% Click events
    click BOOT "https://github.com/Needlworks/Textcube/tree/master/framework/boot/"
    click CACHE_SYS "https://github.com/Needlworks/Textcube/tree/master/framework/cache/"
    click MODEL "https://github.com/Needlworks/Textcube/tree/master/framework/model/"
    click UTILS "https://github.com/Needlworks/Textcube/tree/master/framework/utils/"
    click MYSQL "https://github.com/Needlworks/Textcube/tree/master/framework/data/MySQLi/"
    click PGSQL "https://github.com/Needlworks/Textcube/tree/master/framework/data/PostgreSQL/"
    click SQLITE "https://github.com/Needlworks/Textcube/tree/master/framework/data/SQLite3/"
    click CUBRID "https://github.com/Needlworks/Textcube/tree/master/framework/data/Cubrid/"
    click BLOG "https://github.com/Needlworks/Textcube/tree/master/interface/blog/"
    click ADMIN "https://github.com/Needlworks/Textcube/tree/master/interface/owner/"
    click API "https://github.com/Needlworks/Textcube/tree/master/interface/atom/"
    click AUTH "https://github.com/Needlworks/Textcube/tree/master/interface/login/"
    click LOCAL "https://github.com/Needlworks/Textcube/tree/master/resources/locale/"
    click SCRIPT "https://github.com/Needlworks/Textcube/tree/master/resources/script/"
    click STYLE "https://github.com/Needlworks/Textcube/tree/master/resources/style/"
    click SETUP "https://github.com/Needlworks/Textcube/tree/master/resources/setup/"
    click PLUGIN "https://github.com/Needlworks/Textcube/tree/master/plugins/"
    click BLOG_SKIN "https://github.com/Needlworks/Textcube/tree/master/skin/blog/"
    click ADMIN_SKIN "https://github.com/Needlworks/Textcube/tree/master/skin/admin/"
    click MOBILE_SKIN "https://github.com/Needlworks/Textcube/tree/master/skin/admin/mobile/"

    %% Styles
    classDef core fill:#f9f,stroke:#333,stroke-width:2px
    classDef db fill:#69b,stroke:#333,stroke-width:2px
    classDef interface fill:#bfb,stroke:#333,stroke-width:2px
    classDef resource fill:#fb7,stroke:#333,stroke-width:2px
    classDef plugin fill:#7bf,stroke:#333,stroke-width:2px
    classDef skin fill:#f77,stroke:#333,stroke-width:2px
```
