This is a Next.js project bootstrapped with create-next-app and enhanced with Web3 functionality using Privy.
- Privy Wallet Integration: Seamless wallet connection with support for embedded wallets and external wallets
- Avalanche Network Support: Built for the Avalanche C-Chain and Fuji testnet
- Modern UI: Built with Tailwind CSS and Shadcn UI components
- TypeScript: Full type safety throughout the application
- Token Selector: Interactive token selection with balance display
- Theme Support: Dark/light mode with system preference detection
- Create a Privy account at https://privy.io
- Create a new app in the Privy Dashboard
- Get your Privy App ID from the dashboard
Create a .env.local file in the root directory with the following variables:
NEXT_PUBLIC_APP_URL=http://localhost:3000
NEXT_PUBLIC_ENVIRONMENT=development
NEXT_PUBLIC_PRIVY_APP_ID=your_privy_app_idnpm install
# or
yarn install
# or
pnpm installRun the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun devOpen http://localhost:3000 with your browser to see the result.
The app is configured to work with Privy's wallet system:
- Embedded Wallets: Automatically created for users without existing wallets
- External Wallets: Support for MetaMask, WalletConnect, and other popular wallets
- Avalanche Networks: Configured for both mainnet (43114) and testnet (43113)
src/components/providers/web3.tsx- Privy provider configurationsrc/components/connect-button.tsx- Wallet connection button with dropdownsrc/components/token-selector.tsx- Token selection with balance displaysrc/hooks/use-balance.ts- Balance fetching hooks for native and ERC20 tokenssrc/hooks/use-watch-balance.ts- Real-time balance monitoring
To learn more about the technologies used:
- Next.js Documentation - learn about Next.js features and API
- Privy Documentation - learn about Privy wallet integration
- Avalanche Documentation - learn about the Avalanche network
- Tailwind CSS - utility-first CSS framework
- Shadcn UI - re-usable components
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.