Alchemy: Create a Full-Stack dApp
Learn how to create a full-stack dApp for minting NFTs using Alchemy and Filebase.
What is a dApp?
1. Start by cloning the Github repository for this project:
2. Next, install the alchemy-web3 package:
3. Navigate to the minter-starter-files directory:
4. Next, install the required dependencies of the project:
5. Your default app will be launched at http://localhost:3000. It should look like this:

6. Now let’s edit this app. Open the file located in the src directory called Minter.js and open this file in your code editor of choice.
src directory called Minter.js and open this file in your code editor of choice.7. Next, head over to the Göerli Faucet and send your wallet some fake ETH to use with our dApp:

8. Next, create a new directory called utils in the src directory.
utils in the src directory.9. Open this interact.js file in your code editor. Input the following code into this file:
interact.js file in your code editor. Input the following code into this file:10. Head back to the Minter.js file. Add the following line to the top of the file:
Minter.js file. Add the following line to the top of the file:11. Then, in the functions section in the connectWalletPressed function, add the following code to call the connectWallet function:
connectWalletPressed function, add the following code to call the connectWallet function:12. Then in the useEffect function, add the following code to call the get CurrentWalletConnected function:
useEffect function, add the following code to call the get CurrentWalletConnected function:13. Save your files.

14. Next, in your Minter.js file, we need to add the function addWalletListener.
Minter.js file, we need to add the function addWalletListener.15. Now we need an image to use as an NFT. We’ll start by uploading an image to Filebase for us to use.
16. Select ‘Buckets’ from the left side bar menu, or navigate to console.filebase.com/buckets.

17. Enter a bucket name and choose the IPFS storage network to create the bucket.

18. Next, select the bucket from your list of buckets, then select ‘Upload’ in the top right corner to upload an image file.

19. Select your images to be uploaded.

20. You can view the object’s IPFS CID in the CID column, or you can click on your uploaded object to display the metadata for the object, which includes the IPFS CID.

22. From the Alchemy dashboard, we need to create an app.

23. Create a new app. For our example, we called our app NFTs.

24. Then, from our App’s page, select ‘View Key’:

25. Copy your app’s HTTP Key:

26. Then in your interact.js file, insert the following lines at the top of the file:
interact.js file, insert the following lines at the top of the file:27. Then at the bottom of the file, insert the following code:
28. Head back to your Minter.js file.
Minter.js file.29. Then, still within the Minter.js file, edit the onMintPressed function to resemble the following:
Minter.js file, edit the onMintPressed function to resemble the following:30. Now, head over to your dApp running at localhost:3000.
localhost:3000.
31. It’s time to mint!

32. Your transaction will be returned in your dApp for you to view on Etherscan:

PreviousAlchemy: Build a dApp That Provides Real-Time Ethereum Transaction NotificationsNextAlchemy: Create a Hello World Smart Contract
Last updated