# nanfengovo/overallauth-webapi architecture

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

- Interactive diagram: https://gitdiagram.com/nanfengovo/overallauth-webapi
- Repository: https://github.com/nanfengovo/overallauth-webapi

## Overview

##### Main Components
- Frontend: Represent the overallauth2.0-vue project as a Vue-based client that handles the presentation and user interactions for login, menu display, and panel/dashboard.
- API Gateway / Controllers: In the OverallAuth-WebApi project, the Controllers directory houses the REST endpoints (for example, the controllers under Sys for menus and users).
- Plug-in System: The “PlugIn” folder in OverallAuth-WebApi shows that the system uses cross-cutting plugins (for AOP, exception handling, JWT, Swagger, etc.). This is a key architectural element to capture.
- Business & Domain Layer:
– CoreDomain contains core business logic (e.g., MenuCore in BusinessCore).
– DomainService encapsulates business services and defines interfaces (like ISysMenuService and ISysUserService) along with service implementations.
- Data Access Layer (Infrastructure):
– The Infrastructure folder shows repository implementations (e.g., SysMenuRepository, SysUserRepository) and database connectivity (with accompanying SQL files).
- Model: The Model folder contains business and domain models that represent the data structure used across the solution.
- Utility: Contains common utilities (like enumerations, exception handling helpers) that are used by other components.
- External Services & Settings: This includes configuration files (appsettings.json, JwtSettingModel.cs) which indicate use of JWT for authentication and potentially other external services.

– A “Controllers” component for handling incoming HTTP requests.
– “CoreDomain” (holding business logic and core functionalities)
– “DomainService” (providing services such as SysMenuService and SysUserService)
Controllers to the DomainService, and from there to CoreDomain.
- “Model” and “Utility” components side by side. Explain that:
– “Utility” provides common enumerations, helper functions, and error/exception handling.
- Optionally, indicate external configuration (JWT settings, database connection strings) that influence several layers.

##### Architectural Patterns/Principles
- Layered Architecture: Clearly separate presentation (controllers and frontend), business/domain logic, and data access.
- Dependency Inversion: Interfaces in DomainService and IRepository indicate a decoupled design where higher-level modules depend on abstractions.
- Plug-In/Extensibility: The PlugIn folder shows a design that supports cross-cutting concerns.
- Separation of Concerns: Distinct projects handle business rules (CoreDomain, DomainService), data models (Model), and infrastructure (Infrastructure).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend
    A["Vue Frontend (overallauth2.0-vue)"]:::frontend

    %% Backend
    subgraph "OverallAuth-WebApi Backend (.NET Web API)"
        %% API Controllers and PlugIn
        B["API Controllers"]:::backend
        C["Plug–in System (Middleware)"]:::middleware

        %% Business & Domain Layer
        subgraph "Business & Domain Layer"
            D["Core Domain (Business Logic)"]:::business
            E["Domain Service (Interfaces/Implementations)"]:::business
        end

        %% Data Access Layer
        F["Infrastructure (Data Access/Repositories)"]:::data

        %% External Configurations
        G["External Config (JWT/appsettings)"]:::external
    end

    %% Other Components
    H["Model (Data Structures)"]:::model
    I["Utility (Helpers/Enums)"]:::utility
    J(["Database (SQL)"]):::database

    %% Connections
    A -->|"api call"| B
    B -->|"uses"| C
    B -->|"delegates to"| E
    C -->|"applies cross-cutting"| B
    E -->|"invokes"| D
    E -->|"persists data"| F
    F -->|"queries/inserts data"| J
    E -->|"maps to"| H
    E -->|"validates/handles"| I
    G ---|"configures"| B
    G ---|"configures"| E
    G ---|"configures"| F

    %% Styles
    classDef frontend fill:#ffcc00,stroke:#333,stroke-width:2px;
    classDef backend fill:#99ccff,stroke:#333,stroke-width:2px;
    classDef middleware fill:#ccffcc,stroke:#333,stroke-width:2px;
    classDef business fill:#ff99cc,stroke:#333,stroke-width:2px;
    classDef data fill:#99ffff,stroke:#333,stroke-width:2px;
    classDef model fill:#ffcc99,stroke:#333,stroke-width:2px;
    classDef utility fill:#cccccc,stroke:#333,stroke-width:2px;
    classDef external fill:#ff9999,stroke:#333,stroke-width:2px;
    classDef database fill:#ccccff,stroke:#333,stroke-width:2px;

    %% Click Events
    click A "https://github.com/nanfengovo/overallauth-webapi/blob/main/overallauth2.0-vue"
    click B "https://github.com/nanfengovo/overallauth-webapi/tree/main/OverallAuth-WebApi/Controllers"
    click C "https://github.com/nanfengovo/overallauth-webapi/tree/main/OverallAuth-WebApi/PlugIn"
    click D "https://github.com/nanfengovo/overallauth-webapi/blob/main/CoreDomain/BusinessCore/MenuCore.cs"
    click E "https://github.com/nanfengovo/overallauth-webapi/tree/main/DomainService"
    click F "https://github.com/nanfengovo/overallauth-webapi/tree/main/Infrastructure"
    click H "https://github.com/nanfengovo/overallauth-webapi/tree/main/Model"
    click I "https://github.com/nanfengovo/overallauth-webapi/tree/main/Utility"
    click G "https://github.com/nanfengovo/overallauth-webapi/blob/main/OverallAuth-WebApi/Model/JwtSettingModel.cs"
```
