Next.js AppKit Starter is an open-source project that provides a powerful and flexible starting point for building Web3 dapps using Next.js, AppKit, and Wagmi. This starter kit is designed to help developers quickly set up and start building decentralized applications (dApps) with best practices and modern tooling.
- Features
- Prerequisites
- Getting Started
- Project Structure
- Configuration
- Usage
- Deployment
- Contributing
- License
- Next.js 13+ with App Router
- AppKit integration for smart contract interactions
- Wagmi hooks for Ethereum interactions and wallet management
- Tailwind CSS for styling
- TypeScript support
- ESLint and Prettier for code quality
Before you begin, ensure you have the following installed on your local machine:
- Node.js (v14.0.0 or later)
- pnpm or npm (v6.0.0 or later) or yarn (v1.22.0 or later)
- Git
To get started with the Next.js AppKit Starter, follow these steps:
-
Clone the repository:
git clone https://github.com/michojekunle/appkit-starter.git cd appkit-starter
-
Install the dependencies:
pnpm install # or npm install # or yarn install
-
Copy the example environment file and update it with your values:
cp .env.example .env.local
Edit the
.env.local
file and add your project-specific variables. -
Start the development server:
pnpm dev # or npm run dev # or yarn dev
-
Open http://localhost:3000 in your browser to see the application running.
The project structure follows Next.js 13+ conventions with the App Router:
nextjs-appkit-starter/
├── app/
│ ├── _components/
│ │ ├── appkit-wagmi-integration.tsx
│ │ ├── header.tsx
│ │ ├── index.tsx
│ │ └── initial-state-provider.tsx
│ ├── layout.tsx
│ └── page.tsx
├── components/
│ ├── ui/
│ └── ...
├── public/
│ └── ...
├── styles/
│ └── globals.css
├── .env.example
├── .eslintrc.json
├── .gitignore
├── next.config.js
├── package.json
├── README.md
├── tailwind.config.js
└── tsconfig.json
-
Update the
.env.local
file with your project-specific variables:NEXT_PUBLIC_PROJECT_ID=your_wallet_connect_project_id NEXT_PUBLIC_CONTRACT_ADDRESS=your_contract_address
-
Modify the
next.config.js
file if you need to add custom Next.js configuration. -
Update the
tailwind.config.js
file to customize your Tailwind CSS setup.
The components/appkit-wagmi-integration.tsx
file demonstrates how to use AppKit and Wagmi hooks to interact with smart contracts. You can use this as a reference for implementing your own contract interactions.
The project uses AppKit for wallet connection. The w3-button
component is already integrated into the layout, allowing users to connect their wallets easily.
- Update the content in
app/page.tsx
to customize the landing page. - Modify the
components/header.tsx
file to change the header content and styling. - Add your own smart contract ABIs and addresses in the
components/appkit-wagmi-integration.tsx
file. - Customize the overall styling by editing the
styles/globals.css
file and using Tailwind CSS classes.
To deploy your Next.js AppKit Starter project, you can use platforms like Vercel, Netlify, or any other hosting service that supports Next.js applications. Follow these general steps:
- Push your code to a Git repository (e.g., GitHub, GitLab, Bitbucket).
- Connect your repository to your chosen hosting platform.
- Configure your environment variables on the hosting platform.
- Deploy your application.
For specific deployment instructions, refer to your hosting provider's documentation.
We welcome contributions to the Next.js AppKit Starter project! Here's how you can contribute:
- Fork the repository on GitHub.
- Clone your forked repository to your local machine.
- Create a new branch for your feature or bug fix:
git checkout -b feature/your-feature-name
- Make your changes and commit them with a descriptive commit message.
- Push your changes to your fork on GitHub:
git push origin feature/your-feature-name
- Open a pull request from your fork to the main repository.
Please ensure that your code follows the project's coding standards and includes appropriate tests if applicable.
If you encounter any bugs or have suggestions for improvements, please open an issue on the GitHub repository. Provide as much detail as possible, including steps to reproduce the issue and your environment details.
Please note that this project is released with a Contributor Code of Conduct. By participating in this project, you agree to abide by its terms.
This project is licensed under the MIT License. See the LICENSE file for details.
I hope you find the Next.js AppKit Starter helpful for your Web3 Dapp development journey. If you have any questions or need further assistance, please don't hesitate to reach out or open an issue on GitHub. Happy coding!