# honglei111/vue-blog architecture

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

- Interactive diagram: https://gitdiagram.com/honglei111/vue-blog
- Repository: https://github.com/honglei111/vue-blog

## Overview

##### Project type and purpose
- This is a full-stack, front-end/back-end separated personal blog system (“Ruyu-Blog”) comprising:
- A SpringBoot3 monolithic REST API (“blog-backend”)
- A public Vue3-based blog UI (“blog-frontend/kuailemao-blog”)
- An admin Vue3 dashboard UI (“blog-frontend/kuailemao-admin”)
- Supporting scripts, SQL init files, Docker Compose, Nginx configs, etc.

##### File structure
- Top-level directories:
- blog-backend: Java source (controllers, services, mappers, entities, config, AOP, security, interceptors, RabbitMQ listeners, Quartz tasks, utils), resources, tests, Dockerfile.
- blog-frontend/kuailemao-admin: Antdv Pro admin SPA with src/api, components, pages, router, store, Dockerfile, Nginx default.conf.
- blog-frontend/kuailemao-blog: Public blog SPA with src/apis, components, views, router, store, Dockerfile, Nginx default.conf.
- sql: schema and data seeding scripts.
- Infrastructure files: `.sh/docker-restart.sh`, Dockerfiles, Compose scripts, Nginx configs.

##### README for additional insights
- Technologies: Vue3 + Pinia + TypeScript + Axios + Element Plus/Antdv Pro on frontends; SpringBoot3 + SpringSecurity + MyBatis-Plus + MySQL + Redis + RabbitMQ + Minio + Quartz on backend; Nginx reverse proxy; Docker Compose.
- Features: RBAC, JWT auth, dynamic menus/routes, rate-limiting via interceptor+Redis, AOP logging + RabbitMQ, async email; Quartz scheduled cache refresh; RESTful API; Swagger/Knife4j docs.
- External integrations: GitHub/Gitee OAuth, SMTP email.

##### Main components & interactions
a. Frontends (Browser clients)
- Public blog UI (Vue3 + Element Plus)
- Admin dashboard UI (Vue3 + Antdv Pro)
b. API Gateway / Reverse Proxy
- Nginx serves static files, proxies `/api` to backend
c. Backend service (SpringBoot3)
- REST Controllers ←→ Service Layer ←→ MyBatis-Plus Mappers ←→ MySQL
- Redis for caching & rate-limiting
- RabbitMQ for async logging/email
- Quartz Scheduler for periodic tasks
- Minio for file storage
- JWT + SpringSecurity for authentication/authorization
- AOP interceptors for logging, custom annotations (AccessLimit, Blacklist)
d. Persistent layers & external services
- MySQL 8.0 (relational data)
- Redis 7.x (cache, rate limit store)
- RabbitMQ (message broker)
- Minio (object storage for images)
- OAuth providers (GitHub, Gitee)
- SMTP Email Server

##### Architectural patterns & design principles
- Layered architecture (Controller → Service → DAO)
- Front-end/back-end decoupling via REST
- Asynchronous messaging for non-blocking tasks
- AOP for cross-cutting (logging)
- Interceptor + Redis for rate limiting
- RBAC with dynamic permissions via SpringSecurity
- Scheduled tasks with Quartz

##### Final checklist
- Related sub-components
- Cross-cutting concerns (AOP, interceptors)
- Versioned API docs endpoint (Swagger/Knife4j)
- Docker Compose orchestration

## Diagram (Mermaid)

