# jkxyx205/sharp-project architecture

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

- Interactive diagram: https://gitdiagram.com/jkxyx205/sharp-project
- Repository: https://github.com/jkxyx205/sharp-project

## Overview

The overall project is a multi-module Java “suite” of libraries and applications that together offer a range of reusable components for tasks such as database operations, Excel processing, file upload, custom form handling, reporting, meta (dictionary/KV) management, mail, SMS, and more. In essence, it is a composite project that demonstrates how to build modular, auto-configurable Java components (using Spring Boot auto‐configuration and Maven as the build system) that can be selectively used either independently or in an integrated application (for example, via the “sharp-admin” or “sharp-demo” modules).

##### Main components
- Modules/libraries – Each “sharp-…” folder (e.g., sharp-database, sharp-excel, sharp-meta, sharp-fileupload, sharp-formflow, sharp-report, sharp-sms, sharp-mail, etc.) is a distinct component. These modules provide specialised services:
– sharp-database: A lightweight persistence/query tool based on JdbcTemplate (and compatible with MyBatis and JPA) that supports MySQL and Oracle.
– sharp-excel: A module for reading/writing Excel files using Apache POI.
– sharp-meta: Handles dictionary and key–value property management.
– sharp-fileupload: A JAX-RS–style file upload solution with support for local storage, FastDFS, and OSS.
– sharp-formflow: A customizable, user-defined form framework (with support for various form controls such as text, multi-select, date, file, etc.).
– sharp-report: A reporting and query tool designed to create report query models.
– Other modules (sharp-admin, sharp-demo, sharp-common, sharp-generator, etc.) serve either as examples, administrative interfaces, or support libraries.

##### Relationships and interactions
- The core libraries (sharp-common, sharp-database, sharp-meta, etc.) form the foundation and are used by higher-level modules. For example:
– sharp-admin and sharp-demo rely on the common library for shared utilities and automatically configured Spring Boot components.
– The auto-configuration files (spring.factories) in most modules indicate that these modules use Spring Boot’s auto-configuration mechanism. Represent an “Auto-Configuration” layer that scans these modules.
- That the presentation components (web controllers in sharp-admin, sharp-demo) trigger business logic provided by specialized modules – for instance, when a user uploads a file, the request is routed through sharp-fileupload’s RESTful APIs, then it interacts with the storage abstraction (local/FastDFS/OSS) implemented within that module.
- Similarly, for Excel operations, there is an interaction from the service/controller layers (possibly in demo or admin modules) to the sharp-excel module.

##### Architectural patterns and design principles
- Modularity: Each feature is encapsulated in its own Maven module, which makes the design highly modular. Emphasize this by drawing each module as an individual component.
- Auto-Configuration and Dependency Injection: Most modules are Spring Boot–based (evidenced by spring.factories files and auto-configuration classes). Represent that each module contributes beans that are automatically integrated.
- Separation of concerns: Notice that data access (sharp-database), presentation (sharp-admin, sharp-demo), file operations (sharp-fileupload) and business logic (sharp-formflow, sharp-report) are clearly separated.

##### Relevant technologies, frameworks, or libraries
- Spring Boot – underpinning most modules via auto-configuration.
- Maven – for dependency management and module coordination.
- Apache POI – for Excel handling in sharp-excel.
- JdbcTemplate (and optionally MyBatis) – for database operations in sharp-database.
- Third-party integrations (OSS, FastDFS) – in the sharp-fileupload module.
- Various validation, security, and web libraries used in sharp-admin and sharp-demo.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Auto-Configuration Layer
    subgraph "Auto-Configuration Platform"
        auto["Spring Boot Auto-Configuration"]:::auto
    end

    %% Presentation Layer
    subgraph "Presentation Layer"
        admin["sharp-admin: Administrative Interface"]:::presentation
        demo["sharp-demo: Demonstration Application"]:::presentation
    end

    %% Business Logic Layer
    subgraph "Business Logic Layer"
        formflow["sharp-formflow: Custom Form Handling"]:::business
        report["sharp-report: Reporting and Query Tool"]:::business
        meta["sharp-meta: Meta/Dictionary Management"]:::business
        excel["sharp-excel: Excel Processing"]:::business
    end

    %% Data Access Layer
    subgraph "Data Access Layer"
        database["sharp-database: Database Operations"]:::data
        fileupload["sharp-fileupload: File Upload Service"]:::data
        common["sharp-common: Common/Support Libraries"]:::data
    end

    %% Integration / External Services
    subgraph "Integration / External Services"
        mail["sharp-mail: Mail Integration"]:::integration
        sms["sharp-sms: SMS Functionality"]:::integration
    end

    %% Developer Tools
    subgraph "Developer Tools"
        generator["sharp-generator: Code/Component Generator"]:::devtools
    end

    %% Relationships from Auto-Configuration to Core Common
    auto -->|"auto-configures"| common

    %% Presentation Layer interactions with Business Logic and Data Access
    admin -->|"calls"| formflow
    admin -->|"calls"| report
    admin -->|"calls"| meta
    admin -->|"uploads"| fileupload

    demo -->|"calls"| excel
    demo -->|"calls"| formflow
    demo -->|"calls"| report
    demo -->|"queries"| database
    demo -->|"uploads"| fileupload

    %% Business Logic dependencies on Common
    formflow -->|"uses"| common
    report -->|"uses"| common
    meta -->|"uses"| common
    excel -->|"uses"| common

    %% Data Access dependencies on Common
    database -->|"uses"| common
    fileupload -->|"uses"| common

    %% Integration modules using Common libraries
    mail -->|"uses"| common
    sms -->|"uses"| common

    %% Developer Tools interaction (optional dependency on Common)
    generator -->|"generates based on"| common

    %% Styling for layers
    classDef auto fill:#e4c1f9,stroke:#333,stroke-width:2px;
    classDef presentation fill:#a2d3f9,stroke:#333,stroke-width:2px;
    classDef business fill:#f9f7a2,stroke:#333,stroke-width:2px;
    classDef data fill:#a2f9af,stroke:#333,stroke-width:2px;
    classDef integration fill:#f9a2a2,stroke:#333,stroke-width:2px;
    classDef devtools fill:#d3a9f9,stroke:#333,stroke-width:2px;

    %% Click Events
    click database "https://github.com/jkxyx205/sharp-project/tree/master/sharp-database"
    click excel "https://github.com/jkxyx205/sharp-project/tree/master/sharp-excel"
    click meta "https://github.com/jkxyx205/sharp-project/tree/master/sharp-meta"
    click fileupload "https://github.com/jkxyx205/sharp-project/tree/master/sharp-fileupload"
    click formflow "https://github.com/jkxyx205/sharp-project/tree/master/sharp-formflow"
    click report "https://github.com/jkxyx205/sharp-project/tree/master/sharp-report"
    click mail "https://github.com/jkxyx205/sharp-project/tree/master/sharp-mail"
    click sms "https://github.com/jkxyx205/sharp-project/tree/master/sharp-sms"
    click admin "https://github.com/jkxyx205/sharp-project/tree/master/sharp-admin"
    click demo "https://github.com/jkxyx205/sharp-project/tree/master/sharp-demo"
    click common "https://github.com/jkxyx205/sharp-project/tree/master/sharp-common"
    click generator "https://github.com/jkxyx205/sharp-project/tree/master/sharp-generator"
```
