# recallnet/js-recall architecture

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

- Interactive diagram: https://gitdiagram.com/recallnet/js-recall
- Repository: https://github.com/recallnet/js-recall

## Overview

##### File Structure Components
- Top-Level Directories:
- apps – contains end-user applications such as the “portal” (primary web app) and “faucet” (token distribution tool).
- packages – includes shared libraries such as the core SDK, UI component library, smart contracts, blockchain-related utilities, address/BigInt manipulation utilities, and configuration packages.
- .changeset, .cursor, GitHub config directories, and various configuration files (ESLint, Prettier, TypeScript config) that support monorepo-level consistency and CI/CD.
- This structure indicates that each app uses a combination of these packages to deliver its functionality, while the packages themselves are developed and maintained centrally.

##### Key Components & Their Relationships
- Applications:
- Portal App: The main web application, using UI components, hooks, and utility libraries for frontend operations.
- Faucet App: A specialized interface (likely for token requests) integrating similar shared components.
- Shared Packages:
- SDK & SDKX: They form the core of the business logic and provide the API client interfaces (for example, connecting to blockchain systems or managing Recall’s entities).
- UI Library: Provides a set of reusable React components (buttons, dialogs, etc.) that both apps use to maintain consistent styling and behavior.
- Contracts & Chains: Likely provide smart contract interfaces and chain-specific configurations for interacting with blockchain networks.
- Other Utilities: Address-utils, BigInt-utils, FVM, etc. add domain-specific functionality and are reused across applications.
- Development & Configuration:
- Tools like Turborepo orchestrate builds, pnpm workspaces manage package dependencies, and the shared ESLint/TypeScript configurations ensure style and type consistency.
- Cursor and other IDE-specific configuration files indicate optimized workflows for development and team collaboration.

## Diagram (Mermaid)

```mermaid
graph TD
  O["Turborepo & pnpm Workspaces"]:::orchestration
  
  subgraph "Applications"
    Portal["Portal App"]:::app
    Faucet["Faucet App"]:::app
  end
  
  subgraph "Shared Packages"
    SDK["SDK"]:::package
    SDKX["SDKX"]:::package
    UI["UI Library"]:::package
    Contracts["Smart Contracts Interface"]:::package
    Chains["Chain Configurations"]:::package
    AUtils["Address Utilities"]:::package
    BigIntUtils["BigInt Utilities"]:::package
    FVM["FVM"]:::package
    AgentToolkit["Agent Toolkit"]:::package
    NetworkConstants["Network Constants"]:::package
  end

  O --> Portal
  O --> Faucet
  
  Portal -->|"consumes"| UI
  Portal -->|"calls"| SDK
  
  Faucet -->|"consumes"| UI
  Faucet -->|"calls"| SDK

  SDK -->|"interfaces"| Contracts
  SDK -->|"configures"| Chains
  SDK -->|"uses"| AUtils
  SDK -->|"uses"| BigIntUtils
  SDK -->|"integrates"| FVM

  SDKX -->|"provides"| AgentToolkit
  SDKX -->|"provides"| NetworkConstants

  click Portal "https://github.com/recallnet/js-recall/tree/main/apps/portal"
  click Faucet "https://github.com/recallnet/js-recall/tree/main/apps/faucet"
  click SDK "https://github.com/recallnet/js-recall/tree/main/packages/sdk"
  click SDKX "https://github.com/recallnet/js-recall/tree/main/packages/sdkx"
  click UI "https://github.com/recallnet/js-recall/tree/main/packages/ui"
  click Contracts "https://github.com/recallnet/js-recall/tree/main/packages/contracts"
  click Chains "https://github.com/recallnet/js-recall/tree/main/packages/chains"
  click AUtils "https://github.com/recallnet/js-recall/tree/main/packages/address-utils"
  click BigIntUtils "https://github.com/recallnet/js-recall/tree/main/packages/bigint-utils"
  click FVM "https://github.com/recallnet/js-recall/tree/main/packages/fvm"
  click AgentToolkit "https://github.com/recallnet/js-recall/tree/main/packages/agent-toolkit"
  click NetworkConstants "https://github.com/recallnet/js-recall/tree/main/packages/network-constants"
  
  classDef app fill:#f9e79f,stroke:#b9770e,stroke-width:2px;
  classDef package fill:#aed6f1,stroke:#2874a6,stroke-width:2px;
  classDef orchestration fill:#d5f5e3,stroke:#27ae60,stroke-width:2px;
```
