How hoanlv214/js-recall works
Project type and purpose
• This is a JavaScript/TypeScript monorepo (Turborepo + pnpm workspaces) named “js-recall.”
• It hosts two Next.js web applications under apps/—“portal” (main user dashboard) and “faucet” (test‐token dispenser)—plus a suite of shared packages under packages/ that implement:
– Core SDK (@recallnet/sdk) for interacting with the Recall network
– Extended SDK features (@recallnet/sdkx)
– A React UI component library (@recallnet/ui)
– Smart‐contract interfaces, chain configs, utilities (contracts, chains, address‐utils, bigint‐utils, fvm, network‐constants), tooling (agent-toolkit), and configuration packages (eslint-config, typescript-config, fonts).
File structure
• Top-level orchestrator:
– pnpm-workspace.yaml + turbo.json define the workspace and build pipelines.
– GitHub workflows (.github/workflows) handle CI (lint/test/build) and releases.
• Apps:
– apps/portal (Next.js 13+ with server/client components, Tailwind, custom hooks, API routes via next middleware, uses wagmi for wallet connections)
– apps/faucet (Next.js, simple token request UI)
• Shared packages:
– SDK layer (packages/sdk, packages/sdkx)
– UI layer (packages/ui)
– Domain & utilities (contracts, chains, fvm, network-constants, address-utils, bigint-utils)
– Tooling & config (eslint-config, typescript-config, fonts, agent-toolkit)
README for additional insights
• Confirms monorepo structure, development commands, per-package usage.
• Emphasizes use of Cursor for AI‐assisted development, but that does not impact runtime architecture.
Main components
• Monorepo workspace (Turborepo + pnpm) – build/orchestration layer
• CI/CD pipeline (GitHub Actions: code-quality, release)
• Applications (containers or rectangles):
– Portal (Next.js web app)
– Faucet (Next.js web app)
• Shared package modules (grouped under “packages”):
– SDK (@recallnet/sdk) – blockchain client layer
– SDKX (@recallnet/sdkx) – extended features
– UI (@recallnet/ui) – React components + theming
– Contracts, chains, address-utils, bigint-utils, fvm, network-constants – domain/data libraries
– Agent-toolkit – CLI/automation
• External services / networks:
– Recall network (blockchain nodes / IPFS)
– Wallet providers (e.g., MetaMask, WalletConnect)
– (Optional) Deployment platform (e.g., Vercel / Netlify)
Relationships and interactions
• Developer Workstation → pushes code → GitHub → triggers CI/CD → builds & publishes packages and apps.
• Portal & Faucet import shared packages at build time (pnpm workspace symlinks)
• At runtime:
– Browser users → interact with portal/faucet UI (React)
– Next.js server components / API routes → call @recallnet/sdk (and sdkx)
– SDK → RPC calls to blockchain nodes / IPFS gateways → ledger & storage
– Wallet connectors → user signatures → smart-contract interactions
• Agent-toolkit & other CLI tools are used by developers (not part of the runtime path).
Architectural patterns & design principles
• Monorepo modularity: clear separation of concerns between applications and libraries
• Next.js duality: server‐side rendering & client‐side interactivity
• Layered architecture:
– Presentation layer (packages/ui + Next.js pages/components)
– Application layer (apps/… custom logic, hooks, API routes)
– Domain layer (SDK + domain utilities + contracts)
– Infrastructure / external layer (blockchain, storage, CI/CD)
• Reusability: all business logic in packages, UI in a shared library, avoiding duplication.
Key details to capture
• Monorepo structure (two apps + many packages) and build orchestration
• Next.js apps consuming shared UI & domain libraries
• SDK as the single gateway to Recall network interactions
• External dependencies: blockchain nodes, IPFS, wallet connectors
• CI/CD workflows automating tests, builds, versioning, and publish