# fushengqian/fuint architecture

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

- Interactive diagram: https://gitdiagram.com/fushengqian/fuint
- Repository: https://github.com/fushengqian/fuint

## Overview

##### Project type and purpose
- This is a full-stack, modular Java Spring Boot application (fuint-application) for in-store membership management and marketing, backed by MySQL, Redis, Quartz scheduling and exposed via REST.
- It comprises reusable framework (fuint-framework), data-access layer (fuint-repository), and utility library (fuint-utils). The front end (not in this repo) is built with Vue/Uniapp/Element UI for H5 and mini-programs.

##### File structure
- Top-level pom.xml defines a multi-module Maven project with these subprojects:
- fuint-application: the main Spring Boot service
- fuint-framework: base controller, error handling, export service
- fuint-repository: MyBatis Mapper interfaces, XMLs and domain models
- fuint-utils: common utilities and text/IO helpers
- In fuint-application/src/main/java:
- common: shared config (Redis, MyBatisPlus, Swagger, security), AOP aspects (logging, Redis caching), beans/DTOs/enums, util classes
- service / service.impl: business logic interfaces and implementations
- web modules: three controller packages (backendApi, clientApi, merchantApi)
- schedule: Quartz jobs for commission, coupon expiration, order cancellation, etc.
- resource files: application.properties, Redis cache config, EHCache, Sentry, static uploads, generation templates (Velocity)
- At root: configure/dev & prod folders for environment-specific properties, db/fuint-db.sql for schema, sbin scripts for deployment.

