# linlccc/easy architecture

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

- Interactive diagram: https://gitdiagram.com/linlccc/easy
- Repository: https://github.com/linlccc/easy

## Overview

##### Project type and purpose
- This is an open-source .NET “Easy” monorepo containing:
- A suite of framework libraries (Easy.Common, Easy.Extensions, DI abstractions & implementation, DynamicProxy)
- Two CLI/tools (IgnoreAccessChecks, MergeJson)
- MSBuild import/automation scripts (easyMSBuildImport)
- Tests and documentation for each component
- Its goal is to provide common utilities, extension methods, DI enhancements, dynamic proxy support, and build‐time tools.

##### File structure
- Top-level folders/files:
- easyMSBuildImport/… → custom MSBuild props & targets to auto-import and publish NuGet packages
- framework/… → each subdirectory is either a library or a tool (with src/ and tests/)
- readmes/… → markdown docs per component
- nuget.exe → CLI helper for listing packages
- Each framework/Easy.* subfolder contains a .sln, a src project, and tests → indicating per-component micro-library architecture
- Tools under framework/Easy.Tool.* follow the same pattern with src/build files and tests

##### README for additional insights
- The root README provides a high-level index of “架构” (framework extensions, DI abstractions, etc.) and “工具” (Json merge tool, ignore-access tool)
- It describes publishing tasks via MSBuild targets

a. Main components
- Build automation layer (easyMSBuildImport + Directory.Build.props/targets)
- Core utilities library (Easy.Common)
- Extension libraries (Easy.Extensions)
- DI abstraction library (Easy.Extensions.DependencyInjection.Abstractions)
- DI implementation library (Easy.Extensions.DependencyInjection)
- Dynamic proxy engine (Easy.Extensions.DynamicProxy)
- Tools:
– Easy.Tool.MergeJson
– Easy.Tool.IgnoresAccessChecks
- Test projects (per library/tool)
- Documentation site (readmes)
b. Relationships and interactions
- easyMSBuildImport → loaded by all projects at build time → automates package versioning & publishing
- Easy.Extensions depends on Easy.Common
- DI implementation depends on both DI.Abstractions and Easy.Common
- DynamicProxy may be used by DI implementation for AOP scenarios
- Tools reference none of the above libraries at runtime but each has its own build props/targets from easyMSBuildImport
- Test projects reference their corresponding src projects
c. Architectural patterns and principles
- Modular monorepo: each library/tool is isolated with its own solution, source, and tests
- Convention-based MSBuild extension: all projects share props/targets in easyMSBuildImport
- Dependency Injection pattern: clear separation of abstractions vs implementations
- Aspect-Oriented Programming with DynamicProxy
d. Key technologies
- .NET SDK-style projects, C#
- MSBuild Props & Targets customization
- NuGet packaging and publishing
- Reflection.Emit for proxy generation
- JSON merging via custom CLI tool

##### Final advice
- Modules and their inter-dependencies without over-splitting
- Both build-time (easyMSBuildImport) and run-time flows (library references, tool inputs/outputs)

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Build Automation Layer
    subgraph "Build Automation Layer"
        BA1["Directory.Build.props"]:::build
        BA2["Directory.Build.targets"]:::build
        BA3["easyMSBuildImport"]:::build
    end

    %% Core Utilities
    subgraph "Core Utilities"
        EC["Easy.Common"]:::core
    end

    %% Extension Libraries
    subgraph "Extension Libraries"
        EX["Easy.Extensions"]:::core
    end

    %% DI Abstractions
    subgraph "DI Abstractions"
        DIA["Easy.Extensions.DependencyInjection.Abstractions"]:::di
    end

    %% DI Implementation
    subgraph "DI Implementation"
        DI["Easy.Extensions.DependencyInjection"]:::di
    end

    %% Dynamic Proxy Engine
    subgraph "Dynamic Proxy Engine"
        DP["Easy.Extensions.DynamicProxy"]:::proxy
    end

    %% Tools
    subgraph "CLI Tools"
        TM["Easy.Tool.MergeJson"]:::tool
        TI["Easy.Tool.IgnoresAccessChecks"]:::tool
    end

    %% Tests
    subgraph "Test Projects"
        TEC["Easy.Common Tests"]:::test
        TEX["Easy.Extensions Tests"]:::test
        TDIA["DI Abstractions Tests"]:::test
        TDI["DI Implementation Tests"]:::test
        TDP["DynamicProxy Tests"]:::test
        TTM["MergeJson Tests"]:::test
        TTI["IgnoresAccessChecks Tests"]:::test
    end

    %% Documentation
    DOC["Documentation (readmes)"]:::docs

    %% Relationships: Build-time
    BA3 -->|"imported by"| EC
    BA3 -->|"imported by"| EX
    BA3 -->|"imported by"| DIA
    BA3 -->|"imported by"| DI
    BA3 -->|"imported by"| DP
    BA3 -->|"imported by"| TM
    BA3 -->|"imported by"| TI
    BA1 -->|"applies to all projects"| EC
    BA2 -->|"applies to all projects"| EC

    %% Runtime Dependencies
    EC -->|"used by"| EX
    EC -->|"used by"| DI
    DIA -->|"abstractions for"| DI
    DP -->|"optional AOP for"| DI

    %% Test References
    TEC -->|"tests"| EC
    TEX -->|"tests"| EX
    TDIA -->|"tests"| DIA
    TDI -->|"tests"| DI
    TDP -->|"tests"| DP
    TTM -->|"tests"| TM
    TTI -->|"tests"| TI

    %% Documentation Links
    DOC -->|"docs for"| EC
    DOC -->|"docs for"| EX
    DOC -->|"docs for"| DIA
    DOC -->|"docs for"| DI
    DOC -->|"docs for"| DP
    DOC -->|"docs for"| TM
    DOC -->|"docs for"| TI

    %% Click Events
    click BA1 "https://github.com/linlccc/easy/blob/main/Directory.Build.props"
    click BA2 "https://github.com/linlccc/easy/blob/main/Directory.Build.targets"
    click BA3 "https://github.com/linlccc/easy/tree/main/easyMSBuildImport/"
    click EC "https://github.com/linlccc/easy/tree/main/framework/Easy.Common/src/"
    click EX "https://github.com/linlccc/easy/tree/main/framework/Easy.Extensions/src/"
    click DIA "https://github.com/linlccc/easy/tree/main/framework/Easy.Extensions.DependencyInjection.Abstractions/src/"
    click DI "https://github.com/linlccc/easy/tree/main/framework/Easy.Extensions.DependencyInjection/src/"
    click DP "https://github.com/linlccc/easy/tree/main/framework/Easy.Extensions.DynamicProxy/src/"
    click TM "https://github.com/linlccc/easy/tree/main/framework/Easy.Tool.MergeJson/src/"
    click TI "https://github.com/linlccc/easy/tree/main/framework/Easy.Tool.IgnoresAccessChecks/src/Easy.Tool.IgnoresAccessChecks/"
    click DOC "https://github.com/linlccc/easy/tree/main/readmes/"

    %% Styles
    classDef build fill:#cccccc,stroke:#333,stroke-width:1px;
    classDef core fill:#a3d5ff,stroke:#036,stroke-width:1px;
    classDef di fill:#c2f0c2,stroke:#036,stroke-width:1px;
    classDef proxy fill:#dfc2ff,stroke:#036,stroke-width:1px;
    classDef tool fill:#ffd1a3,stroke:#036,stroke-width:1px;
    classDef test fill:#f0f0f0,stroke:#999,stroke-width:1px;
    classDef docs fill:#fff2a8,stroke:#993,stroke-width:1px;
```