```mermaid
flowchart TD
    direction TB

    subgraph Clients
        direction TB
        PublicUI["Public Blog UI"]:::frontend
        AdminUI["Admin Dashboard UI"]:::frontend
    end

    Nginx["Nginx Proxy"]:::proxy

    PublicUI -->|"HTTP/REST"| Nginx
    AdminUI -->|"HTTP/REST"| Nginx

    subgraph "SpringBoot Backend"
        direction TB
        SB["SpringBoot3 REST API"]:::backend-core

        subgraph Layers
            direction TB
            Controllers["Controllers (REST)"]:::backend-layer
            Services["Service Layer"]:::backend-layer
            Mappers["MyBatis-Plus Mappers"]:::backend-layer
            Entities["Entity Models"]:::backend-layer
        end

        subgraph Infrastructure
            direction TB
            Config["Configuration"]:::backend-infra
            AOPAnn["Annotations"]:::backend-infra
            LogAspect["LogAspect"]:::backend-infra
            SecurityConfig["SecurityConfiguration"]:::backend-infra
            JwtFilter["JwtAuthorizeFilter"]:::backend-infra
            Interceptor["AccessLimitInterceptor"]:::backend-infra
            EmailListener["EmailQueueListener"]:::backend-infra
            LogListener["LogQueueListener"]:::backend-infra
            RefreshCache["RefreshTheCache"]:::backend-infra
            AutoTasks["AutomaticTasks"]:::backend-infra
            Utils["Utilities"]:::backend-infra
        end

        SB --> Controllers --> Services --> Mappers --> SB
        SB --> Config
        SB --> AOPAnn
        SB --> LogAspect
        SB --> SecurityConfig
        SB --> JwtFilter
        SB --> Interceptor
        SB --> EmailListener
        SB --> LogListener
        SB --> RefreshCache
        SB --> AutoTasks
        SB --> Utils
    end

    Nginx -->|"REST/JSON"| SB

    subgraph "Data Stores"
        direction TB
        MySQL["MySQL 8.0"]:::db
        Redis["Redis 7.x"]:::db
        RabbitMQ["RabbitMQ"]:::mq
        Minio["Minio Object Store"]:::db
    end

    SB <-->|"JDBC/JSON"| MySQL
    SB <-.->|"Cache|RateLimit"| Redis
    SB -.->|"AMQP"| RabbitMQ
    SB -->|"S3 API"| Minio

    subgraph External
        direction TB
        OAuth["GitHub/Gitee OAuth"]:::external
        SMTP["SMTP Email"]:::external
    end

    SB -->|"OAuth Flow"| OAuth
    SB -->|"SMTP"| SMTP

    classDef frontend fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef proxy fill:#87CEEB,stroke:#333,stroke-width:1px
    classDef backend fill:#98FB98,stroke:#333,stroke-width:1px
    classDef backend-core fill:#32CD32,stroke:#333,stroke-width:1px
    classDef backend-layer fill:#90EE90,stroke:#333,stroke-width:1px
    classDef backend-infra fill:#7FFFD4,stroke:#333,stroke-width:1px
    classDef db fill:#FFA500,stroke:#333,stroke-width:1px
    classDef mq fill:#DDA0DD,stroke:#333,stroke-width:1px
    classDef external fill:#D3D3D3,stroke:#333,stroke-width:1px

    click SB "https://github.com/honglei111/vue-blog/tree/master/blog-backend/"
    click Controllers "https://github.com/honglei111/vue-blog/tree/master/blog-backend/src/main/java/xyz/kuailemao/controller/"
    click Services "https://github.com/honglei111/vue-blog/tree/master/blog-backend/src/main/java/xyz/kuailemao/service/"
    click Mappers "https://github.com/honglei111/vue-blog/tree/master/blog-backend/src/main/java/xyz/kuailemao/mapper/"
    click Entities "https://github.com/honglei111/vue-blog/tree/master/blog-backend/src/main/java/xyz/kuailemao/domain/entity/"
    click Config "https://github.com/honglei111/vue-blog/tree/master/blog-backend/src/main/java/xyz/kuailemao/config/"
    click AOPAnn "https://github.com/honglei111/vue-blog/tree/master/blog-backend/src/main/java/xyz/kuailemao/annotation/"
    click LogAspect "https://github.com/honglei111/vue-blog/blob/master/blog-backend/src/main/java/xyz/kuailemao/aop/LogAspect.java"
    click SecurityConfig "https://github.com/honglei111/vue-blog/blob/master/blog-backend/src/main/java/xyz/kuailemao/config/SecurityConfiguration.java"
    click JwtFilter "https://github.com/honglei111/vue-blog/blob/master/blog-backend/src/main/java/xyz/kuailemao/filter/JwtAuthorizeFilter.java"
    click Interceptor "https://github.com/honglei111/vue-blog/blob/master/blog-backend/src/main/java/xyz/kuailemao/interceptor/AccessLimitInterceptor.java"
    click EmailListener "https://github.com/honglei111/vue-blog/blob/master/blog-backend/src/main/java/xyz/kuailemao/interceptor/EmailQueueListener.java"
    click LogListener "https://github.com/honglei111/vue-blog/blob/master/blog-backend/src/main/java/xyz/kuailemao/interceptor/LogQueueListener.java"
    click RefreshCache "https://github.com/honglei111/vue-blog/blob/master/blog-backend/src/main/java/xyz/kuailemao/quartz/RefreshTheCache.java"
    click AutoTasks "https://github.com/honglei111/vue-blog/blob/master/blog-backend/src/main/java/xyz/kuailemao/tasks/AutomaticTasks.java"
    click Utils "https://github.com/honglei111/vue-blog/tree/master/blog-backend/src/main/java/xyz/kuailemao/utils/"
    click AppYml "https://github.com/honglei111/vue-blog/blob/master/blog-backend/src/main/resources/application.yml"
    click MapperResources "https://github.com/honglei111/vue-blog/tree/master/blog-backend/src/main/resources/mapper/"
    click SQLScripts "https://github.com/honglei111/vue-blog/tree/master/sql/"
    click DockerRestart "https://github.com/honglei111/vue-blog/blob/master/.sh/docker-restart.sh"
    click BackendDockerfile "https://github.com/honglei111/vue-blog/tree/master/blog-backend/Dockerfile"
    click PublicUI "https://github.com/honglei111/vue-blog/tree/master/blog-frontend/kuailemao-blog/"
    click AdminUI "https://github.com/honglei111/vue-blog/tree/master/blog-frontend/kuailemao-admin/"
    click PublicNginx "https://github.com/honglei111/vue-blog/blob/master/blog-frontend/kuailemao-blog/default.conf"
    click AdminNginx "https://github.com/honglei111/vue-blog/blob/master/blog-frontend/kuailemao-admin/default.conf"
    click PublicDockerfile "https://github.com/honglei111/vue-blog/tree/master/blog-frontend/kuailemao-blog/Dockerfile"
    click AdminDockerfile "https://github.com/honglei111/vue-blog/tree/master/blog-frontend/kuailemao-admin/Dockerfile"
```
