# 0xa3k5/web3icons architecture

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

- Interactive diagram: https://gitdiagram.com/0xa3k5/web3icons
- Repository: https://github.com/0xa3k5/web3icons

## Overview

##### Project’s Main Components
- Apps:
- Packages:
- @web3icons/common (packages/common): Holds shared metadata (JSON files defining tokens, networks, wallets, exchanges) used across the ecosystem.
- @web3icons/utils (packages/utils): Contains build scripts, scaffolding, and utility functions for tasks like SVG optimization, metadata generation, and maintaining naming conventions.
- ESLint and configuration packages (packages/eslint-config): Provide consistency and code quality checks across the project.
- Assets and Raw SVGs:
- Build configuration files (e.g., tailwind.config.js, tsconfig.json) that affect styling and type-checking in the apps.

##### Relationships and Interactions
- The build process (managed by scripts in packages/utils) takes input from raw SVGs and metadata. It processes these assets to generate:
- Optimized SVG modules (in @web3icons/core)
- Updated metadata (in packages/common)
- React component definitions (in @web3icons/react)
- The ESLint and Prettier configuration files ensure consistency in code format across the various packages and apps.

##### Architectural Patterns and Technologies
- Monorepo Structure: The repository is organized as a monorepo (using TurboRepo as indicated by turbo.json) that shares common configurations and build tools.
- Separation of Concerns:
- UI concerns are managed in the apps (website and Figma plugin).
- Build and maintenance scripts are encapsulated in the utils package.
- Technologies include Next.js for the website, React for component rendering, Tailwind CSS for styling, and TypeScript across packages for type safety.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Raw Assets
    subgraph "Raw Assets"
        RawSVG["Raw SVGs"]:::raw
    end

    %% Build/Tooling
    subgraph "Build/Tooling"
        Utils["Utils (@web3icons/utils)"]:::tooling
        ESLint["ESLint and Configuration Packages"]:::tooling
    end

    %% Packages
    subgraph "Packages"
        Core["Core Package (@web3icons/core)"]:::packages
        Common["Common Metadata (@web3icons/common)"]:::packages
        ReactPkg["React Package (@web3icons/react)"]:::packages
    end

    %% Apps
    subgraph "Apps"
        Website["Website (Next.js)"]:::apps
        Figma["Figma Plugin (Plugin UI)"]:::apps
    end

    %% Relationships and Data Flow
    RawSVG -->|"Builds/Generates"| Utils
    Utils -->|"Generates"| Core
    Utils -->|"Generates"| Common
    Core -->|"ProvidesAssets"| ReactPkg
    Common -->|"ProvidesMetadata"| ReactPkg
    ReactPkg -->|"UsedBy"| Website
    ReactPkg -->|"UsedBy"| Figma
    %% Optional direct dependency (if needed)
    Core ---|"Optional"| Figma

    %% ESLint ensuring code quality across modules
    ESLint ---|"EnsuresQuality"| Website
    ESLint ---|"EnsuresQuality"| Figma
    ESLint ---|"EnsuresQuality"| Core
    ESLint ---|"EnsuresQuality"| ReactPkg
    ESLint ---|"EnsuresQuality"| Common
    ESLint ---|"EnsuresQuality"| Utils

    %% Click Events
    click Website "https://github.com/0xa3k5/web3icons/tree/main/apps/website"
    click Figma "https://github.com/0xa3k5/web3icons/tree/main/apps/figma-plugin"
    click Core "https://github.com/0xa3k5/web3icons/tree/main/packages/core"
    click ReactPkg "https://github.com/0xa3k5/web3icons/tree/main/packages/react"
    click Common "https://github.com/0xa3k5/web3icons/tree/main/packages/common"
    click Utils "https://github.com/0xa3k5/web3icons/tree/main/packages/utils"
    click ESLint "https://github.com/0xa3k5/web3icons/tree/main/packages/eslint-config"
    click RawSVG "https://github.com/0xa3k5/web3icons/tree/main/raw-svgs"

    %% Styles
    classDef apps fill:#AED6F1,stroke:#1B4F72,stroke-width:2px;
    classDef packages fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
    classDef tooling fill:#D5F5E3,stroke:#117A65,stroke-width:2px;
    classDef raw fill:#F5CBA7,stroke:#A04000,stroke-width:2px;
```
