# linhaojun857/aurora architecture

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

- Interactive diagram: https://gitdiagram.com/linhaojun857/aurora
- Repository: https://github.com/linhaojun857/aurora

## Overview

##### Main components
- Backend Component (aurora-springboot):
- Core Application: The Spring Boot application (AuroraSpringbootApplication.java) that bootstraps the system.
- API Controllers: A series of controllers handling article, user, comment, and configuration related requests.
- Business Logic & Service Layer: Service interfaces and implementations (service/ and service/impl folders) that encapsulate business logic.
- Data Access Layer: Mapper interfaces and XML (mapper/ and src/main/resources/mapper) to interact with the database.
- Domain Models: Entities, DTOs, and VOs (under entity/, model/dto, and model/vo folders) representing the business data.
- Cross-Cutting Concerns: Aspects, interceptors, filters, exception handling, and annotations that manage logging, access, security, etc.
- Configuration & Infrastructure: Configuration classes for Redis, RabbitMQ, MyBatis Plus, Knife4j (swagger), Spring Security, etc.
- Integration with External Services: Configuration for object storage (Minio) and scheduling (Quartz).

- Frontend Components (aurora-vue):
- Aurora-Blog (Public Site):
- Built with Vue 3 (using TypeScript, Element Plus, Tailwind, etc.) to render blog posts, comments, articles, and other content.
- Contains components for articles, navigation, sidebar, header, footer, and common utilities.
- Aurora-Admin (Admin Dashboard):
- Built with Vue 2, using Vuex for state management and Vue Router.
- Contains layout components (NavBar, SideBar) along with views for managing articles, comments, users, configurations, etc.

- Auxiliary Components:
- Database: Referenced by SQL scripts (aurora-springboot/sql/aurora.sql) for schema creation.
- CI/CD: GitHub workflows (in the .github/workflows folder) and Dockerfiles for containerization, which define deployment pipelines.
- Deployment and Installation Scripts: The aurora_start.sh and deployment document (项目部署文档.md) that guide the production deployment process.

##### Detail the relationships and interactions
- The Frontend (both Blog and Admin) sends HTTP requests to the Backend API endpoints.
- The Backend processes these requests (via controllers) and applies business logic through its service layer.
- The Data Access Layer communicates with the Database to perform CRUD operations.
- Caching (Redis) is used to improve performance, while RabbitMQ facilitates asynchronous processing (e.g., logging, notifications).
- External integrations like Elasticsearch, Minio, and Quartz serve specific roles, such as search, file storage, and scheduled tasks.
- Security components, including Spring Security and JWT filters, manage authentication and authorization.
- CI/CD pipelines (triggered by GitHub workflows) ensure the application is built, tested, and deployed via Docker containers.

