Live Demo: https://next-web3-template-umber.vercel.app/
A Next.js Web3 project template, powered by TypeScript, RainbowKit, Wagmi, Shadcn, and TailwindCSS. This template is designed to streamline the creation of Web3 applications with SIWE (Sign-In With Ethereum) authentication, a theme toggler, and modern design patterns.
This template includes the following key features:
- Next.js with TypeScript: Full TypeScript support for modern, scalable applications.
- RainbowKit + Wagmi: Seamless Ethereum wallet connection and Web3 functionality with built-in wallet UI.
- SIWE (Sign-In With Ethereum): Pre-configured authentication solution for decentralized logins using NextAuth.
- TailwindCSS: A utility-first CSS framework for fast and responsive design.
- Shadcn Components: A customizable component library built on TailwindCSS for building modern UIs.
- Theme Toggle: Dark/light mode toggler with TailwindCSS-based theme switching.
- React Query: Integrated for managing server state and caching.
- NextAuth: Secure authentication setup, with support for Web3-based logins.
- Bun for Fast Package Management: Support for Bun to speed up dependency installation and script execution.
The Next.js + SIWE Template aims to provide developers with a quick and efficient starting point for building Web3 applications. The key objectives are:
- Speed: Reduce the time to start a Web3 project by providing a pre-configured Next.js setup.
- Ease of Use: Provide a fully functional template that includes wallet integration, authentication, and styling out of the box.
- Customizable: Allow developers to extend or modify the template as per their project needs.
- Best Practices: Promote best practices by using well-maintained libraries like RainbowKit, Wagmi, NextAuth, Shadcn, and TailwindCSS.
-
Clone the Template:
Click the "Use this template" button at the top of this repository to create a new project based on this template.
-
Clone via CLI:
Alternatively, you can clone the repository using the CLI:
git clone https://github.com/CJskii/next-web3-template.git my-web3-app cd my-web3-app
-
Install Dependencies:
This project uses Bun for managing dependencies. If you don't have Bun installed, follow the installation instructions here.
- Once Bun is installed, run:
bun install
- Set up Environment Variables:
Copy the .env.example file to .env.local and update the variables as needed:
cp .env.example .env.local
- Start the development server:
bun run dev
- Open http://localhost:3000 to view the app.
We welcome contributions to improve this template. Here's how you can get involved:
-
Fork the repository: Start by forking this repository to your GitHub account.
-
Clone your fork: Clone your forked repository to your local machine.
git clone https://github.com/yourusername/next-web3-template.git
cd next-web3-template
- Create a new branch: Create a new branch for your feature or fix.
git checkout -b feature/your-feature-name
-
Make your changes: Make the necessary changes to the template.
-
Commit your changes:
git add .
git commit -m "Add your feature description here"
- Push your changes:
git push origin feature/your-feature-name
- Open a pull request: Submit a pull request to the main repository for review.
Have an idea for a new feature? We'd love to hear from you! Please open an issue with a detailed description of the feature you'd like to see added to this template.
Feel free to include:
- The use case or problem the feature solves.
- How it fits within the current goals of the template.
- Any relevant links or references that may help explain your request.
next-web3-template/
β
βββ public/ # Public assets (e.g., favicon)
β βββ favicon.ico
βββ src/ # Source files
β βββ assets/ # Other assets
β β βββ icons/ # Icon assets
β β β βββ social.tsx
β β βββ images/ # Image assets
β βββ components/ # UI components
β β βββ navigation/ # Navigation elements
β β β βββ header-sheet.tsx
β β β βββ navbar.tsx
β β β βββ navigation-menu.tsx
β β βββ ui/ # UI elements and components
β β βββ button.tsx
β β βββ connect-button.tsx
β β βββ dropdown-menu.tsx
β β βββ separator.tsx
β β βββ sheet.tsx
β β βββ theme-toggler.tsx
β β βββ typography.tsx
β β βββ footer.tsx
β βββ lib/ # Utility functions and configurations
β β βββ utils.ts
β βββ pages/ # Next.js pages and API routes
β β βββ api/ # API routes (e.g., NextAuth)
β β β βββ auth/
β β β βββ [...nextauth].ts
β β βββ example/ # Example pages
β β β βββ index.tsx
β β βββ _app.tsx # Next.js custom App component
β β βββ 404.tsx # 404 page
β β βββ index.tsx # Homepage
β βββ styles/ # Global and module styles
β β βββ globals.css
β βββ wagmi.ts # Wagmi configuration for Web3
βββ .env.example # Example environment variables
βββ .gitignore # Files and directories to ignore in Git
βββ bun.lockb # Bun lock file for dependencies
βββ components.json # Shadcn component configuration
βββ next-env.d.ts # Next.js environment types
βββ next.config.js # Next.js configuration
βββ package.json # Project dependencies and scripts
βββ postcss.config.js # PostCSS configuration for TailwindCSS
βββ README.md # Project documentation
βββ tailwind.config.ts # TailwindCSS configuration
βββ tsconfig.json # TypeScript configuration
This project is licensed under the MIT License.
For any questions or inquiries, feel free to reach out via GitHub issues or open a discussion. We're happy to hear from the community and help with any issues you may encounter.