# ysgstudyhards/fastframework architecture

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

- Interactive diagram: https://gitdiagram.com/ysgstudyhards/fastframework
- Repository: https://github.com/ysgstudyhards/fastframework

## Overview

##### Project type and purpose
- This is a .NET-based rapid development framework (“FastFramework”) plus a sample platform implementation (“DotNetGuideBlog”).
- It’s a layered, full-stack solution: core libraries, shared utilities, and a sample multi-layer web API (DAL, BLL, Repository, Model, WebAPI). It integrates authentication/authorization (JWT, RBAC), data access (EF Core, Dapper), DI (Autofac), logging (Serilog → ELK), caching (Redis), scheduling (Quartz.NET), and a front-end (uni-app/Vben Admin).

##### File structure
- Top-level:
- Core/FastFramework.Core → framework’s core services, abstractions, interfaces
- Shared/FastFramework.Shared → common DTOs, constants, shared helpers
- Platforms/DotNetGuideBlog → sample platform with subprojects:
– DotNetGuideBlogModel (entity definitions)
– DotNetGuideBlogDAL (EF Core + Dapper data context & migrations)
– DotNetGuideBlogRepository (repository implementations)
– DotNetGuideBlogBLL (business logic layer, service interfaces + implementations)
– DotNetGuideBlogWebAPI (ASP.NET Core Web API exposing HTTP endpoints)
- FastFramework.sln ties them all together

##### README insights
- Confirms .NET 8 stack, integrated modules (RBAC, JWT, logging, ELK, config center), plus recommended front-end tech (uni-app, Vben Admin).

