# nank1ro/flutter-shadcn-ui architecture

> Architecture diagram of the GitHub repository nank1ro/flutter-shadcn-ui, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nank1ro/flutter-shadcn-ui
- Repository: https://github.com/nank1ro/flutter-shadcn-ui

## Overview

##### Project type and purpose
- This is an open-source Flutter UI component library (“shadcn_ui”) that provides reusable, customizable widgets for Flutter apps.
- It ships with:
- A core Dart/Flutter library under lib/src
- A CLI tool (cli/) to scaffold or interact with the library
- A documentation website (docs/) powered by Astro
- A fully working example app (example/)
- A playground/demo app with Firebase integration (playground/)
- A comprehensive test suite (test/)
- CI/CD pipelines (GitHub Actions workflows) and release automation

##### File structure
- Top-level directories:
- cli: Dart CLI tool, hashing utility, command entrypoint
- docs: static site (Astro, MDX) feeding off component source and content
- example & playground: Flutter apps consuming the library and demonstrating components
- lib/src: the heart of the UI library (components, raw_components, theme, utils)
- test: widget and golden tests covering each component
- Configuration/build artifacts:
- pubspec.yaml at root, cli, example, playground – defines package metadata & dependencies
- GitHub workflows (.github/workflows) for testing, publishing, release automation
- Firebase config in playground for live demo hosting
- Astro config and package.json in docs for doc-site bundling

