A modern, type-safe, and user-friendly frontend template for startering web3 project Ethereum. Built with Next.js 14, TypeScript, Tailwind CSS, and wagmi v2, wagmi cli.
- Type-Safe Contract Interactions: Fully typed smart contract interactions using wagmi v2
- Modern Stack: Built on Next.js 14 with App Router and Server Components
- Responsive Design: Mobile-first UI built with Tailwind CSS and NextUI
- Wallet Integration: Seamless wallet connection with RainbowKit
- State Management: React Query for server state and React Context for local state
- Developer Experience:
- TypeScript for type safety
- ESLint and Prettier for code quality
- Husky for git hooks
- Clone the repository:
git clone https://github.com/annasudol/web3-nextjs-wagmi-starter
cd ceb3-nextjs-wagmi-starter
- Install dependencies:
pnpm install
This will install all the dependencies
- Create a
.env
file and add your environment variables:
cp .env.example .env
- Start the development server:
pnpm run dev
Visit http://localhost:3000 to see the application.
## 📁 Project Structure
```sh
src/
├── components/ project components
├── config/ # project configurations
│ ├── wagmi-cli/ # wagmi codegen
| ├── rainbowConfig.ts # RainbowKit config
| ├── siteConfig.ts # Site configuration
├── lib/ # Utility functions
| ├── format/ # Formatting functions
| ├── wagmi-cli/ # wagmi codegen
| ├── envs.ts # Environment variables
| ├── logger.ts # Logger
| ├── zod.ts # Zod schemas for environment variables
└── providers/ # App level providers
The project uses wagmi CLI for type-safe contract interactions. Contract ABIs and hooks are auto-generated:
[contract at sepolia.etherscan.io] (https://sepolia.etherscan.io/address/0xEb8a559c7F317C24f08405B40e6b1f3c83CDC76c)
pnpm run dev
- Start development serverpnpm run build
- Build production bundlepnpm run start
- Start production serverpnpm run lint
- Run ESLintpnpm run format
- Format code with Prettierpnpm run codegen
- Generate Wagmi hooks and ABI are auto-generated:
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes using conventional commits
- Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
- wagmi for the Ethereum development toolkit
- RainbowKit for the wallet connection UI
- nextui for the component library