# wjunicorn/coding653 architecture

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

- Interactive diagram: https://gitdiagram.com/wjunicorn/coding653
- Repository: https://github.com/wjunicorn/coding653

## Overview

##### Project Type and Purpose
- This is a multi-module full-stack, microservices-based platform repository.
It contains several domains:
- “Tag Server” – tagserver-ui (Vue.js frontend) and tagserver (Java Spring-Boot services: core, dao, web)
- “Metadata” – metadata-ui (Vue.js frontend) and metadata (Java Spring-Boot services: core, dao, web)
- “Query Middleware” – a set of Java modules (entrance-common, entrance-core, hiveserver2-entrance, presto-entrance, spark-livy-entrance, router-core, router-dao, router-web, router-cli, router-jdbc) implementing a gRPC/RPC-based distributed query router and engine clients
- “Cluster Manager” – manager-ui (Vue.js frontend) and platform-manager (Java Spring-Boot services: common, core, dao, web)
- “Auto-Deploy Installer” – platform-installer (Java console app + shell scripts for SSH orchestration)
- Dozens of chapter-based demo apps illustrating specific technologies

##### Key Architectural Patterns
- Clear frontend/backend separation: UIs built with Vue.js + D2Admin and webpack configs; RESTful API service layers behind them.
- Layered backend services:
- Web layer (Spring Boot controllers + SwaggerConfig)
- Core/service layer (business logic, scheduling with Drools, caching)
- DAO layer (MyBatis or JPA repositories)
- Microservices communicate via REST or gRPC within Query Middleware.
- External integrations:
- Databases (MySQL, ClickHouse)
- Caching (Redis)
- Service discovery/coordination (Zookeeper)
- Big-data systems (HDFS, YARN, Hive, Presto, Spark, Livy)

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Tag Server Domain
    subgraph "Tag Server"
        direction TB
        TS_UI["TagServer-UI<br/>(Vue.js)"]:::ui
        TS_WEB["TagServer-Web<br/>(Spring Boot)"]:::service
        TS_CORE["TagServer-Core<br/>(Service)"]:::service
        TS_DAO["TagServer-DAO<br/>(DAO)"]:::dao
        TS_DB["MySQL<br/>(Relational DB)"]:::db
        TS_CACHE["Redis Cache"]:::cache
        TS_UI -->|HTTP/JSON| TS_WEB
        TS_WEB -->|calls| TS_CORE
        TS_CORE -->|calls| TS_DAO
        TS_DAO -->|reads/writes| TS_DB
        TS_CORE -->|caches| TS_CACHE
    end

    %% Metadata Domain
    subgraph "Metadata"
        direction TB
        MD_UI["Metadata-UI<br/>(Vue.js)"]:::ui
        MD_WEB["Metadata-Web<br/>(Spring Boot)"]:::service
        MD_CORE["Metadata-Core<br/>(Service)"]:::service
        MD_DAO["Metadata-DAO<br/>(DAO)"]:::dao
        MD_DB["ClickHouse<br/>(Analytics DB)"]:::db
        MD_CACHE["Redis Cache"]:::cache
        MD_UI -->|HTTP/JSON| MD_WEB
        MD_WEB -->|calls| MD_CORE
        MD_CORE -->|calls| MD_DAO
        MD_DAO -->|reads/writes| MD_DB
        MD_CORE -->|caches| MD_CACHE
    end

    %% Cluster Manager Domain
    subgraph "Cluster Manager"
        direction TB
        CM_UI["Manager-UI<br/>(Vue.js)"]:::ui
        CM_WEB["Manager-Web<br/>(Spring Boot)"]:::service
        CM_CORE["Manager-Core<br/>(Service)"]:::service
        CM_DAO["Manager-DAO<br/>(DAO)"]:::dao
        CM_DB["MySQL<br/>(Relational DB)"]:::db
        CM_CACHE["Redis Cache"]:::cache
        CM_UI -->|HTTP/JSON| CM_WEB
        CM_WEB -->|calls| CM_CORE
        CM_CORE -->|calls| CM_DAO
        CM_DAO -->|reads/writes| CM_DB
        CM_CORE -->|caches| CM_CACHE
    end

    %% Query Middleware Domain
    subgraph "Query Middleware"
        direction TB
        subgraph "Router Cluster"
            direction TB
            R_WEB["Router-Web<br/>(gRPC Service)"]:::middleware
            R_CORE["Router-Core<br/>(gRPC Logic)"]:::middleware
            R_DAO["Router-DAO<br/>(DAO)"]:::dao
            R_CLI["Router-CLI"]:::service
            R_JDBC["Router-JDBC"]:::service
            R_WEB -->|gRPC| R_CORE
            R_CORE -->|calls| R_DAO
        end
        subgraph "Engine Clients"
            direction TB
            EC_COMMON["Entrance-Common<br/>(Proto & Utils)"]:::middleware
            EC_CORE["Entrance-Core<br/>(gRPC Engine Manager)"]:::middleware
            HS2["HiveServer2-Entrance"]:::middleware
            PRE["Presto-Entrance"]:::middleware
            SL["Spark-Livy-Entrance"]:::middleware
            LC["Livy-Client"]:::middleware
            R_CORE -->|gRPC| EC_CORE
            EC_CORE -->|uses| EC_COMMON
            EC_CORE -->|gRPC| HS2
            EC_CORE -->|gRPC| PRE
            EC_CORE -->|gRPC| SL
            SL -->|REST| LC
        end
    end

    %% Installer
    subgraph "Auto-Deploy Installer"
        direction TB
        INSTALLER["Platform-Installer<br/>(Console & SSH)"]:::service
        TARGET["Target Hosts"]:::infra
        INSTALLER -->|SSH| TARGET
    end

    %% Infrastructure Services
    subgraph "Infrastructure"
        direction TB
        DB_MYSQL["MySQL"]:::db
        DB_CH["ClickHouse"]:::db
        CACHE_REDIS["Redis"]:::cache
        ZK["Zookeeper"]:::infra
        HDFS["HDFS"]:::infra
        YARN["YARN"]:::infra
        HIVE["Hive Metastore"]:::infra
        PRESTO_CL["Presto Cluster"]:::infra
        SPARK_CL["Spark Cluster"]:::infra
        LIVY_SRV["Livy Server"]:::infra
    end

    %% Legend
    subgraph "Legend"
        direction LR
        UI["UI (Vue.js)"]:::ui
        SERVICE["Service"]:::service
        DAO["DAO"]:::dao
        DB["Database"]:::db
        CACHE["Cache"]:::cache
        MIDDLEWARE["gRPC/Middleware"]:::middleware
        INFRA["Infrastructure"]:::infra
    end

    %% Click Events
    click TS_UI "https://github.com/wjunicorn/coding653/tree/main/实战：标签平台/tagserver-ui"
    click TS_CORE "https://github.com/wjunicorn/coding653/tree/main/实战：标签平台/tagserver/tagserver-core"
    click TS_DAO "https://github.com/wjunicorn/coding653/tree/main/实战：标签平台/tagserver/tagserver-dao"
    click TS_WEB "https://github.com/wjunicorn/coding653/tree/main/实战：标签平台/tagserver/tagserver-web"
    click MD_UI "https://github.com/wjunicorn/coding653/tree/main/统一数据视图/metadata-ui"
    click MD_CORE "https://github.com/wjunicorn/coding653/tree/main/统一数据视图/platform-metadata/metadata-core"
    click MD_DAO "https://github.com/wjunicorn/coding653/tree/main/统一数据视图/platform-metadata/metadata-dao"
    click MD_WEB "https://github.com/wjunicorn/coding653/tree/main/统一数据视图/platform-metadata/metadata-web"
    click EC_COMMON "https://github.com/wjunicorn/coding653/tree/main/实战：统一查询中间件/platform-engine/entrance-common"
    click EC_CORE "https://github.com/wjunicorn/coding653/tree/main/实战：统一查询中间件/platform-engine/entrance-core"
    click HS2 "https://github.com/wjunicorn/coding653/tree/main/实战：统一查询中间件/platform-engine/hiveserver2-entrance"
    click PRE "https://github.com/wjunicorn/coding653/tree/main/实战：统一查询中间件/platform-engine/presto-entrance"
    click SL "https://github.com/wjunicorn/coding653/tree/main/实战：统一查询中间件/platform-engine/spark-livy-entrance"
    click LC "https://github.com/wjunicorn/coding653/tree/main/实战：统一查询中间件/platform-engine/livy-client"
    click R_CLI "https://github.com/wjunicorn/coding653/tree/main/实战：统一查询中间件/platform-engine/router-cli"
    click R_CORE "https://github.com/wjunicorn/coding653/tree/main/实战：统一查询中间件/platform-engine/router-core"
    click R_DAO "https://github.com/wjunicorn/coding653/tree/main/实战：统一查询中间件/platform-engine/router-dao"
    click R_WEB "https://github.com/wjunicorn/coding653/tree/main/实战：统一查询中间件/platform-engine/router-web"
    click INSTALLER "https://github.com/wjunicorn/coding653/tree/main/实战：自动部署项目/platform-installer"

    %% Styles
    classDef ui fill:#cce5ff,stroke:#3399ff,color:#000
    classDef service fill:#d4edda,stroke:#28a745,color:#000
    classDef dao fill:#fff3cd,stroke:#ffc107,color:#000
    classDef db fill:#ffe5b4,stroke:#e08e00,color:#000
    classDef cache fill:#f0f8ff,stroke:#4682b4,color:#000
    classDef middleware fill:#e2d5f5,stroke:#6f42c1,color:#000
    classDef infra fill:#f8f9fa,stroke:#6c757d,color:#000
```
