# jianyan74/rageframe3 architecture

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

- Interactive diagram: https://gitdiagram.com/jianyan74/rageframe3
- Repository: https://github.com/jianyan74/rageframe3

## Overview

##### Major components
– Backend (for system administration)
– Frontend (PC-facing public website)
– Merchant (for business-side management)
– Html5 (mobile-specific interface)
– API (for internal RESTful interfaces)
– OAuth2 (for external interfaces)
– Console (command-line tasks and scheduled jobs)
- Core Framework and Shared Libraries: Represent the “common” folder, shared models, behaviors, traits, components, and services. This layer is fundamental to all modules.
- Service / Business Logic Layer: Show the “services” directory where different business functions (for members, merchants, payments, addons, etc.) are abstracted.
- Plugin/Addon Architecture: Highlight the “addons” directory where different plugins (for membership, Wechat, TinyBlog, etc.) are implemented. Emphasize that these components plug into the core and can be installed/uninstalled dynamically.
- Infrastructure: Indicate configuration layers (environments setups, config directories for each application), migration scripts (in console/migrations), and third‑party integrations (payment, cloud storage, external login, WeChat, etc.).

##### Relationships and interactions
- Integration points for external services such as third‑party payment gateways, social login, and WeChat SDK – label these clearly as external integrations.

##### Architectural patterns
- Multi‑application and Multi‑entry design: The different web directories (backend, frontend, merchant, html5, oauth2, api) are independent applications that share the same core.
- Modular/Plugin architecture: The “addons” mechanism indicates a micro-kernel design. Each plugin’s directory holds its own controllers, models, views, and even configuration, interfacing with the system through common mechanisms.
- Service Layer Separation: The “services” directory separates business logic from controllers. Make sure this layer is a central block that communicates with the databases, third‑party APIs, and the addon modules.
- Configuration Management: With distinct config folders (for environments/dev/prod, config/main.php, params.php), note how configuration is layered for flexibility and separation of concerns.

##### Relevant technologies and frameworks
- PHP with Yii2 Advanced framework (the base of the system)
- Various third‑party libraries such as EasyWechat for WeChat integration, Bootstrap/AdminLTE for UI, and other integrations (payment gateways, storage adapters, etc.)

- From the core block, branch out to the “Addon/Plugin” group and annotate how these plug into the system.
- At the bottom layer, show the Database/Storage system and the configuration/integration with external third‑party services.
- Flows such as “Authentication (RBAC)”, “RESTful API Call”, “Third‑party Payment”, “WeChat Integration”, etc.

## Diagram (Mermaid)

```mermaid
flowchart TD
    Client("External Clients"):::external

    subgraph "Entry Points"
        BE("Backend"):::entrypoint
        FE("Frontend"):::entrypoint
        ME("Merchant"):::entrypoint
        H5("Html5"):::entrypoint
        API("API"):::entrypoint
        OAUTH("OAuth2"):::entrypoint
        CON("Console"):::entrypoint
    end

    Core("Core Framework & Shared Libraries"):::core
    Services("Service / Business Logic Layer"):::service
    Addons("Plugin/Addon Architecture"):::addon
    DB("Database / Persistence"):::db
    Ext("External Integrations"):::external

    Client --> BE
    Client --> FE
    Client --> ME
    Client --> H5
    Client --> API
    Client --> OAUTH
    Client --> CON

    BE -->|"uses"| Core
    FE -->|"uses"| Core
    ME -->|"uses"| Core
    H5 -->|"uses"| Core
    API -->|"uses"| Core
    OAUTH -->|"uses"| Core
    CON -->|"uses"| Core

    Core -->|"calls"| Services
    Core -->|"extends"| Addons

    Services -->|"dataStorage"| DB
    Addons -.->|"optionalCalls"| DB

    Core -->|"integrates"| Ext
    Services -->|"integrates"| Ext

    click BE "https://github.com/jianyan74/rageframe3/tree/master/backend/"
    click FE "https://github.com/jianyan74/rageframe3/tree/master/frontend/"
    click ME "https://github.com/jianyan74/rageframe3/tree/master/merchant/"
    click H5 "https://github.com/jianyan74/rageframe3/tree/master/html5/"
    click API "https://github.com/jianyan74/rageframe3/tree/master/api/"
    click OAUTH "https://github.com/jianyan74/rageframe3/tree/master/oauth2/"
    click CON "https://github.com/jianyan74/rageframe3/tree/master/console/"
    click Core "https://github.com/jianyan74/rageframe3/tree/master/common/"
    click Services "https://github.com/jianyan74/rageframe3/tree/master/services/"
    click Addons "https://github.com/jianyan74/rageframe3/tree/master/addons/"

    classDef entrypoint fill:#AED6F1,stroke:#2980B9,stroke-width:2px;
    classDef core fill:#F9E79F,stroke:#F1C40F,stroke-width:2px;
    classDef service fill:#A9DFBF,stroke:#27AE60,stroke-width:2px;
    classDef addon fill:#FAD7A0,stroke:#E67E22,stroke-width:2px;
    classDef external fill:#D2B4DE,stroke:#8E44AD,stroke-width:2px;
    classDef db fill:#F5B7B1,stroke:#C0392B,stroke-width:2px;
```
