Create Web3 Dapp Quickstart (2024)

What's included inside create-web3-dapp?

In this guide, you'll learn how to kickstart your application boilerplates using create-web3-app. Before getting started, here's what will be included in your environment:

  • Next.js
  • Wagmi Hooks
  • Ethers.js
  • Rainbowkit
  • Alchemy SDK

Supported chains

Create-web3-dapp supports all of the major EVM-based chains powered by the state-of-the-art Alchemy super node technology:

  • Ethereum
  • Polygon
  • Arbitrum
  • Optimism

Pre-requisites:

To use create-web3-dapp (CW3D), you'll need to have Node.js version > 16.16 installed on your computer.

You can check the version of nodejs by running the following command in your terminal or command line:

node -v// v16.16.0

You can install NodeJs from the official website - make sure to select the recommended LTS version.

Once Node is installed, let’s get started building using Create Web3 DApp ⚡

1. Install the CW3D NPX package

In your terminal, navigate to the folder you want to create your project in and run:

npx create-web3-dapp@latest

Create Web3 Dapp Quickstart (1)

🚧

If you've previously installed create-web3-dapp globally via npx create-web3-dapp:

The CLI builder will notify you if a new version has been released. In any case, we always suggest you to run using the latest available version by running npx create-web3-dapp@latest.

You'll now get asked to insert a project name and a template to start from:

  • Create empty full-stack dapp: With is option, you will be given an empty full-stack dapp with a wallet connection built-in using Rainbow Kit. Optionally, you can also choose to add a blockchain development environment (Hardhat or Foundry) in the project and add a pre-defined smart contract like ERC721, ERC721A, etc.
  • Create pre-built template: You can select a pre-built template for a dapp with this option. Right now, we have the Block Explorer dapp as a template, and we are actively working on adding more templates soon!

Choose the "Create empty full-stack dapp" option. If you want to go with a prebuilt template, you can check out the docs for prebuilt templates.

Create Web3 Dapp Quickstart (2)

3. Choose your chain

Once you have selected your starting template, you'll need to choose the chain you want to configure your project for. Note that you can always modify or add more chains in the future. Current choices include:

  • Ethereum
  • Polygon
  • Arbitrum
  • Optimism

Create Web3 Dapp Quickstart (3)

4. Select testnet or mainnet

Select if you want to configure with mainnet or testnet. We generally recommend starting with a testnet if you're not ready to deploy to the live chain yet. Here are the corresponding test networks for each chain:

  • Ethereum -> Goerli
  • Polygon -> Mumbai
  • Arbitrum -> Arb-Goerli
  • Optimism -> Opt-Goerli

Create Web3 Dapp Quickstart (4)

5. [Optional] Select your blockchain development environment

If you haven't yet created, built, or deployed your smart contracts, you'll be able to install a blockchain development environment directly through CW3D.

Blockchain development environments like Hardhat or Foundry provide a streamlined and efficient way for developers to build, test and deploy smart contracts.

Adding a Blockchain development environment will also allow you to get access to the Smart Contracts Backpack - a CLI implementation of the OpenZeppelin smart contract libraries.

You can skip this step if you are not using any blockchain development environment and jump to Step 6.

You will see these options for selecting the blockchain development environment:

  1. Hardhat: Hardhat is a reliable, flexible, and extensible development environment for building EVM-based smart contracts.
  2. Foundry(coming soon): Foundry is a user-friendly, collaborative, and secure blockchain development platform that accelerates the process of building and deploying smart contracts.

Create Web3 Dapp Quickstart (5)

Select Hardhat as that's the only option available right now. Then it will ask you if you want an empty Hardhat project or if you want to create a smart contract right from the CLI. You can select NO if you want an empty Hardhat project but here we will select YES to showcase how you can create the smart contracts from CLI using the Smart Contract Backpack!

Create Web3 Dapp Quickstart (6)

The Smart Contract Backpack allows developers to create production-ready and fully audited smart contracts, directly from the CLI in a matter of seconds - ready to be deployed on the blockchain.

