# 3yourmind/kotti architecture

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

- Interactive diagram: https://gitdiagram.com/3yourmind/kotti
- Repository: https://github.com/3yourmind/kotti

## Overview

##### Main Components
- Core Packages – Highlight the primary UI component package (“kotti-ui”), along with other packages like “yoco” and “vue-use-tippy” that extend or support the core functionality.
- Documentation Module – Represent the Nuxt-managed documentation site (packages/documentation) as an independent but integrated component.
- Build & Configuration Tools – Include components for internal scripts (internals/), turborepo/lerna configuration files, and continuous integration workflows (.github/workflows).
- Shared Assets & Utilities – Display the shared components such as style tokens (packages/kotti-ui/tokens), ESLint and stylelint configuration (packages/eslint-config), and TypeScript configurations.

- How each package or module relates:
- The UI components library (kotti-ui) being the heart of the system, which exports Vue components that are consumed by user applications.
- The supporting packages (“yoco” and “vue-use-tippy”) are dependencies for additional utility or styling purposes and are designed to be used alongside or within the core Kotti UI.
- The documentation site (built with Nuxt) serves as an interface for learning and demonstrating the usage of the UI components.
- The internal tooling (located under internals/ and configuration files like turbo.json, lerna.json) manages dependency bootstrapping and build orchestration among the packages.

##### Architectural Patterns and Design Principles
- Modular Monorepo Architecture – Clearly separate each package as its own module with its own configuration files and build scripts, but also indicate how they are unified under a common build toolchain (turborepo/lerna).
- Component-Based UI – Emphasize that the architectural goal is a consistent, fail-fast UI framework built using Vue (evident by the large number of Vue component files in packages/kotti-ui).
- Separation of Concerns – Show that there is a clear divide between UI components, documentation, configuration, and tooling.
- Automated CI/CD and Release Pipelines – Indicate that GitHub workflows (e.g., publish.yml, ci.yml, gh-pages.yml) are integrated to manage testing, building, and publishing.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Monorepo Structure
    subgraph "Monorepo Structure"
        A["Monorepo Structure"]:::repo
    end

    %% Core UI Library Cluster
    subgraph "Core UI Library Cluster"
        B["Kotti UI Core"]:::package
        B1["Source"]:::package
        B2["Style Tokens"]:::utility
        B3["Vite Config"]:::package
    end

    %% Complementary Libraries
    subgraph "Complementary Libraries"
        C["Yoco"]:::package
        D["Vue Use Tippy"]:::package
    end

    %% Documentation Module
    subgraph "Documentation"
        E(["Documentation (Nuxt)"]):::doc
    end

    %% Internal Build & Tooling
    subgraph "Internal Build & Tooling"
        F["Internal Build & Tooling"]:::tooling
        G["GitHub Workflows"]:::tooling
        H["lerna.json/turbo.json"]:::tooling
    end

    %% Shared Assets & Utilities
    subgraph "Shared Assets & Utilities"
        I["ESLint Config"]:::utility
    end

    %% Connections from Monorepo to sub-components
    A -->|"contains"| B
    A -->|"contains"| C
    A -->|"contains"| D
    A -->|"contains"| E
    A -->|"contains"| F
    A -->|"contains"| G
    A -->|"contains"| H
    A -->|"contains"| I

    %% Connections within Core UI Library Cluster
    B1 -->|"part-of"| B
    B2 -->|"part-of"| B
    B3 -->|"part-of"| B

    %% Complementary libraries usage
    C -->|"usage"| B
    D -->|"usage"| B

    %% Documentation consumes core UI components
    B -->|"usage"| E

    %% Build & Tooling triggers builds of packages and documentation
    H -->|"build"| B
    H -->|"build"| C
    H -->|"build"| D
    H -->|"build"| E
    G -->|"CI/CD"| B
    G -->|"CI/CD"| C
    G -->|"CI/CD"| D
    G -->|"CI/CD"| E
    F -->|"orchestrates"| H

    %% Shared assets configuration
    I -->|"config"| B

    %% Click Events
    click A "https://github.com/3yourmind/kotti/tree/master/root"
    click B "https://github.com/3yourmind/kotti/tree/master/packages/kotti-ui"
    click C "https://github.com/3yourmind/kotti/tree/master/packages/yoco"
    click D "https://github.com/3yourmind/kotti/tree/master/packages/vue-use-tippy"
    click E "https://github.com/3yourmind/kotti/tree/master/packages/documentation"
    click F "https://github.com/3yourmind/kotti/tree/master/internals"
    click I "https://github.com/3yourmind/kotti/tree/master/packages/eslint-config"
    click B2 "https://github.com/3yourmind/kotti/tree/master/packages/kotti-ui/tokens"

    %% Classes and Styles
    classDef repo fill:#ffe0b2,stroke:#bf360c,stroke-width:2px;
    classDef package fill:#bbdefb,stroke:#0d47a1,stroke-width:2px;
    classDef doc fill:#c8e6c9,stroke:#1b5e20,stroke-width:2px,stroke-dasharray: 4 2;
    classDef tooling fill:#ffcdd2,stroke:#b71c1c,stroke-width:2px,stroke-dasharray: 2 2;
    classDef utility fill:#d1c4e9,stroke:#4a148c,stroke-width:2px;
```
