# fe3dback/go-arch-lint architecture

> Architecture diagram of the GitHub repository fe3dback/go-arch-lint, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-02-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/fe3dback/go-arch-lint
- Repository: https://github.com/fe3dback/go-arch-lint

## Overview

##### Main Components

a) Core Components:
- CLI Interface Layer
- Operation Handlers
- Services Layer
- Models Layer
- Internal Container (DI)

b) Key Services:
- Checker Service
- Project Service
- Spec Service
- Render Service
- Schema Service

**┌─ CLI Layer (Entry Point) ─────────────────────────────────────┐**

- ┌─ Operations Layer ──────────────────────────────────────┐  │

- ┌─ Services Layer ─────────────────────────────────┐  │  │

- ┌─ Core Services ───────────────────────────┐  │  │  │
- Checker                                 │  │  │  │
- Project                                │  │  │  │
- Spec                                   │  │  │  │
- Render                                 │  │  │  │
- Schema                                │  │  │  │
- ┘  │  │  │

- ┌─ Models Layer ────────────────────────────┐ │  │  │
- Arch Models                             │ │  │  │
- Common Models                           │ │  │  │
- Operation Models                        │ │  │  │
- ┘  │  │
- ┘  │
- ┘  │
- ┘

##### Interaction Flows

- Command flow from CLI → Operations → Services
- Data flow between Services
- Model usage across layers
- File system interactions for reading project files
- Output rendering flow

##### Implementation Details

- Container (DI) system
- Command pattern implementation
- Service interfaces
- Model relationships
- File system interactions

##### External Dependencies

Integration points with:
- Go standard library (for AST parsing)
- YAML/JSON parsers
- Graph generation tools
- File system

##### Configuration flow

This architecture represents a well-structured Go application following clean architecture principles, with clear separation of concerns and dependency rules.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph CLI
        CLI_ENTRY["CLI Interface"]:::cli
    end

    subgraph Operations
        OP_HANDLERS["Operation Handlers"]:::operations
    end

    subgraph Services
        subgraph CoreServices
            CHECKER["Checker Service"]:::service
            PROJECT["Project Service"]:::service
            SPEC["Spec Service"]:::service
            RENDER["Render Service"]:::service
            SCHEMA["Schema Service"]:::service
        end

        subgraph SupportServices
            COMMON["Common Utilities"]:::support
            AST["AST Analysis"]:::support
            YAML["YAML Processing"]:::support
        end
    end

    subgraph Models
        ARCH_MODELS["Arch Models"]:::model
        COMMON_MODELS["Common Models"]:::model
        OP_MODELS["Operation Models"]:::model
    end

    subgraph Container
        DI["Dependency Injection"]:::container
    end

    subgraph Views
        TEMPLATES["View Templates"]:::view
    end

    %% Relationships
    CLI_ENTRY --> OP_HANDLERS
    OP_HANDLERS --> |Uses| CoreServices
    CoreServices --> |Uses| SupportServices
    CoreServices --> |Uses| Models
    RENDER --> TEMPLATES
    DI --> CoreServices
    DI --> SupportServices

    %% Click events
    click CLI_ENTRY "https://github.com/fe3dback/go-arch-lint/blob/master/internal/app/cli.go"
    click OP_HANDLERS "https://github.com/fe3dback/go-arch-lint/tree/master/internal/operations/"
    click CHECKER "https://github.com/fe3dback/go-arch-lint/tree/master/internal/services/checker/"
    click PROJECT "https://github.com/fe3dback/go-arch-lint/tree/master/internal/services/project/"
    click SPEC "https://github.com/fe3dback/go-arch-lint/tree/master/internal/services/spec/"
    click RENDER "https://github.com/fe3dback/go-arch-lint/tree/master/internal/services/render/"
    click SCHEMA "https://github.com/fe3dback/go-arch-lint/tree/master/internal/services/schema/"
    click COMMON "https://github.com/fe3dback/go-arch-lint/tree/master/internal/services/common/"
    click AST "https://github.com/fe3dback/go-arch-lint/tree/master/internal/services/common/ast/"
    click YAML "https://github.com/fe3dback/go-arch-lint/tree/master/internal/services/common/yaml/"
    click TEMPLATES "https://github.com/fe3dback/go-arch-lint/tree/master/internal/view/"
    click DI "https://github.com/fe3dback/go-arch-lint/tree/master/internal/app/internal/container/"
    click Models "https://github.com/fe3dback/go-arch-lint/tree/master/internal/models/"

    %% Styles
    classDef cli fill:#2374ab
    classDef operations fill:#ffd166
    classDef service fill:#2a9d8f
    classDef support fill:#95a5a6
    classDef model fill:#f4a261
    classDef container fill:#6c757d
    classDef view fill:#e9c46a

    %% Legend
    subgraph Legend
        L_CLI["CLI Layer"]:::cli
        L_OP["Operations"]:::operations
        L_SVC["Services"]:::service
        L_SUP["Support"]:::support
        L_MOD["Models"]:::model
        L_CON["Container"]:::container
        L_VIEW["Views"]:::view
    end
```
