# clj-commons/pretty architecture

> Architecture diagram of the GitHub repository clj-commons/pretty, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/clj-commons/pretty
- Repository: https://github.com/clj-commons/pretty

## Overview

##### Main Components

a. Core Formatting Modules:
- Exception Formatting Module
- Binary Data Formatting Module
- Table Formatting Module
- Pretty REPL Module

b. Supporting Components:
- Specs/Validation Layer
- Implementation Details
- Test Framework

**┌─ API Layer ─────────────────────────────────┐**

- Public Interface (clj-commons.*)           │

- Core Formatting Modules ──────────────────┤

- ┌─────────┐ ┌──────────┐ ┌────────────┐ │
- ANSI   │ │Exception │ │   Binary   │ │
- Support │ │Formatting│ │ Formatting │ │
- ┘ └──────────┘ └────────────┘ │

- ┌─────────┐ ┌──────────┐               │
- Table  │ │  Pretty  │               │
- Formatter│ │   REPL   │               │
- ┘ └──────────┘               │

- Support Layer ───────────────────────────┤

- ┌─────────┐ ┌──────────┐               │
- Specs  │ │   Core   │               │
- Impl   │               │
- ┘ └──────────┘               │
- ┘

##### Key Relationships to Highlight

- How the public API interfaces with each formatting module
- Dependency on the specs layer for validation
- Relationship between the implementation and the public interfaces

##### Implementation Details

- Related functionality (e.g., format/*, pretty/*)
- How the specs (specs.clj) relate to their respective modules
- Test coverage for each component

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph API
        PublicAPI["Public Interface (clj-commons.*)"]:::api
    end

    subgraph CoreModules
        ANSI["ANSI Color Support"]:::core
        Exceptions["Exception Formatting"]:::core
        Binary["Binary Data Formatting"]:::core
        Table["Table Formatting"]:::core
        REPL["Pretty REPL"]:::core
        Annotations["Annotations"]:::core
    end

    subgraph SupportLayer
        Specs["Specs/Validation"]:::support
        CoreImpl["Core Implementation"]:::support
    end

    subgraph TestFramework
        Tests["Test Coverage"]:::test
    end

    %% Relationships
    PublicAPI --> ANSI
    PublicAPI --> Exceptions
    PublicAPI --> Binary
    PublicAPI --> Table
    PublicAPI --> REPL
    PublicAPI --> Annotations

    ANSI --> CoreImpl
    Exceptions --> CoreImpl
    Binary --> CoreImpl
    Table --> CoreImpl
    REPL --> CoreImpl
    Annotations --> CoreImpl

    Table -.-> Specs
    REPL -.-> Specs
    Annotations -.-> Specs

    Tests -.-> ANSI
    Tests -.-> Exceptions
    Tests -.-> Binary
    Tests -.-> Annotations

    %% Click events
    click ANSI "https://github.com/clj-commons/pretty/blob/main/src/clj_commons/ansi.clj"
    click Exceptions "https://github.com/clj-commons/pretty/blob/main/src/clj_commons/format/exceptions.clj"
    click Binary "https://github.com/clj-commons/pretty/blob/main/src/clj_commons/format/binary.clj"
    click Table "https://github.com/clj-commons/pretty/blob/main/src/clj_commons/format/table.clj"
    click REPL "https://github.com/clj-commons/pretty/blob/main/src/clj_commons/pretty/repl.clj"
    click Specs "https://github.com/clj-commons/pretty/blob/main/src/clj_commons/format/table/specs.clj"
    click CoreImpl "https://github.com/clj-commons/pretty/blob/main/src/clj_commons/pretty_impl.clj"
    click Tests "https://github.com/clj-commons/pretty/tree/main/test/clj_commons"
    click Annotations "https://github.com/clj-commons/pretty/blob/main/src/clj_commons/pretty/annotations.clj"

    %% Styling
    classDef api fill:#2374ab,stroke:#2374ab,color:white
    classDef core fill:#57a773,stroke:#57a773,color:white
    classDef support fill:#ffc857,stroke:#ffc857,color:black
    classDef test fill:#ef6461,stroke:#ef6461,color:white

    %% Legend
    subgraph Legend
        API_Legend["API Component"]:::api
        Core_Legend["Core Module"]:::core
        Support_Legend["Support Component"]:::support
        Test_Legend["Test Component"]:::test
        Solid["→ Direct Dependency"]
        Dashed["--> Optional Dependency"]
    end
```
