# thenightproject/supaweb3 architecture

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

- Interactive diagram: https://gitdiagram.com/thenightproject/supaweb3
- Repository: https://github.com/thenightproject/supaweb3

## Overview

##### Project Type and Purpose
- This is a monorepo hosting a Vue 3 + TypeScript Web3 UI component library (“@supaweb3/ui”), a Nuxt 3/4 integration module (“@supaweb3/nuxt”), a Tailwind CSS preset (“@supaweb3/config”), and Storybook documentation (“@supaweb3/storybook”).
- Purpose: Provide reusable, tree-shakable Web3 UX components (wallet connect, defi, NFTs, governance, etc.) and integrate them easily into Vue/Nuxt projects.
- It’s an open-source toolkit + integration plugin, not a standalone app.

##### Key Architectural Elements from File Structure
- Root
- Configuration & tooling: pnpm-workspace, tsconfig, lint/prettier files, GitHub Actions workflows, .changeset for versioning, .claude for CLI sessions.
- scripts/: release/version bump scripts.
- packages/config
- Tailwind CSS preset package.
- packages/ui
- Core component library: src/components (dozens of Vue components), src/composables (shared composables), types, CSS entry point, Vite config.
- packages/nuxt
- Nuxt module: module.ts to auto-import components, add Tailwind preset.
- packages/storybook
- Storybook setup and component stories for interactive documentation.

##### Insights from README
- Four published packages: @supaweb3/config, /ui, /nuxt, /storybook.
- Tech stack: Vue 3 Composition API, TypeScript, Tailwind CSS v3/v4, Storybook, pnpm.
- CI/CD: GitHub Actions automate publishing to GitHub Packages and NPM.
- Consumer workflows:
- Vue 3 app: import components individually.
- Nuxt app: add @supaweb3/nuxt to modules, auto-import, auto-configure Tailwind.

- Title: “SupaWeb3 Monorepo Architecture”
- workspace→build→registry
- consumer→import→library/module
- config→styled by→UI & Nuxt
- Important patterns: “Tree-shakable imports”, “Auto-import plugin”

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Monorepo Workspace
    subgraph "Monorepo Workspace"
        direction TB
        RootTools["Root Tooling & Config"]:::internal
        subgraph "Packages"
            direction TB
            Config["@supaweb3/config<br/>(Tailwind Preset)"]:::internal
            UI["@supaweb3/ui<br/>(Vue 3 + TS)"]:::internal
            Nuxt["@supaweb3/nuxt<br/>(Nuxt Module)"]:::internal
            Storybook["@supaweb3/storybook<br/>(Docs & Stories)"]:::internal
        end
    end

    %% CI/CD Pipeline
    subgraph "CI/CD Pipeline" 
        direction TB
        GHActions["GitHub Actions"]:::ci
        Registry["Package Registry"]:::external
    end

    %% Consumers
    subgraph "Consumers"
        direction TB
        VueApp["Vue 3 App"]:::consumer
        NuxtApp["Nuxt 3/4 App"]:::consumer
    end

    %% Connections
    RootTools -->|manages workspace| Config
    RootTools --> Config
    RootTools --> UI
    RootTools --> Nuxt
    RootTools --> Storybook

    Config -->|provides styles| UI
    Config -->|provides styles| Nuxt

    UI -->|import| Storybook
    UI -->|runtime import| VueApp
    Nuxt -->|auto-import| NuxtApp

    RootTools -->|triggers build| GHActions
    GHActions -->|publishes| Registry

    %% Click Events for Component Mapping
    click RootTools "https://github.com/thenightproject/supaweb3/blob/main/pnpm-workspace.yaml"
    click RootTools "https://github.com/thenightproject/supaweb3/blob/main/tsconfig.json"
    click RootTools "https://github.com/thenightproject/supaweb3/tree/main/.changeset/"
    click RootTools "https://github.com/thenightproject/supaweb3/blob/main/scripts/bump-version.js"
    click RootTools "https://github.com/thenightproject/supaweb3/blob/main/.github/workflows/main.yml"

    click Config "https://github.com/thenightproject/supaweb3/blob/main/packages/config/package.json"
    click Config "https://github.com/thenightproject/supaweb3/blob/main/packages/config/index.js"
    click Config "https://github.com/thenightproject/supaweb3/blob/main/packages/config/index.d.ts"
    click Config "https://github.com/thenightproject/supaweb3/blob/main/packages/config/tsconfig.json"

    click UI "https://github.com/thenightproject/supaweb3/blob/main/packages/ui/package.json"
    click UI "https://github.com/thenightproject/supaweb3/blob/main/packages/ui/vite.config.ts"
    click UI "https://github.com/thenightproject/supaweb3/blob/main/packages/ui/tsconfig.json"
    click UI "https://github.com/thenightproject/supaweb3/blob/main/packages/ui/src/index.ts"
    click UI "https://github.com/thenightproject/supaweb3/tree/main/packages/ui/src/components/"
    click UI "https://github.com/thenightproject/supaweb3/tree/main/packages/ui/src/composables/"
    click UI "https://github.com/thenightproject/supaweb3/blob/main/packages/ui/src/types/index.ts"

    click Nuxt "https://github.com/thenightproject/supaweb3/blob/main/packages/nuxt/package.json"
    click Nuxt "https://github.com/thenightproject/supaweb3/blob/main/packages/nuxt/tsconfig.json"
    click Nuxt "https://github.com/thenightproject/supaweb3/blob/main/packages/nuxt/src/module.ts"
    click Nuxt "https://github.com/thenightproject/supaweb3/tree/main/packages/nuxt/src/runtime/components/"
    click Nuxt "https://github.com/thenightproject/supaweb3/blob/main/packages/nuxt/src/supaweb3-tailwind.css"

    click Storybook "https://github.com/thenightproject/supaweb3/blob/main/packages/storybook/package.json"
    click Storybook "https://github.com/thenightproject/supaweb3/blob/main/packages/storybook/.storybook/main.js"
    click Storybook "https://github.com/thenightproject/supaweb3/blob/main/packages/storybook/.storybook/preview.js"
    click Storybook "https://github.com/thenightproject/supaweb3/tree/main/packages/storybook/src/stories/"
    click Storybook "https://github.com/thenightproject/supaweb3/blob/main/packages/storybook/src/styles/main.css"
    click Storybook "https://github.com/thenightproject/supaweb3/blob/main/packages/storybook/tailwind.config.js"
    click Storybook "https://github.com/thenightproject/supaweb3/blob/main/packages/storybook/tsconfig.json"

    %% Styles
    classDef internal fill:#e1f5fe,stroke:#0277bd,stroke-width:2px
    classDef external fill:#eceff1,stroke:#607d8b,stroke-width:2px,stroke-dasharray: 5 5
    classDef ci fill:#e8f5e9,stroke:#2e7d32,stroke-width:2px
    classDef consumer fill:#fff8e1,stroke:#f9a825,stroke-width:2px
```
