# unovue/shadcn-vue architecture

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

- Interactive diagram: https://gitdiagram.com/unovue/shadcn-vue
- Repository: https://github.com/unovue/shadcn-vue

## Overview

##### Main Components of the System

The system architecture should be divided into these key components:

a. Core Components Layer:
- Component Registry (src/lib/registry)
- UI Components (src/lib/registry/default/ui)
- Theme System (src/lib/registry/themes)
- Style System (src/lib/registry/styles)

b. CLI Tool Layer:
- Command Handlers (packages/cli/src/commands)
- Transformers (packages/cli/src/utils/transformers)
- Configuration Manager (packages/cli/src/utils)

c. Documentation Layer:
- VitePress Documentation (apps/www)
- Component Examples (apps/www/src/examples)
- API Documentation (apps/www/src/content)

##### Relationships and Data Flow

**[User Project] <---> [CLI Tool] <---> [Component Registry]**

- [Theme System] <--|---> [UI Components]

- [Style System] <---|

**[Documentation Site] ---> [Component Examples]**
- > [API Documentation]
- > [Theme Customization]

##### Component Details

Specific elements:
- Component Registry: Central repository of all UI components
- CLI Tool: Manages component installation and configuration
- Documentation: Interactive examples and API references

##### Integration Points

Key integration areas:
- CLI to Component Registry connection
- Theme System to Component application
- Documentation to Component Examples flow

##### Technical Stack Indicators

Technology dependencies:
- Vue.js
- VitePress
- Radix Vue
- TailwindCSS

##### Documentation Layer (Examples & Docs)

- Component relationships
- Data flow directions
- Integration points

Keep the abstraction level focused on the architectural components while maintaining enough detail to understand the system's structure and component interactions.

- How components are organized and related
- How the theming system integrates with components
- How the CLI tool facilitates component usage
- How documentation and examples support the system

Remember to emphasize the modular nature of the system and how it enables developers to copy and customize components for their own use.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Core["Core Components Layer"]
        Registry["Component Registry"]:::core
        UI["UI Components"]:::core
        Theme["Theme System"]:::theme
        Style["Style System"]:::theme
        Colors["Theme Customization"]:::theme
        
        Registry --> UI
        Theme --> UI
        Style --> UI
        Colors --> Theme
    end

    subgraph CLI["CLI Tool Layer"]
        CLITool["CLI Tool"]:::cli
        Commands["Command Handlers"]:::cli
        Transform["Transformers"]:::cli
        Config["Configuration Manager"]:::cli
        
        CLITool --> Commands
        CLITool --> Transform
        CLITool --> Config
    end

    subgraph Docs["Documentation Layer"]
        DocSite["Documentation Site"]:::docs
        VitePress["VitePress Documentation"]:::docs
        Examples["Component Examples"]:::docs
        APIDocs["API Documentation"]:::docs
        
        DocSite --> VitePress
        DocSite --> Examples
        DocSite --> APIDocs
    end

    UserProject["User Project"]:::external
    UserProject <--> CLITool
    CLITool <--> Registry
    DocSite --> Registry

    %% Technology Dependencies
    Vue["Vue.js"]:::tech
    Radix["Radix Vue"]:::tech
    Tailwind["TailwindCSS"]:::tech
    
    UI --> Vue
    UI --> Radix
    UI --> Tailwind

    %% Click Events
    click Registry "https://github.com/unovue/shadcn-vue/tree/dev/apps/www/src/lib/registry"
    click UI "https://github.com/unovue/shadcn-vue/tree/dev/apps/www/src/lib/registry/default/ui"
    click Theme "https://github.com/unovue/shadcn-vue/blob/dev/apps/www/src/lib/registry/themes.ts"
    click Style "https://github.com/unovue/shadcn-vue/blob/dev/apps/www/src/lib/registry/styles.ts"
    click Commands "https://github.com/unovue/shadcn-vue/tree/dev/packages/cli/src/commands"
    click Transform "https://github.com/unovue/shadcn-vue/tree/dev/packages/cli/src/utils/transformers"
    click Config "https://github.com/unovue/shadcn-vue/blob/dev/packages/cli/src/utils/get-config.ts"
    click VitePress "https://github.com/unovue/shadcn-vue/blob/dev/apps/www/.vitepress"
    click Examples "https://github.com/unovue/shadcn-vue/tree/dev/apps/www/src/examples"
    click APIDocs "https://github.com/unovue/shadcn-vue/tree/dev/apps/www/src/content/docs"
    click DocSite "https://github.com/unovue/shadcn-vue/tree/dev/apps/www"
    click Colors "https://github.com/unovue/shadcn-vue/blob/dev/apps/www/src/lib/registry/colors.ts"
    click CLITool "https://github.com/unovue/shadcn-vue/tree/dev/packages/cli"

    %% Styling
    classDef core fill:#2563eb,color:#fff
    classDef theme fill:#f97316,color:#fff
    classDef cli fill:#22c55e,color:#fff
    classDef docs fill:#a855f7,color:#fff
    classDef tech fill:#64748b,color:#fff
    classDef external fill:#e5e7eb,color:#000

    %% Legend
    subgraph Legend
        L1["Core Components"]:::core
        L2["Theme System"]:::theme
        L3["CLI Tools"]:::cli
        L4["Documentation"]:::docs
        L5["Technologies"]:::tech
        L6["External"]:::external
    end
```
