# continew-org/continew-admin architecture

> Architecture diagram of the GitHub repository continew-org/continew-admin, 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/continew-org/continew-admin
- Repository: https://github.com/continew-org/continew-admin

## Overview

##### Project Type and Purpose
- This is a full-stack, modular, Java-based back-end “middle/after office” admin management framework. The project is built for enterprise-level system management and administration. It follows a clear “front-end/back-end separation” strategy (the UI project is maintained in a separate repository) and leverages modern frameworks (Spring Boot 3, Vue3, MyBatis Plus, Sa-Token, etc.) for an optimized development experience.
- The framework is designed as a skeletal foundation for admin applications with built-in modules for user management, permission control, logs, system configuration, file storage, code generation, and scheduled tasks.

##### Module-Based File Structure
- The project’s Maven-based structure is multi-module. The main modules include:
- continew-webapi: The entry point for web/API related functionalities (startup class, controllers, front controller, config files, resources for DB migration and logging).
- continew-module-system: Contains the core system management business functionalities. This module includes packages for authentication, system entities (users, departments, menus, logs, etc.), mappers, and service implementations.
- continew-common: Houses common utilities, configuration, constants, and support classes shared across modules.
- continew-plugin: Contains several plugin modules:
- continew-plugin-generator: Implements the code generation functionality.
- continew-plugin-open: Provides interfaces and services for open/third-party integrations.
- continew-plugin-schedule: Implements scheduling-related API and functionality.
- continew-extension: Provides additional extensions (for example, a schedule server that can be deployed if needed).
- In addition, there are deployment-related directories (docker, GitHub configurations, style settings) and common resources (such as logging configuration and Liquibase scripts).

##### Main Components and Their Relationships
- Frontend: Although not included in this repository, note that the UI uses Vue3 with Arco Design and is part of a separate repository.
- API/Entry Point (continew-webapi): Contains controllers that handle requests (e.g., auth, code generator, system management) and link to the system’s service layers.
- System Module (continew-module-system): Implements business logic (controllers, service implementations, mappers, entity models) for all core administrative functions such as user, role, department, and menu management.
- Common Library (continew-common): Provides shared utilities (constants, DTOs, exception handling, encryption, etc.) that are imported by the other modules.
- Plugins and Extensions:
- The Plugin modules (within continew-plugin) add dynamic capabilities like code generation, third-party integration, and scheduling.
- The Extension module (continew-extension) includes a schedule server that can be deployed to handle background task scheduling.
- External Dependencies and Frameworks: The architecture leverages Spring Boot as its runtime and dependency injection framework, Sa-Token for authentication, MyBatis Plus for ORM, JetCache and Redisson for caching and distributed utilities, Liquibase for database migrations, and others such as Hutool, JustAuth, and EasyExcel.

##### Architectural Patterns and Design Principles
- Layered/Onion Architecture: The project is clearly divided into presentation layers (Web API controllers), business service layers (inside continew-module-system and plugin services), data access layers (mappers and DAO patterns), and a common utility layer (continew-common).
- Module Separation: Each major function is isolated into separate Maven modules which help in code maintainability, independent development, and possibly independent deployment of some modules (for example, the schedule server can be deployed separately in a Docker container).
- Microservice-like Plugin Architecture: Although it is a monolithic project, the plugins (generator, schedule, open) are well isolated and interact with the core via clearly defined APIs.
- Standardized Code Generation & CRUD Practices: The project uses a code generation module to create new CRUD modules quickly while enforcing standardized interfaces, request/response formats, and documentation.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External User Request
    U["User Request"]:::external

    %% Presentation Layer: Web API
    subgraph "Presentation Layer: Web API"
        API["ContiNew Web API\n(Controllers, Configs, Resources)"]:::webapi
    end

    %% Business Layer: Module System
    subgraph "Business Layer: Module System"
        SYS["ContiNew Module System\n(Authentication, Services, Mappers, Entities)"]:::system
    end

    %% Common Utilities
    subgraph "Common Utilities"
        COM["ContiNew Common\n(Utilities, Configurations)"]:::common
    end

    %% Plugin Modules
    subgraph "Plugin Modules"
        GEN["Generator Plugin"]:::plugin
        OPEN["Open Plugin"]:::plugin
        SCHED_PLUG["Schedule Plugin"]:::plugin
    end

    %% Extensions
    subgraph "Extensions"
        EXT["ContiNew Extension\n(Schedule Server)"]:::extension
    end

    %% External Systems
    DB["Database\n(MyBatis Plus, Liquibase)"]:::database
    CACHE["Cache\n(Redis/JetCache)"]:::external
    SPRING["Spring Boot\nFramework"]:::external
    SATOKEN["Sa-Token\nAuthentication"]:::external

    %% Flow Connections
    U -->|"HTTP_Request"| API
    API -->|"Routes_API_call"| SYS
    SYS -->|"Uses_Utilities"| COM

    GEN ---|"Integrates"| SYS
    OPEN ---|"Integrates"| SYS
    SCHED_PLUG ---|"Integrates"| SYS
    SCHED_PLUG -->|"Supports_Scheduling"| EXT

    SYS -->|"Data_Access"| DB
    SYS -->|"Caching"| CACHE

    API -.->|"Framework"| SPRING
    SYS -.->|"Framework"| SPRING
    API -.->|"Auth"| SATOKEN

    %% Click Events
    click API "https://github.com/continew-org/continew-admin/tree/dev/continew-webapi"
    click SYS "https://github.com/continew-org/continew-admin/tree/dev/continew-module-system"
    click COM "https://github.com/continew-org/continew-admin/tree/dev/continew-common"
    click GEN "https://github.com/continew-org/continew-admin/tree/dev/continew-plugin/continew-plugin-generator"
    click OPEN "https://github.com/continew-org/continew-admin/tree/dev/continew-plugin/continew-plugin-open"
    click SCHED_PLUG "https://github.com/continew-org/continew-admin/tree/dev/continew-plugin/continew-plugin-schedule"
    click EXT "https://github.com/continew-org/continew-admin/tree/dev/continew-extension/continew-extension-schedule-server"

    %% Styles
    classDef external fill:#ffe0b3,stroke:#e67e22,stroke-width:2px;
    classDef webapi fill:#a2d5f2,stroke:#005f73,stroke-width:2px;
    classDef system fill:#e0bbff,stroke:#9b59b6,stroke-width:2px;
    classDef common fill:#d4efdf,stroke:#27ae60,stroke-width:2px;
    classDef plugin fill:#f9e79f,stroke:#d4ac0d,stroke-width:2px;
    classDef extension fill:#fadbd8,stroke:#c0392b,stroke-width:2px;
    classDef database fill:#d6eaf8,stroke:#2874a6,stroke-width:2px;
```
