A clean, production-ready Web3 dApp that allows users to connect their wallet, view native balances, ERC-20 tokens, and NFTs across Ethereum, Polygon, and BNB Chain.
- Framework: Next.js 14
- Language: TypeScript
- Styling: Tailwind CSS
- Web3: Wagmi v2, Viem, RainbowKit
- Data: Alchemy SDK
- Node.js 18+ (20+ recommended)
- NPM or Yarn
-
Clone the repository
-
Install dependencies:
npm install
-
Configure Environment Variables: Copy
.env.exampleto.env.local:cp .env.example .env.local
Fill in your keys:
NEXT_PUBLIC_ALCHEMY_API_KEY: Get from Alchemy DashboardNEXT_PUBLIC_WALLETCONNECT_PROJECT_ID: Get from WalletConnect Cloud
npm run devOpen http://localhost:3000 in your browser.
- Open
src/lib/config.tsand add the chain fromwagmi/chains. - Open
src/services/AlchemyProvider.tsand updateCHAIN_TO_NETWORKmap to include the new chain ID and its corresponding Alchemy Network.
- Update
WalletAssetsinterface insrc/services/types.ts. - Fetch the new data in
AlchemyDataService.getAssets. - Add a new tab/section in
AssetDashboard.tsxto display it.
- Create a new class implementing
IBlockchainDataService(e.g.,MoralisDataService). - Update the instantiation in
AssetDashboard.tsx(or inject via context).