##### Extract insights from the README
- Purpose: “Shadcn UI ported in Flutter. Awesome UI components, fully customizable.”
- Components list: accordions, alerts, buttons, dialogs, etc.
- Documentation is published at flutter-shadcn-ui.mariuti.com
- Progress tracking, contribution guidelines, CI badges indicate mature OSS process

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Core Library
    subgraph "Core Flutter Library" 
        direction TB
        CL1["shadcn_ui.dart"]:::core
        CL2["src/components/"]:::core
        CL3["src/raw_components/"]:::core
        CL4["src/theme/"]:::core
        CL5["src/utils/"]:::core
    end

    %% Tooling
    subgraph "Tooling" 
        direction TB
        CLI1["cli/bin/shadcn.dart"]:::tooling
        CLI2["cli/lib/shadcn.dart"]:::tooling
        CLI3["cli/hashes.json"]:::tooling
        CLI4["cli/pubspec.yaml"]:::tooling
        DOC1["docs/astro.config.mjs"]:::tooling
        DOC2["docs/package.json"]:::tooling
        DOC3["docs/src/components/"]:::tooling
        DOC4["docs/src/content/"]:::tooling
    end

    %% Consumers
    subgraph "Consumer Apps" 
        direction TB
        EX1["example/lib/main.dart"]:::consumer
        EX2["example/lib/common/"]:::consumer
        EX3["example/lib/pages/"]:::consumer
        EX4["example/pubspec.yaml"]:::consumer
        PL1["playground/lib/main.dart"]:::consumer
        PL2["playground/lib/pages/"]:::consumer
        PL3["playground/lib/router.dart"]:::consumer
        PL4["playground/firebase.json"]:::consumer
        PL5["playground/pubspec.yaml"]:::consumer
    end

    %% Test Suite
    subgraph "Test Suite" 
        direction TB
        TS1["test/src/components/"]:::infra
        TS2["test/extra/pump_async_widget.dart"]:::infra
    end

    %% CI/CD & Release Pipeline
    subgraph "CI/CD & Release Pipeline" 
        direction TB
        CI1[".github/workflows/flutter-test.yaml"]:::infra
        CI2[".github/workflows/publish.yaml"]:::infra
        CI3[".github/workflows/update-hashes.yaml"]:::infra
        CI4[".github/scripts/generate_hashes.sh"]:::infra
    end

    %% External Services
    subgraph "External Services" 
        direction TB
        ES1["pub.dev"]:::external
        ES2["GitHub"]:::external
        ES3["Firebase"]:::external
    end

    %% Dependencies & Interactions
    EX1 -->|depends on| CL1
    EX2 -->|depends on| CL1
    EX3 -->|depends on| CL1
    PL1 -->|depends on| CL1
    PL2 -->|depends on| CL1
    PL3 -->|depends on| CL1
    DOC3 -->|imports| CL1
    DOC4 -->|imports| CL1
    CLI1 -->|reads/writes| CL2
    CLI1 -->|reads/writes| CLI3
    TS1 -->|loads| CL1
    TS2 -->|loads| CL1
    CI1 -->|runs tests| TS1
    CI1 -->|runs tests| TS2
    CI2 -->|publishes| ES1
    CI2 -->|uses| CI4
    CI3 -->|updates| CLI3
    PL1 -->|communicates| ES3

    %% Click Events
    click CL1 "https://github.com/nank1ro/flutter-shadcn-ui/blob/main/lib/shadcn_ui.dart"
    click CL2 "https://github.com/nank1ro/flutter-shadcn-ui/tree/main/lib/src/components/"
    click CL3 "https://github.com/nank1ro/flutter-shadcn-ui/tree/main/lib/src/raw_components/"
    click CL4 "https://github.com/nank1ro/flutter-shadcn-ui/tree/main/lib/src/theme/"
    click CL5 "https://github.com/nank1ro/flutter-shadcn-ui/tree/main/lib/src/utils/"
    click CLI1 "https://github.com/nank1ro/flutter-shadcn-ui/blob/main/cli/bin/shadcn.dart"
    click CLI2 "https://github.com/nank1ro/flutter-shadcn-ui/blob/main/cli/lib/shadcn.dart"
    click CLI3 "https://github.com/nank1ro/flutter-shadcn-ui/blob/main/cli/hashes.json"
    click CLI4 "https://github.com/nank1ro/flutter-shadcn-ui/blob/main/cli/pubspec.yaml"
    click DOC1 "https://github.com/nank1ro/flutter-shadcn-ui/blob/main/docs/astro.config.mjs"
    click DOC2 "https://github.com/nank1ro/flutter-shadcn-ui/blob/main/docs/package.json"
    click DOC3 "https://github.com/nank1ro/flutter-shadcn-ui/tree/main/docs/src/components/"
    click DOC4 "https://github.com/nank1ro/flutter-shadcn-ui/tree/main/docs/src/content/"
    click EX1 "https://github.com/nank1ro/flutter-shadcn-ui/blob/main/example/lib/main.dart"
    click EX2 "https://github.com/nank1ro/flutter-shadcn-ui/tree/main/example/lib/common/"
    click EX3 "https://github.com/nank1ro/flutter-shadcn-ui/tree/main/example/lib/pages/"
    click EX4 "https://github.com/nank1ro/flutter-shadcn-ui/blob/main/example/pubspec.yaml"
    click PL1 "https://github.com/nank1ro/flutter-shadcn-ui/blob/main/playground/lib/main.dart"
    click PL2 "https://github.com/nank1ro/flutter-shadcn-ui/tree/main/playground/lib/pages/"
    click PL3 "https://github.com/nank1ro/flutter-shadcn-ui/blob/main/playground/lib/router.dart"
    click PL4 "https://github.com/nank1ro/flutter-shadcn-ui/blob/main/playground/firebase.json"
    click PL5 "https://github.com/nank1ro/flutter-shadcn-ui/blob/main/playground/pubspec.yaml"
    click TS1 "https://github.com/nank1ro/flutter-shadcn-ui/tree/main/test/src/components/"
    click TS2 "https://github.com/nank1ro/flutter-shadcn-ui/blob/main/test/extra/pump_async_widget.dart"
    click CI1 "https://github.com/nank1ro/flutter-shadcn-ui/blob/main/.github/workflows/flutter-test.yaml"
    click CI2 "https://github.com/nank1ro/flutter-shadcn-ui/blob/main/.github/workflows/publish.yaml"
    click CI3 "https://github.com/nank1ro/flutter-shadcn-ui/blob/main/.github/workflows/update-hashes.yaml"
    click CI4 "https://github.com/nank1ro/flutter-shadcn-ui/blob/main/.github/scripts/generate_hashes.sh"

    %% Styles
    classDef core fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef tooling fill:#98FB98,stroke:#333,stroke-width:1px
    classDef consumer fill:#FFA500,stroke:#333,stroke-width:1px
    classDef infra fill:#DDA0DD,stroke:#333,stroke-width:1px
    classDef external fill:#D3D3D3,stroke:#333,stroke-width:1px
```
