# mehdibha/dotui architecture

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

- Interactive diagram: https://gitdiagram.com/mehdibha/dotui
- Repository: https://github.com/mehdibha/dotui

## Overview

##### Main System Components

a) Core Package Structure:
- CLI Package (`packages/cli`)
- Configuration Package (`packages/config`)
- Registry Package (`packages/registry`)
- TailwindCSS Integration (`packages/tailwindcss-rac`)
- Documentation Website (`www`)

b) Component Architecture:
- Component Registry System
- Theme System
- Style System (TailwindCSS integration)
- Documentation System

##### Relationships and Data Flow

**[CLI Tool] ─────┐**

**[Config] ───────┼──→ [Component Registry] ←─── [TailwindCSS Integration]**
- ↓
**[Registry] ─────┘           ↓**
- [Documentation Site]

##### Detailed Component Breakdown

Subsystems:

a) CLI System:
- Command handlers (init, add)
- Project scaffolding
- Component installation
- Configuration management

b) Registry System:
- Component definitions
- Style definitions
- Theme definitions
- Hook registry

c) Documentation System:
- Component demos
- API documentation
- Theme customization
- Usage examples

##### Integration Points

Key integration points:
- TailwindCSS configuration integration
- Theme system integration
- Component registration process
- Documentation generation pipeline

##### Development Workflow

Development workflow:
**[Local Development] → [Component Creation] → [Registry Update] → [Documentation Generation]**

##### Deployment Architecture

Deployment considerations:
- Documentation site deployment
- Package distribution
- Registry updates
- Version management

##### The component registration workflow

Use these visual elements:
- Clear labels for all components and connections

Keep the abstraction level high enough to show the overall architecture while including enough detail to understand the system's main components and their interactions. Focus on showing how the system achieves its goal of helping developers create unique design systems.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Core ["Core Infrastructure"]
        CLI["CLI Package"]
        Config["Configuration Package"]
        Registry["Registry Package"]
        TailwindCSS["TailwindCSS Integration"]
    end

    subgraph Components ["Component System"]
        CompReg["Component Registry System"]
        ThemeSystem["Theme System"]
        StyleSystem["Style System"]
    end

    subgraph Docs ["Documentation"]
        DocSite["Documentation Site"]
        CompDocs["Component Documentation"]
        APIRef["API Reference"]
        Demos["Demo Components"]
    end

    CLI --> CompReg
    Config --> CompReg
    Registry --> CompReg
    TailwindCSS --> StyleSystem

    CompReg --> ThemeSystem
    ThemeSystem --> StyleSystem
    CompReg --> DocSite
    StyleSystem --> DocSite

    DocSite --> CompDocs
    DocSite --> APIRef
    DocSite --> Demos

    %% Click events for component mapping
    click CLI "https://github.com/mehdibha/dotUI/tree/next//packages/cli"
    click Config "https://github.com/mehdibha/dotUI/tree/next//packages/config"
    click Registry "https://github.com/mehdibha/dotUI/tree/next//packages/registry"
    click TailwindCSS "https://github.com/mehdibha/dotUI/tree/next//packages/tailwindcss-rac"
    click CompReg "https://github.com/mehdibha/dotUI/tree/next//www/src/registry/core"
    click ThemeSystem "https://github.com/mehdibha/dotUI/blob/next//www/src/lib/themes.ts"
    click StyleSystem "https://github.com/mehdibha/dotUI/blob/next//www/src/lib/cn.ts"
    click CompDocs "https://github.com/mehdibha/dotUI/tree/next//www/content/docs/components"
    click APIRef "https://github.com/mehdibha/dotUI/tree/next//www/content/docs/getting-started/api-reference"
    click Demos "https://github.com/mehdibha/dotUI/tree/next//www/src/registry/demos"

    %% Styling
    classDef core fill:#2563eb,color:white
    classDef component fill:#22c55e,color:white
    classDef docs fill:#a855f7,color:white
    
    class CLI,Config,Registry,TailwindCSS core
    class CompReg,ThemeSystem,StyleSystem component
    class DocSite,CompDocs,APIRef,Demos docs

    %% Legend
    subgraph Legend
        CoreLegend["Core Infrastructure"]:::core
        CompLegend["Component System"]:::component
        DocsLegend["Documentation"]:::docs
    end
```