##### Detail
- Middleware pipeline: Authentication → Logging → Rate Limit → Routing.
- Both EF Core and Dapper flows to the database.
- Background job scheduler (Quartz) calling into BLL.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Front-end slice
    subgraph "Front-end"
        UA["uni-app (Mobile/Web)"]:::frontend
        VB["Vben Admin SPA"]:::frontend
    end

    %% Back-end slice
    subgraph "Back-end"
        subgraph "Web API Layer"
            Ctl["Controllers"]:::backend
            Mid["Middleware Pipeline"]:::backend
            Prog["Program & Startup"]:::backend
            Config["Configuration (appsettings)"]:::backend
            Scripts["HTTP Test Scripts"]:::backend
        end
        subgraph "Business Logic Layer"
            BLLSvc["Service Interfaces & Implementations"]:::backend
        end
        subgraph "Repository Layer"
            RepoImp["Repository Implementations"]:::backend
        end
        subgraph "Data Access Layer"
            EF["EF Core & Dapper Context"]:::backend
        end
        subgraph "Domain Models"
            DM["Entity Definitions"]:::backend
        end
        Core["Core Framework Services"]:::core
        Shared["Shared Utilities"]:::core
        Scheduler["Quartz.NET Scheduler"]:::core
    end

    %% Datastores & External
    MySQL["MySQL"]:::db
    Redis["Redis Cache/RateLimit Store"]:::db
    MongoDB["MongoDB"]:::db
    ELKCluster["Elasticsearch Cluster"]:::external
    JWTIssuer["JWT Issuer"]:::external
    ELKStack["ELK (Logstash/Kibana)"]:::external

    %% Infrastructure
    infra["Docker & Kubernetes"]:::infra

    %% Solution
    SLN["FastFramework.sln"]:::solution

    %% Connections - Front-end to WebAPI
    UA -->|"HTTP/HTTPS"| Ctl
    VB -->|"HTTP/HTTPS"| Ctl

    %% WebAPI Pipeline
    Ctl -->|"invoke"| Mid
    Mid -->|"JWT Validation"| JWTIssuer
    Mid -->|"Logging"| ELKStack
    Mid -->|"Rate Limiting"| Redis
    Mid -->|"config from"| Config
    Prog -->|"sets up DI & Middleware"| Mid

    %% WebAPI to BLL
    Ctl -->|"calls"| BLLSvc
    BLLSvc -->|"uses"| RepoImp

    %% Repository to DAL
    RepoImp -->|"uses"| EF
    EF -->|"reads/writes"| MySQL
    EF -->|"caching"| Redis
    EF -->|"optional store"| MongoDB

    %% Scheduler
    Scheduler -->|"triggers jobs on"| BLLSvc
    BLLSvc -->|"schedule tasks via"| Scheduler

    %% Logging funnel
    Ctl -->|"logs"| ELKCluster
    BLLSvc -->|"logs"| ELKCluster
    RepoImp -->|"logs"| ELKCluster
    EF -->|"logs"| ELKCluster
    Scheduler -->|"logs"| ELKCluster

    %% Core & Shared consumption
    Core --> Ctl
    Core --> BLLSvc
    Core --> RepoImp
    Core --> EF
    Shared --> Ctl
    Shared --> BLLSvc
    Shared --> RepoImp
    Shared --> EF

    %% Infrastructure grouping
    infra --- Back-end
    infra --- UA
    infra --- VB

    %% Solution file ties all
    SLN --> Core
    SLN --> Shared
    SLN --> DM
    SLN --> EF
    SLN --> RepoImp
    SLN --> BLLSvc
    SLN --> Ctl
    SLN --> Prog
    SLN --> Config

    %% Click Events
    click Core "https://github.com/ysgstudyhards/fastframework/blob/main/Core/FastFramework.Core/FastFramework.Core.csproj"
    click Shared "https://github.com/ysgstudyhards/fastframework/blob/main/Shared/FastFramework.Shared/FastFramework.Shared.csproj"
    click DM "https://github.com/ysgstudyhards/fastframework/blob/main/Platforms/DotNetGuideBlog/DotNetGuideBlogModel/DotNetGuideBlogModel.csproj"
    click EF "https://github.com/ysgstudyhards/fastframework/blob/main/Platforms/DotNetGuideBlog/DotNetGuideBlogDAL/DotNetGuideBlogDAL.csproj"
    click RepoImp "https://github.com/ysgstudyhards/fastframework/blob/main/Platforms/DotNetGuideBlog/DotNetGuideBlogRepository/DotNetGuideBlogRepository.csproj"
    click BLLSvc "https://github.com/ysgstudyhards/fastframework/blob/main/Platforms/DotNetGuideBlog/DotNetGuideBlogBLL/DotNetGuideBlogBLL.csproj"
    click Ctl "https://github.com/ysgstudyhards/fastframework/blob/main/Platforms/DotNetGuideBlog/DotNetGuideBlogWebAPI/Controllers/WeatherForecastController.cs"
    click Prog "https://github.com/ysgstudyhards/fastframework/blob/main/Platforms/DotNetGuideBlog/DotNetGuideBlogWebAPI/Program.cs"
    click Config "https://github.com/ysgstudyhards/fastframework/blob/main/Platforms/DotNetGuideBlog/DotNetGuideBlogWebAPI/appsettings.json"
    click Scripts "https://github.com/ysgstudyhards/fastframework/blob/main/Platforms/DotNetGuideBlog/DotNetGuideBlogWebAPI/DotNetGuideBlogWebAPI.http"
    click SLN "https://github.com/ysgstudyhards/fastframework/blob/main/FastFramework.sln"

    %% Styles
    classDef frontend fill:#D0E8FF,stroke:#0366d6,color:#0366d6;
    classDef backend fill:#E8F4D0,stroke:#2E8B57,color:#2E8B57;
    classDef core fill:#FFF4D0,stroke:#DAA520,color:#DAA520;
    classDef db fill:#D0FFD6,stroke:#228B22,color:#228B22;
    classDef external fill:#FFE8D0,stroke:#FF8C00,color:#FF8C00;
    classDef infra stroke-dasharray: 5 5,fill:none,stroke:#A9A9A9,color:#A9A9A9;
    classDef solution fill:#F0F0F0,stroke:#808080,color:#404040;
```
