# dragee-io/dragee-model architecture

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

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

## Overview

##### Main Components

a) Core Components (Primary Modules):
- Common Types Module
- Asserter Module
- Grapher Module
- Profiler Module
- Test Utils Module

b) Supporting Components:
- Build System
- Documentation Generator
- CI/CD Pipeline

**Top Layer: Public API Interface**
**Middle Layer: Core Modules**
**Bottom Layer: Common Utilities and Shared Resources**

##### Specific Component Relationships

a) Core Module Relationships:
- Bidirectional relationships between Asserter and Grapher modules if they interact
- Profiler module to both Asserter and Grapher with monitoring relationships

b) Infrastructure Components:
- Build pipeline flow from source to distribution
- Documentation generation flow

##### Specific Implementation Details

Technical aspects:
- TypeScript compilation flow
- Role of Bun as the runtime/build tool
- Documentation generation process using TypeDoc
- GitHub Actions workflow integration

##### Module Details to Highlight

Common Module:
- FP utilities (Maybe, Result models)
- ID generation utilities

Asserter Module:
- Type definitions
- Assertion helpers

Grapher Module:
- Type definitions
- Graph-related utilities

Profiler Module:
- Performance monitoring
- Integration points with other modules

Test Utils:
- Approval testing utilities
- Shared test helpers

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Public API Layer"
        API[Public API Interface]
    end

    subgraph "Core Modules"
        direction TB
        Asserter[Asserter Module]
        Grapher[Grapher Module]
        Profiler[Profiler Module]
    end

    subgraph "Common Layer"
        direction TB
        CommonTypes[Common Types]
        FPUtils[FP Utilities]
        IDGen[ID Generation]
        TestUtils[Test Utils]
    end

    subgraph "Infrastructure"
        direction TB
        Build[Build System]
        Docs[Documentation]
        CICD[CI/CD Pipeline]
    end

    %% Relationships
    API --> Asserter
    API --> Grapher
    API --> Profiler

    Asserter --> CommonTypes
    Grapher --> CommonTypes
    Profiler --> CommonTypes
    
    CommonTypes --> FPUtils
    CommonTypes --> IDGen
    
    TestUtils -.-> Asserter
    TestUtils -.-> Grapher
    TestUtils -.-> Profiler
    TestUtils -.-> CommonTypes

    Build --> API
    Docs --> API
    CICD --> Build
    CICD --> Docs

    %% Click Events
    click CommonTypes "https://github.com/dragee-io/dragee-model/tree/main/src/common/"
    click FPUtils "https://github.com/dragee-io/dragee-model/tree/main/src/common/fp/"
    click IDGen "https://github.com/dragee-io/dragee-model/blob/main/src/common/utils/id-generation.utils.ts"
    click Asserter "https://github.com/dragee-io/dragee-model/blob/main/src/asserter/index.ts"
    click Grapher "https://github.com/dragee-io/dragee-model/blob/main/src/grapher/index.ts"
    click Profiler "https://github.com/dragee-io/dragee-model/tree/main/src/profiler/"
    click TestUtils "https://github.com/dragee-io/dragee-model/blob/main/src/test-utils/index.ts"
    click Build "https://github.com/dragee-io/dragee-model/blob/main/build.ts"
    click Docs "https://github.com/dragee-io/dragee-model/blob/main/typedoc.json"
    click CICD "https://github.com/dragee-io/dragee-model/blob/main/.github/workflows/pr-check.yml"

    %% Styling
    classDef core fill:#2374ab
    classDef util fill:#57a773
    classDef infra fill:#878787
    classDef api fill:#ffb627

    class Asserter,Grapher,Profiler core
    class CommonTypes,FPUtils,IDGen,TestUtils util
    class Build,Docs,CICD infra
    class API api

    %% Legend
    subgraph Legend
        L1[Core Modules]:::core
        L2[Utility Modules]:::util
        L3[Infrastructure]:::infra
        L4[API]:::api
        L5[Dev Dependencies]
    end
```
