# dragee-io/clean-asserter architecture

> Architecture diagram of the GitHub repository dragee-io/clean-asserter, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dragee-io/clean-asserter
- Repository: https://github.com/dragee-io/clean-asserter

## Overview

##### Main Components

A. Core Components:
- Rules Engine (Central component)
- Controller Rules Validator
- Presenter Rules Validator
- Use Case Rules Validator

B. Supporting Components:
- Clean Model Definition
- Test Framework
- Documentation Generator

**┌─────────────────────────────────────────────┐**
- Clean Asserter                 │
- ┤

- ┌─────────────┐    ┌──────────────────┐   │
- Rules      │    │   Clean Model    │   │
- Engine     │────│   Definition     │   │
- ┘    └──────────────────┘   │

- ▼                                   │
- ┌─────────────────────────────────────┐   │
- Validation Rules             │   │
- ┬────────────┬─────────┤   │
- Controller  │ Presenter  │ Use Case│   │
- Rules     │   Rules    │  Rules  │   │
- ┴────────────┴─────────┘   │

- ┘

##### Important Elements to Highlight

a. Rules Implementation:
- How the three main rule types (Controller, Presenter, Use Case) interact
- Mandatory dependencies validation flow
- Allowed dependencies validation flow

b. Testing Framework:
- Test cases validation flow
- How rule validation results are processed

##### Specific Implementation Details

- Rule validation process
- Clean architecture principle enforcement
- Test case execution flow
- Documentation generation pipeline

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Clean_Asserter
        RE[Rules Engine]:::core
        CMD[Clean Model Definition]:::core
        click CMD "https://github.com/dragee-io/clean-asserter/blob/main/src/clean.model.ts"

        subgraph Validation_Rules
            CRV[Controller Rules Validator]:::validator
            PRV[Presenter Rules Validator]:::validator
            URV[Use Case Rules Validator]:::validator
            click CRV "https://github.com/dragee-io/clean-asserter/blob/main/src/rules/controller-mandatory-dependencies.rule.ts"
            click PRV "https://github.com/dragee-io/clean-asserter/blob/main/src/rules/presenter-mandatory-dependencies.rule.ts"
            click URV "https://github.com/dragee-io/clean-asserter/blob/main/src/rules/use-case-allowed-dependencies.rule.ts"
        end

        subgraph Testing_Framework
            TS[Main Test Suite]:::test
            CT[Controller Tests]:::test
            PT[Presenter Tests]:::test
            UT[Use Case Tests]:::test
            TU[Test Utilities]:::test
            click TS "https://github.com/dragee-io/clean-asserter/blob/main/src/test/clean-asserter.spec.ts"
            click CT "https://github.com/dragee-io/clean-asserter/blob/main/src/test/clean/controller-rules/controller-rules.spec.ts"
            click PT "https://github.com/dragee-io/clean-asserter/blob/main/src/test/clean/presenter-rules/presenter-rules.spec.ts"
            click UT "https://github.com/dragee-io/clean-asserter/blob/main/src/test/test_utils.ts"
            click UT "https://github.com/dragee-io/clean-asserter/blob/main/src/test/clean/use-case-rules/use-case-rules.spec.ts"
        end

        subgraph Documentation
            TD[TypeDoc Config]:::doc
            GD[Generated Docs]:::doc
            AD[API Documentation]:::doc
            click TD "https://github.com/dragee-io/clean-asserter/blob/main/typedoc.json"
            click GD "https://github.com/dragee-io/clean-asserter/tree/main/docs/"
            click AD "https://github.com/dragee-io/clean-asserter/tree/main/docs/modules"
        end

        subgraph CI_CD
            PR["PR Checks"]:::cicd
            PB["Publishing"]:::cicd
            click PR "https://github.com/dragee-io/clean-asserter/blob/main/.github/workflows/pr-check.yml"
            click PB "https://github.com/dragee-io/clean-asserter/blob/main/.github/workflows/publish.yml"
        end

        RE --> CMD
        RE --> Validation_Rules
        CRV & PRV & URV --> TS
        TS --> CT & PT & UT
        RE --> Documentation
        TD --> GD
        GD --> AD
        RE --> CI_CD
        PR --> PB
    end

    classDef core fill:#3498db,stroke:#2980b9,color:white
    classDef validator fill:#2ecc71,stroke:#27ae60,color:white
    classDef test fill:#e74c3c,stroke:#c0392b,color:white
    classDef doc fill:#9b59b6,stroke:#8e44ad,color:white
    classDef cicd fill:#f1c40f,stroke:#f39c12,color:black

    %% Legend
    subgraph Legend
        C1[Core Components]:::core
        V1[Validators]:::validator
        T1[Test Components]:::test
        D1[Documentation]:::doc
        CI1[CI/CD]:::cicd
    end
```
