Scaffold Alchemy Quickstart
Learn to quickly build awesome web3 dapps with scaffold-alchemy
Installation
Requirements
Before you begin, you need to install the following tools:
- Node (>= v18.17)
- Yarn (v1 or v2+)
- Git
Setup
For a simplified setup, Scaffold-Alchemy offers a npx tool that guides you interactively through the setup:
npx create-web3-dapp@latest
You will be presented with a prompt:
- Project Name: Enter a name for your project, e.g., my-dapp-example.
Once the setup is complete, navigate to the project directory:
cd project-name
Environment
Now that our installation is complete, let's configure the development environment for Scaffold-Alchemy.
1. Setup Your Environment Variables:
- setup account kit on dashboard
- update gas policy id
- update API key
- set your chain
2. Deploy Your Smart Contract:
In a terminal, deploy the test contract:
yarn deploy
This command deploys a test smart contract to the chain of your choice. The contract can be modified to suit your needs and can be found in packages/hardhat/hardhat.config.ts
The yarn deploy
command uses a deploy script to deploy the contract to the network. You can customize the deployment script located in: packages/hardhat/deploy
3. Launch your NextJS Application:
In the third terminal, start your NextJS app:
yarn start
Visit your app on http://localhost:3000
. You can interact with your smart contract using the contract component or the example ui in the frontend.
What's Next:
- Edit your smart contract:
YourContract.sol
inpackages/hardhat/contracts
- Edit your deployment scripts:
packages/hardhat/deploy
- Edit your frontend homepage at
packages/nextjs/app/page.tsx
. For guidance on routing and configuring pages/layouts checkout the Next.js documentation. - Edit the app config in
packages/nextjs/scaffold.config.ts
- Edit your smart contract test in:
packages/hardhat/test
to run test useyarn hardhat:test
Updated 9 days ago