##### Important architectural patterns and design principles
- Layered Architecture: Clear separation among controller, service, and data layers.
- Frontend/Backend Separation: Decoupled client (Vue) applications communicate with a RESTful backend.
- Aspect-Oriented Programming: Use of aspects (for exception and operation logging) to handle cross-cutting concerns.
- Strategy Pattern: The use of strategies (see strategy/ and its implementations) suggests pluggable algorithms for tasks like article import, search, social login, and file uploads.
- Microservice-friendly design: Though monolithic, the backend is modularized enough to allow potential extraction into microservices if needed in the future.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Subsystem
    subgraph "Frontend"
        F1["Aurora-Blog (Vue 3, Pinia)"]:::frontend
        F2["Aurora-Admin (Vue 2, Vuex)"]:::frontend
    end

    %% Backend Subsystem
    subgraph "Backend (Aurora Springboot)"
        B1["Core Application (Spring Boot)"]:::backend
        B2["API Controllers"]:::backend
        B3["Service Layer"]:::backend
        
        subgraph "Data Access Layer"
            B4["Mapper Interfaces"]:::backend
            B5["XML Mappers"]:::backend
        end
        
        subgraph "Domain Models"
            B6["Entities"]:::backend
            B7["DTOs"]:::backend
            B8["VOs"]:::backend
        end
        
        subgraph "Cross-Cutting Concerns"
            B9["Aspects"]:::crosscut
            B10["Filters"]:::crosscut
            B11["Interceptors"]:::crosscut
            B12["Handlers"]:::crosscut
        end
        
        subgraph "Configurations"
            B13["Configuration"]:::config
            B14["Config Properties"]:::config
        end
        
        subgraph "External Integrations"
            B15["Redis,RabbitMQ,Minio (Config)"]:::integration
            B16["Quartz Scheduler"]:::integration
        end
        
        B17["Strategy Implementations"]:::backend
    end

    %% Auxiliary Components
    subgraph "Auxiliary Components"
        A1["Database (aurora.sql)"]:::auxiliary
        subgraph "CI/CD"
            A2["GitHub Workflows"]:::auxiliary
            A3["Backend Dockerfile"]:::auxiliary
            A4["Frontend Dockerfile"]:::auxiliary
        end
        subgraph "Deployment"
            A5["Startup Script"]:::auxiliary
            A6["Deployment Document"]:::auxiliary
        end
    end

    %% Connections between Frontend and Backend
    F1 -->|"HTTP_request"| B2
    F2 -->|"HTTP_request"| B2

    %% Backend internal flows
    B1 -->|"bootstraps"| B2
    B2 -->|"calls"| B3
    B3 -->|"CRUD_operations"| B4
    B3 -->|"CRUD_operations"| B5
    B4 -->|"data_access"| A1
    B3 -->|"uses_async"| B15
    B15 -->|"schedules"| B16
    B3 -->|"utilizes"| B17
    B1 -->|"applies_security"| B9
    B1 -->|"applies_security"| B10
    B1 -->|"applies_security"| B11
    B1 -->|"applies_security"| B12
    B1 -->|"loads"| B13
    B13 -->|"provides_props"| B14

    %% CI/CD and Deployment flows
    A2 -->|"triggers_build"| B1
    A2 -->|"triggers_build"| F1
    A2 -->|"triggers_build"| F2
    A3 -->|"builds_backend"| B1
    A4 -->|"builds_frontend"| F1
    A4 -->|"builds_frontend"| F2
    A2 -->|"deploys_to"| A5
    A2 -->|"deploys_to"| A6

    %% Click Events for Backend Components
    click B1 "https://github.com/linhaojun857/aurora/blob/master/aurora-springboot/src/main/java/com/aurora/AuroraSpringbootApplication.java"
    click B2 "https://github.com/linhaojun857/aurora/tree/master/aurora-springboot/src/main/java/com/aurora/controller"
    click B3 "https://github.com/linhaojun857/aurora/tree/master/aurora-springboot/src/main/java/com/aurora/service"
    click B4 "https://github.com/linhaojun857/aurora/tree/master/aurora-springboot/src/main/java/com/aurora/mapper"
    click B5 "https://github.com/linhaojun857/aurora/tree/master/aurora-springboot/src/main/resources/mapper"
    click B6 "https://github.com/linhaojun857/aurora/tree/master/aurora-springboot/src/main/java/com/aurora/entity"
    click B7 "https://github.com/linhaojun857/aurora/tree/master/aurora-springboot/src/main/java/com/aurora/model/dto"
    click B8 "https://github.com/linhaojun857/aurora/tree/master/aurora-springboot/src/main/java/com/aurora/model/vo"
    click B9 "https://github.com/linhaojun857/aurora/tree/master/aurora-springboot/src/main/java/com/aurora/aspect"
    click B10 "https://github.com/linhaojun857/aurora/tree/master/aurora-springboot/src/main/java/com/aurora/filter"
    click B11 "https://github.com/linhaojun857/aurora/tree/master/aurora-springboot/src/main/java/com/aurora/interceptor"
    click B12 "https://github.com/linhaojun857/aurora/tree/master/aurora-springboot/src/main/java/com/aurora/handler"
    click B13 "https://github.com/linhaojun857/aurora/tree/master/aurora-springboot/src/main/java/com/aurora/config"
    click B14 "https://github.com/linhaojun857/aurora/tree/master/aurora-springboot/src/main/java/com/aurora/config/properties"
    click B15 "https://github.com/linhaojun857/aurora/tree/master/aurora-springboot/src/main/java/com/aurora/config"
    click B16 "https://github.com/linhaojun857/aurora/tree/master/aurora-springboot/src/main/java/com/aurora/quartz"
    click B17 "https://github.com/linhaojun857/aurora/tree/master/aurora-springboot/src/main/java/com/aurora/strategy"

    %% Click Events for Frontend Components
    click F1 "https://github.com/linhaojun857/aurora/tree/master/aurora-vue/aurora-blog"
    click F2 "https://github.com/linhaojun857/aurora/tree/master/aurora-vue/aurora-admin"

    %% Click Events for Auxiliary Components
    click A1 "https://github.com/linhaojun857/aurora/blob/master/aurora-springboot/sql/aurora.sql"
    click A2 "https://github.com/linhaojun857/aurora/tree/master/.github/workflows"
    click A3 "https://github.com/linhaojun857/aurora/tree/master/aurora-springboot/Dockerfile"
    click A4 "https://github.com/linhaojun857/aurora/tree/master/aurora-vue/Dockerfile"
    click A5 "https://github.com/linhaojun857/aurora/blob/master/aurora_start.sh"
    click A6 "https://github.com/linhaojun857/aurora/blob/master/项目部署文档.md"

    %% Style Definitions
    classDef backend fill:#ffcccc,stroke:#cc0000,stroke-width:2px;
    classDef frontend fill:#ccffcc,stroke:#006600,stroke-width:2px;
    classDef integration fill:#ffe6cc,stroke:#cc6600,stroke-width:2px;
    classDef auxiliary fill:#ffffcc,stroke:#cccc00,stroke-width:2px;
    classDef crosscut fill:#e6e6ff,stroke:#3333cc,stroke-width:2px;
    classDef config fill:#d9ead3,stroke:#38761d,stroke-width:2px;
```
