| name | alchemy-reference-architecture |
| description | Implement reference architecture for Alchemy-powered Web3 applications.
Use when designing dApp infrastructure, planning multi-chain deployments,
or structuring a production blockchain application.
Trigger: "alchemy architecture", "dApp architecture", "alchemy project structure",
"web3 system design", "alchemy multi-chain design".
|
| allowed-tools | Read, Write, Edit |
| version | 1.5.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","blockchain","web3","alchemy","architecture"] |
| compatibility | Designed for Claude Code |
Alchemy Reference Architecture
System Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Frontend (React/Next.js) โ
โ - Wallet connection (MetaMask, WalletConnect) โ
โ - Portfolio dashboard โ
โ - NFT gallery โ
โ - Transaction history โ
โโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ HTTPS (no API key exposed)
โโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ API Layer (Next.js/Express) โ
โ - /api/balance/:address โ
โ - /api/nfts/:owner โ
โ - /api/tokens/:address โ
โ - /api/transactions/:address โ
โ - /webhooks/alchemy (webhook receiver) โ
โโโโโโโโโฌโโโโโโโโโโโฌโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ โ
โโโโโโผโโโโ โโโโโผโโโโโ โโโโผโโโโโโโ
โAlchemy โ โAlchemy โ โAlchemy โ
โCore APIโ โNFT API โ โNotify โ
โ(RPC) โ โ โ โ(Webhooksโ
โโโโโโโโโโ โโโโโโโโโโ โโโโโโโโโโโ
ETH/Polygon/ARB/OP/Base
Project Structure
web3-dapp/
โโโ src/
โ โโโ alchemy/
โ โ โโโ client-factory.ts # Multi-chain Alchemy client factory
โ โ โโโ cache.ts # Response caching with TTL
โ โ โโโ throttler.ts # CU-aware rate limiter
โ โ โโโ errors.ts # Error classification
โ โโโ portfolio/
โ โ โโโ fetcher.ts # Wallet portfolio aggregator
โ โ โโโ transactions.ts # Transaction history analyzer
โ โ โโโ multi-chain.ts # Cross-chain balance aggregator
โ โโโ nft/
โ โ โโโ collection.ts # NFT collection explorer
โ โ โโโ batch-metadata.ts # Batch metadata fetcher
โ โ โโโ verify-ownership.ts # NFT ownership verification
โ โโโ contracts/
โ โ โโโ read-contract.ts # Smart contract read operations
โ โ โโโ abis/ # Contract ABI files
โ โโโ webhooks/
โ โ โโโ handler.ts # Webhook endpoint
โ โ โโโ verify.ts # HMAC signature verification
โ โ โโโ event-router.ts # Event type routing
โ โโโ security/
โ โ โโโ validators.ts # Input validation (addresses, blocks)
โ โ โโโ proxy.ts # API key proxy for frontend
โ โโโ api/ # API route handlers
โโโ tests/
โ โโโ unit/ # Unit tests (mocked Alchemy)
โ โโโ fork/ # Mainnet fork tests (Hardhat)
โ โโโ integration/ # Sepolia integration tests
โโโ contracts/ # Solidity contracts (if applicable)
โโโ hardhat.config.ts # Hardhat + Alchemy fork config
โโโ package.json
Key Design Decisions