# crossmint/crossmint-sdk architecture

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

- Interactive diagram: https://gitdiagram.com/crossmint/crossmint-sdk
- Repository: https://github.com/crossmint/crossmint-sdk

## Overview

##### Main Components

a. Core SDK Layers:
- Client Layer
- Auth Client
- UI Components (React, Vue, Vanilla)
- Wallet Management
- Payment Processing
- Server Layer
- Authentication Server
- API Services
- Common Layer
- Base Utilities
- Shared Types
- Blockchain Utilities

b. External Integration Points:
- Blockchain Networks
- Payment Processors
- Authentication Providers
- Web3 Wallets

**┌─────────────────────────────────────────────────────────┐**
- Client Layer                        │
- ┬─────────────────┬───────────────────┤
- Auth UI      │  Payment UI     │   Wallet UI       │
- Components   │  Components     │   Components      │
- ┬────────┴────────┬────────┴─────────┬─────────┘

**┌────────┼────────────────┼──────────────────┼─────────┐**
- Common Layer  │                  │         │
- Base Types    Blockchain Utils    Auth Utils      │
- ┼────────────────┼──────────────────┼─────────┘

**┌────────┼────────────────┼──────────────────┼─────────┐**
- Server Layer                        │
- Auth Server     API Services     Blockchain Bridge  │
- ┘

##### Key Relationships to Highlight

- Data flow between client and server layers through the common layer
- Blue: Client components
- Green: Common utilities
- Orange: Server components
- Gray: External services

##### Implementation Details

- Support for multiple frameworks (React, Vue, Vanilla)
- Authentication flows (Email, OAuth, Web3)
- Payment processing capabilities (Crypto, Fiat)
- Wallet management features (Smart Wallet, WalletConnect)

##### Technical Specifications

- Supported blockchain networks (ETH, SOL)
- Supported authentication methods
- Available UI framework integrations
- API endpoints and services

##### Integration Points

Connections to:
- Web3 providers
- Payment processors
- Authentication services
- Blockchain networks

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles
    classDef client fill:#a8d1f0,stroke:#333
    classDef server fill:#f5b78a,stroke:#333
    classDef common fill:#90EE90,stroke:#333
    classDef external fill:#d3d3d3,stroke:#333
    
    subgraph ClientLayer["Client Layer"]
        direction TB
        
        subgraph UIComponents["UI Components"]
            ReactUI["React UI"]
            VueUI["Vue UI"]
            VanillaUI["Vanilla UI"]
        end
        
        AuthClient["Auth Client"]
        WalletMgmt["Wallet Management"]
        PaymentProc["Payment Processing"]
        
        subgraph WalletIntegrations["Wallet Integrations"]
            SmartWallet["Smart Wallet"]
            WalletConnect["WalletConnect"]
        end
    end
    
    subgraph CommonLayer["Common Layer"]
        direction TB
        BaseUtils["Base Utilities"]
        SharedTypes["Shared Types"]
        BlockchainUtils["Blockchain Utilities"]
        AuthCommon["Authentication Common"]
    end
    
    subgraph ServerLayer["Server Layer"]
        direction TB
        AuthServer["Authentication Server"]
        APIServices["API Services"]
    end
    
    subgraph External["External Services"]
        direction TB
        BlockchainNetworks["Blockchain Networks"]
        PaymentProcessors["Payment Processors"]
        AuthProviders["Authentication Providers"]
        Web3Wallets["Web3 Wallets"]
    end
    
    %% Relationships
    AuthClient --> AuthServer
    AuthClient --> AuthCommon
    WalletMgmt --> BlockchainUtils
    PaymentProc --> APIServices
    SmartWallet --> WalletMgmt
    WalletConnect --> WalletMgmt
    
    UIComponents --> AuthClient
    UIComponents --> WalletMgmt
    UIComponents --> PaymentProc
    
    AuthServer --> AuthProviders
    APIServices --> PaymentProcessors
    WalletMgmt --> Web3Wallets
    BlockchainUtils --> BlockchainNetworks
    
    %% Click Events
    click ReactUI "https://github.com/Crossmint/crossmint-sdk/tree/main/packages/client/ui/react-ui"
    click VueUI "https://github.com/Crossmint/crossmint-sdk/tree/main/packages/client/ui/vue-ui"
    click VanillaUI "https://github.com/Crossmint/crossmint-sdk/tree/main/packages/client/ui/vanilla-ui"
    click AuthClient "https://github.com/Crossmint/crossmint-sdk/tree/main/packages/client/auth"
    click WalletMgmt "https://github.com/Crossmint/crossmint-sdk/tree/main/packages/client/wallets"
    click PaymentProc "https://github.com/Crossmint/crossmint-sdk/tree/main/apps/payments"
    click SmartWallet "https://github.com/Crossmint/crossmint-sdk/tree/main/packages/client/wallets/smart-wallet"
    click WalletConnect "https://github.com/Crossmint/crossmint-sdk/tree/main/packages/client/wallets/walletconnect"
    click BaseUtils "https://github.com/Crossmint/crossmint-sdk/tree/main/packages/common/base"
    click SharedTypes "https://github.com/Crossmint/crossmint-sdk/tree/main/packages/common/base/src/types"
    click BlockchainUtils "https://github.com/Crossmint/crossmint-sdk/tree/main/packages/common/base/src/blockchain"
    click AuthCommon "https://github.com/Crossmint/crossmint-sdk/tree/main/packages/common/auth"
    click AuthServer "https://github.com/Crossmint/crossmint-sdk/tree/main/packages/server"
    click APIServices "https://github.com/Crossmint/crossmint-sdk/tree/main/packages/client/base/src/services/api"
    
    %% Style Applications
    class AuthClient,WalletMgmt,PaymentProc,UIComponents,ReactUI,VueUI,VanillaUI,SmartWallet,WalletConnect client
    class AuthServer,APIServices server
    class BaseUtils,SharedTypes,BlockchainUtils,AuthCommon common
    class BlockchainNetworks,PaymentProcessors,AuthProviders,Web3Wallets external
```