The Smart Contract Backpack is built on top of the OpenZeppelin library and supports the almost same standards:

  • ERC721
  • ERC721A (coming soon)
  • ERC20 (coming soon)
  • ERC1155 (coming soon)

The contract creation process is pretty straightforward:

  1. Select a standard
  2. Select a name - this will be the name of your smart contract and token
  3. Select a symbol - this will be the symbol of your smart contract and token
  4. Select the libraries you want to include - see the OpenZeppelin documentation to learn more about the available libraries for every standard

Next, you will be shown some pre-made smart contracts (ERC721, ERC1155 etc.) and you can select one of them to include in your project, select ERC721 as that's the only option right now (we're working on adding more):

Create Web3 Dapp Quickstart (7)

Next, you will be asked to give a name to your smart contract:

Create Web3 Dapp Quickstart (8)

After that, you will need to define a symbol for your ERC721 tokens:

Create Web3 Dapp Quickstart (9)

Next, you will be asked to select the libraries you want to include - see the OpenZeppelin documentation to learn more about the available libraries for every standard:

Create Web3 Dapp Quickstart (10)

Select yes after you are done selecting the features:

Create Web3 Dapp Quickstart (11)

6. Create an Alchemy Account or Enter your API key

Then, you will be asked if you already have an Alchemy account, selecting yes or no based on whether or not you have the Alchemy account.

Create Web3 Dapp Quickstart (12)

If you already have an Alchemy account, you will be redirected to your Alchemy dashboard, from where you can copy and paste your API key into the terminal.

Create Web3 Dapp Quickstart (13)

Create Web3 Dapp Quickstart (14)

If not, you will be redirected to create a new Alchemy account and after creating the Alchemy account you can copy and paste your API key in the terminal.

We'll use an Alchemy API key to connect to the blockchain, read data, and deploy smart contracts.

Create Web3 Dapp Quickstart (15)

That's it! Now you're ready to rock! 🚀 To launch CW3D, simply cd into your new project folder or your project's frontend folder (if you are using a blockchain development environment) and run:

npm run dev. This should open up the app on http://localhost:3000

Create Web3 Dapp Quickstart (16)

What will CW3D already configure?

The above steps allow you to customize create-web3-dapp for your needs, but we also do a lot of work under the hood to ensure your project is ready to go once you run it! Here are the things that we automatically configure for you:

  1. Environment variables: to safely store sensitive data (ex: API Keys) that are used in your application
  2. Developer Environment Installation: when you select a developer environment, we'll install that package for you automatically
  3. Other Dependencies: We'll make sure you get all the right dependencies so you can focus on building your application
  4. Wallet interactions: We've automatically set up Rainbow kit for you to interact with wallets straight from the app

Congratulations! You've completed the setup process 🎉

There are 3 steps we'll need to go through to get the most out of create-web3-dapp:

  1. Modify the .env.local file
  2. Run the smart contract marketplace and get access to tens of production-ready components
  3. Explore the Alchemy Eco-system to get access to some of the most used Web3 developers' tools

Before going straight to modifying our .env.local file, make sure to familiarize yourself with the create-web3-dapp folder structure

Open the DApp folder created by the Create Web3 Dapp CLI builder, and open the .env.local file. If you have decided to install a Blockchain development environment, open the .env.local file inside the awsome-dapp/frontend folder.

Even if you have chosen the network during the setup process, is good to know that you can change the main network of your DApp, both Wallet and Alchemy SDK, through the .env.local file.

In the .env.local file, you’ll find these variables:

ALCHEMY_API_KEY=YOUR_ALCHEMY_API_KEYALCHEMY_NETWORK=YOUR-CHAINNEXT_PUBLIC_DEFAULT_CHAIN=YOUR-CHAIN-BUT-IN-RAINBOW-FORMAT
  • The Alchemy API Key is used to power most of the React components you’ll import from the Create Web3 Dapp components marketplace, to connect using your wallet, plus you’ll also need an Alchemy API key to connect with the Supernode infrastructure.
  • The Network is used to set up the main network on the Alchemy SDK.
  • The Default Chain is used to set up the initial chain on the Rainbow wallet.

