# wevm/wagmi architecture

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

- Interactive diagram: https://gitdiagram.com/wevm/wagmi
- Repository: https://github.com/wevm/wagmi

## Overview

##### Project type and purpose
- This is an open-source monorepo library ("wagmi") providing reactive Ethereum primitives.
- It exposes a core TypeScript API (`@wagmi/core`), UI-framework wrappers (React hooks and Vue composables), a CLI scaffolding tool (`wagmi-cli` and `create-wagmi`), wallet connectors, test harnesses, playgrounds, and a static docs site.

##### File structure
- Top-level directories:
- packages/cli – the command-line interface
- packages/core – the core API (actions, query, transports, connectors)
- packages/connectors – wallet connector implementations
- packages/react – React hooks wrapper
- packages/vue – Vue composables wrapper
- packages/create-wagmi – project scaffolding tool + templates
- packages/test & register-tests – testing utilities
- playgrounds/… – example apps using different frameworks
- site/ & site/.vitepress – documentation site sources
- Build & config: pnpm-workspace.yaml, tsconfig.json, vitest.config.ts, CI workflows under .github.

##### README for additional insights
- Purpose: “Reactive primitives for Ethereum apps”
- Library is modular, published to npm; docs at wagmi.sh; encourages contributions.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Monorepo (pnpm workspace)"
        Mono["Monorepo Root"]:::core
        CoreAPI["@wagmi/core"]:::core
        Transports["Transports (HTTP, WebSocket, Fallback)"]:::core
        ConnectorFactory["Connector Factory (createConnector)"]:::core
        WalletConnectors["Wallet Connector Implementations"]:::core
        React["@wagmi/react"]:::adapter
        Vue["@wagmi/vue"]:::adapter
        CLI["CLI Tool (wagmi-cli)"]:::tool
        Scaffold["Project Scaffolding (create-wagmi)"]:::tool
        subgraph "Playground Apps"
            Next["Next.js Playground"]:::docs
            Nuxt["Nuxt.js Playground"]:::docs
            VR["Vite + React Playground"]:::docs
            VV["Vite + Vue Playground"]:::docs
            VCore["Vite Core TS Playground"]:::docs
        end
        Site["Documentation Site (VitePress)"]:::docs
        CI["CI / Workflows"]:::tool
    end

    RPC["Ethereum JSON-RPC Endpoints"]:::external
    WalletProviders["Wallet Providers (MetaMask, WalletConnect, etc.)"]:::external
    npm["npm Registry"]:::external

    %% Dependencies within monorepo
    CoreAPI --> Transports
    CoreAPI --> ConnectorFactory
    ConnectorFactory --> WalletConnectors
    CoreAPI --> WalletConnectors
    CoreAPI --> React
    CoreAPI --> Vue
    WalletConnectors --> React
    WalletConnectors --> Vue
    CLI --> CoreAPI
    Scaffold --> CoreAPI
    Scaffold --> React
    Scaffold --> Vue

    %% Playgrounds imports
    Next --> React
    Next --> CoreAPI
    Nuxt --> Vue
    Nuxt --> CoreAPI
    VR --> React
    VR --> CoreAPI
    VV --> Vue
    VV --> CoreAPI
    VCore --> CoreAPI

    %% Documentation site
    Site --> CoreAPI
    Site --> React
    Site --> Vue

    %% CI pipeline
    CI --> Mono

    %% External integrations
    RPC --> Transports
    WalletProviders --> WalletConnectors

    %% Publishing
    CoreAPI --> npm
    React --> npm
    Vue --> npm
    WalletConnectors --> npm
    CLI --> npm
    Scaffold --> npm

    %% Click Events
    click Mono "https://github.com/wevm/wagmi/blob/main/pnpm-workspace.yaml"
    click CoreAPI "https://github.com/wevm/wagmi/tree/main/packages/core"
    click Transports "https://github.com/wevm/wagmi/tree/main/packages/core/src/transports"
    click ConnectorFactory "https://github.com/wevm/wagmi/tree/main/packages/core/src/connectors"
    click WalletConnectors "https://github.com/wevm/wagmi/tree/main/packages/connectors"
    click React "https://github.com/wevm/wagmi/tree/main/packages/react"
    click Vue "https://github.com/wevm/wagmi/tree/main/packages/vue"
    click CLI "https://github.com/wevm/wagmi/tree/main/packages/cli"
    click Scaffold "https://github.com/wevm/wagmi/tree/main/packages/create-wagmi"
    click Next "https://github.com/wevm/wagmi/tree/main/playgrounds/next"
    click Nuxt "https://github.com/wevm/wagmi/tree/main/playgrounds/nuxt"
    click VR "https://github.com/wevm/wagmi/tree/main/playgrounds/vite-react"
    click VV "https://github.com/wevm/wagmi/tree/main/playgrounds/vite-vue"
    click VCore "https://github.com/wevm/wagmi/tree/main/playgrounds/vite-core"
    click Site "https://github.com/wevm/wagmi/tree/main/site/"
    click CI "https://github.com/wevm/wagmi/tree/main/.github/workflows"

    %% Styles
    classDef core fill:#ADD8E6,stroke:#000,color:#000
    classDef adapter fill:#90EE90,stroke:#000,color:#000
    classDef tool fill:#FFA500,stroke:#000,color:#000
    classDef docs fill:#DDA0DD,stroke:#000,color:#000
    classDef external fill:#D3D3D3,stroke:#000,color:#000
```