##### Key architecture points from README
- Backend stack: Spring Boot 2.5, MyBatis Plus, Spring Security, JWT, Redis, Quartz, MySQL 5.7+, Swagger UI
- Frontend stack: Django-style REST separation; Uniapp & Element UI (Vue2) for H5, WeChat mini-program
- External integrations: SMS gateway, payment gateways (AliPay, WeChat Pay, UnionPay), cloud printing service.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Clients
    subgraph "Frontend Clients"
        H5["H5 Site"]:::frontend
        MP["WeChat Mini-App"]:::frontend
        AdminUI["Admin Console"]:::frontend
    end

    %% Spring Boot Service
    subgraph "Spring Boot Service (fuint-application)"
        subgraph "Controllers"
            BController["BackendApi Controllers"]:::frontend
            CController["ClientApi Controllers"]:::frontend
            MController["MerchantApi Controllers"]:::frontend
        end
        subgraph "Service Layer"
            ServiceIntf["Service Interfaces"]:::service
            ServiceImpl["Service Implementations"]:::service
        end
        subgraph "Data Access Layer"
            Mapper["Repository Interfaces (Mappers)"]:::repository
            XML["Repository XML Mappings"]:::repository
            Model["Domain Models"]:::repository
        end
        subgraph "Scheduling (Quartz Jobs)"
            Schedule["Quartz Jobs"]:::infrastructure
        end
        subgraph "AOP & Caching"
            LogAOP["Logging AOP"]:::infrastructure
            CacheAOP["Redis Caching AOP"]:::infrastructure
        end
        subgraph "Configuration"
            SwaggerCfg["SwaggerConfig"]:::infrastructure
            SecurityCfg["SecurityConfig"]:::infrastructure
            MybatisCfg["MybatisPlusConfig"]:::infrastructure
            RedisCfg["RedisConfig"]:::infrastructure
        end
        subgraph "External Integrations"
            Payment["Payment Gateways"]:::infrastructure
            SMS["SMS Service"]:::infrastructure
            Printer["Cloud Printer Service"]:::infrastructure
        end
    end

    %% Shared Modules
    subgraph "Shared Modules"
        Framework["fuint-framework"]:::infrastructure
        Utils["fuint-utils"]:::infrastructure
    end

    %% Infrastructure
    DB["MySQL Cluster"]:::repository
    Cache["Redis Cache"]:::infrastructure
    SwaggerUI["Swagger UI"]:::infrastructure
    Schema["DB Schema Script"]:::repository
    ConfigDev["Dev Properties"]:::infrastructure
    ConfigProd["Prod Properties"]:::infrastructure
    Scripts["Deployment Scripts"]:::infrastructure

    %% Relationships
    H5 -->|REST calls| CController
    MP -->|REST calls| CController
    AdminUI -->|REST calls| BController
    AdminUI -->|REST calls| MController

    BController -->|uses| ServiceIntf
    CController -->|uses| ServiceIntf
    MController -->|uses| ServiceIntf

    ServiceIntf -->|implemented by| ServiceImpl
    ServiceImpl -->|calls| Mapper
    ServiceImpl -->|reads/writes| DB
    ServiceImpl -->|caches| Cache
    ServiceImpl -->|calls| Payment
    ServiceImpl -->|calls| SMS
    ServiceImpl -->|calls| Printer
    ServiceImpl -->|logs via| LogAOP
    ServiceImpl -->|caches via| CacheAOP

    Mapper -->|XML mapping| XML
    Mapper -->|maps to| Model

    Schedule -->|invokes| ServiceImpl

    SwaggerUI -->|docs| SwaggerCfg
    SwaggerUI -->|exposes| BController

    ServiceImpl -->|uses| Framework
    ServiceImpl -->|uses| Utils

    ConfigDev -->|configures| SwaggerCfg
    ConfigProd -->|configures| SwaggerCfg
    ConfigDev -->|configures| SecurityCfg
    ConfigProd -->|configures| SecurityCfg

    Schema -->|initializes| DB
    Scripts -->|deploy| SpringBootService["Spring Boot Service (fuint-application)"]

    %% Click Events
    click fuint-application/pom.xml "https://github.com/fushengqian/fuint/blob/master/fuint-application/pom.xml"
    click BController "https://github.com/fushengqian/fuint/tree/master/fuint-application/src/main/java/com/fuint/module/backendApi/controller"
    click CController "https://github.com/fushengqian/fuint/tree/master/fuint-application/src/main/java/com/fuint/module/clientApi/controller"
    click MController "https://github.com/fushengqian/fuint/tree/master/fuint-application/src/main/java/com/fuint/module/merchantApi/controller"
    click ServiceIntf "https://github.com/fushengqian/fuint/tree/master/fuint-application/src/main/java/com/fuint/common/service"
    click ServiceImpl "https://github.com/fushengqian/fuint/tree/master/fuint-application/src/main/java/com/fuint/common/service/impl"
    click Mapper "https://github.com/fushengqian/fuint/tree/master/fuint-repository/src/main/java/com/fuint/repository/mapper"
    click XML "https://github.com/fushengqian/fuint/tree/master/fuint-repository/src/main/resources/mapper"
    click Model "https://github.com/fushengqian/fuint/tree/master/fuint-repository/src/main/java/com/fuint/repository/model"
    click Schedule "https://github.com/fushengqian/fuint/tree/master/fuint-application/src/main/java/com/fuint/module/schedule"
    click Framework "https://github.com/fushengqian/fuint/blob/master/fuint-framework/pom.xml"
    click BaseController "https://github.com/fushengqian/fuint/tree/master/fuint-framework/src/main/java/com/fuint/framework/web"
    click GlobalExceptionHandler "https://github.com/fushengqian/fuint/blob/master/fuint-framework/src/main/java/com/fuint/framework/exception/GlobalExceptionHandler.java"
    click ExportService "https://github.com/fushengqian/fuint/tree/master/fuint-framework/src/main/java/com/fuint/framework/service"
    click Utils "https://github.com/fushengqian/fuint/blob/master/fuint-utils/pom.xml"
    click TextUtilities "https://github.com/fushengqian/fuint/tree/master/fuint-utils/src/main/java/com/fuint/text"
    click GeneralUtilities "https://github.com/fushengqian/fuint/tree/master/fuint-utils/src/main/java/com/fuint/utils"
    click ConfigDev "https://github.com/fushengqian/fuint/blob/master/configure/dev/application.properties"
    click ConfigProd "https://github.com/fushengqian/fuint/blob/master/configure/prod/application.properties"
    click Schema "https://github.com/fushengqian/fuint/blob/master/db/fuint-db.sql"
    click Scripts "https://github.com/fushengqian/fuint/blob/master/sbin/start.sh"
    click LogAOP "https://github.com/fushengqian/fuint/blob/master/fuint-application/src/main/java/com/fuint/common/aspect/LogAop.java"
    click CacheAOP "https://github.com/fushengqian/fuint/blob/master/fuint-application/src/main/java/com/fuint/common/aspect/RedisModelAspect.java"
    click SwaggerCfg "https://github.com/fushengqian/fuint/blob/master/fuint-application/src/main/java/com/fuint/common/config/SwaggerConfig.java"
    click SecurityCfg "https://github.com/fushengqian/fuint/blob/master/fuint-application/src/main/java/com/fuint/common/config/SecurityConfig.java"
    click MybatisCfg "https://github.com/fushengqian/fuint/blob/master/fuint-application/src/main/java/com/fuint/common/config/MybatisPlusConfig.java"
    click RedisCfg "https://github.com/fushengqian/fuint/blob/master/fuint-application/src/main/java/com/fuint/common/config/RedisConfig.java"
    click Payment "https://github.com/fushengqian/fuint/blob/master/fuint-application/src/main/java/com/fuint/common/bean/AliPayBean.java"
    click SMS "https://github.com/fushengqian/fuint/blob/master/fuint-application/src/main/java/com/fuint/common/service/SendSmsService.java"
    click Printer "https://github.com/fushengqian/fuint/blob/master/fuint-application/src/main/java/com/fuint/common/service/PrinterService.java"
    click vm "https://github.com/fushengqian/fuint/tree/master/fuint-application/src/main/resources/vm"

    %% Styles
    classDef frontend fill:#cce5ff,stroke:#004085,color:#004085
    classDef service fill:#d4edda,stroke:#155724,color:#155724
    classDef repository fill:#fff3cd,stroke:#856404,color:#856404
    classDef infrastructure fill:#e2e3e5,stroke:#6c757d,color:#6c757d
```