🚧

The .env.local file

Most of the components hosted on createweb3dapp.com heavily rely on third-party APIs. It is assumed, for the components to work, that you store your APIs in the .env.local file.

If you haven’t installed a Blockchain Development Environment, feel free to jump to the components documentation or continue reading to learn how to configure your blockchain development environment.

Open the .env file in the backend folder of your DApp, you’ll find three variables:

ALCHEMY_API_KEY=YOUR-ALCHEMY-API-KEYETHERSCAN_API_KEY=PRIVATE_KEY=
  • The Alchemy API Key env variable is used in the hardhat.config.js file to connect Hardhat to the Alchemy Supernode and allow you to deploy and interact with your contracts on chain.

  • The Etherscan API is used to verify your smart contracts on Etherscan through Hardhat.

  • Your Private key is used to deploy the smart contracts on-chain and assigned as an owner of the contracts deployed through hardhat.

From here, you can customize the project to build your own web3 full-stack dapp 🚀

If you have any questions/feedback regarding create-web3-dapp, feel free to reach out on our telegram group for create-web3-dapp.

Continue Reading

  • How to add components to create-web3-dapp

Updated about 1 year ago

What’s Next

  • Create Web3 Dapp Folder structure
Create Web3 Dapp Quickstart (2024)
Top Articles
Chrome now hides notification content when screen sharing to keep alerts private
How to Negotiate Salary with Your Employer and Get the Raise You Deserve
Po Box 7250 Sioux Falls Sd
Uca Cheerleading Nationals 2023
Hotels
What is Mercantilism?
Algebra Calculator Mathway
Asian Feels Login
Shs Games 1V1 Lol
Notary Ups Hours
Tanger Outlets Sevierville Directory Map
Craigslist Phoenix Cars By Owner Only
Ladyva Is She Married
83600 Block Of 11Th Street East Palmdale Ca
Seafood Bucket Cajun Style Seafood Restaurant in South Salt Lake - Restaurant menu and reviews
How Many Slices Are In A Large Pizza? | Number Of Pizzas To Order For Your Next Party
R Personalfinance
Danforth's Port Jefferson
Lola Bunny R34 Gif
Rs3 Eldritch Crossbow
Dulce
Craigslist Maryland Trucks - By Owner
Craigslist Roseburg Oregon Free Stuff
At 25 Years, Understanding The Longevity Of Craigslist
Criterion Dryer Review
WPoS's Content - Page 34
Www Mydocbill Rada
Miles City Montana Craigslist
Alternatieven - Acteamo - WebCatalog
Calvin Coolidge: Life in Brief | Miller Center
Nurofen 400mg Tabletten (24 stuks) | De Online Drogist
Missing 2023 Showtimes Near Mjr Southgate
Kristen Hanby Sister Name
Have you seen this child? Caroline Victoria Teague
Tmj4 Weather Milwaukee
Car Crash On 5 Freeway Today
Ishow Speed Dick Leak
Stanley Steemer Johnson City Tn
Lovein Funeral Obits
Carroll White Remc Outage Map
How Big Is 776 000 Acres On A Map
Professors Helpers Abbreviation
Gabrielle Abbate Obituary
Market Place Tulsa Ok
Hdmovie2 Sbs
Myapps Tesla Ultipro Sign In
Smoke From Street Outlaws Net Worth
Pulpo Yonke Houston Tx
Cataz.net Android Movies Apk
Affidea ExpressCare - Affidea Ireland
Latest Posts
Article information

Author: Jonah Leffler

Last Updated:

Views: 6571

Rating: 4.4 / 5 (45 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Jonah Leffler

Birthday: 1997-10-27

Address: 8987 Kieth Ports, Luettgenland, CT 54657-9808

Phone: +2611128251586

Job: Mining Supervisor

Hobby: Worldbuilding, Electronics, Amateur radio, Skiing, Cycling, Jogging, Taxidermy

Introduction: My name is Jonah Leffler, I am a determined, faithful, outstanding, inexpensive, cheerful, determined, smiling person who loves writing and wants to share my knowledge and understanding with you.