This repository contains the instructions and dependencies you need to start building a decentralized application (Dapp) on Thirdweb.
- A computer with an active internet connection.
- A code editor like Visual Studio Code.
- Node Version Manager (NVM) and Node Package Manager (NPM) setup.
You can enter these code snippets in your terminal.
-
Install Homebrew:
Before we can install NVM and NPM, you need to have Homebrew installed:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
-
Create NVM Working Directory:
mkdir ~/.nvm
-
Configure NVM:
Add the necessary configurations to your
~/.zshrc
file:echo 'export NVM_DIR="$HOME/.nvm"' >> ~/.zshrc echo '[ -s "/usr/local/opt/nvm/nvm.sh" ] && \. "/usr/local/opt/nvm/nvm.sh" # This loads nvm' >> ~/.zshrc echo '[ -s "/usr/local/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/usr/local/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion' >> ~/.zshrc source ~/.zshrc
-
Install Node using NVM:
nvm install node
-
Resolve Potential Errors:
If you encounter a
http-stream
and/orpolyfill
error, resolve it by:npm install stream-http https-browserify browserify-zlib url
-
Webpack Configuration:
Create a new file in your project folder named
webpack.config.js
and paste the following code:module.exports = function override(config, env) { config.resolve = config.resolve || {}; config.resolve.fallback = config.resolve.fallback || {}; config.resolve.fallback["http"] = false; config.resolve.fallback["https"] = false; config.resolve.fallback["zlib"] = false; config.resolve.fallback["url"] = false; return config; }
-
Check if Node.js is Installed:
If not, download and install it from Node.js official site.
-
Set the $PATH:
Ensure that the computer recognizes the Node.js command by setting the $PATH.
-
Install Necessary Packages:
npm i @thirdweb-dev/react @thirdweb-dev/sdk ethers@^5
-
Create Your App with Thirdweb:
npx thirdweb create app
-
Start Your Dapp:
npm start