Skip to content

Commit fe16723

Browse files
committed
Update content lists and bundle some text into paragraphs with minor changes
1 parent fa05baa commit fe16723

File tree

1 file changed

+67
-33
lines changed
  • pages/lessons/projects

1 file changed

+67
-33
lines changed

pages/lessons/projects/5.mdx

Lines changed: 67 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ Expect somewhere from one to six hours to complete the lesson, depending on your
2626

2727
## What are we building
2828

29-
In the first in this track of tutorials, you created a basic smart contract using Remix, you then shifted to a dedicated developer's environment and created and deployed an NFT contract to an actual test network. In lesson 3 you added tiers to your NFTs and finally learnt to make your contracts airtight using tests in lesson 4. Now we're going use all of this knowledge and connect it to a frontend for users to see and interact with.
29+
In the first in this track of tutorials, you created a basic smart contract using Remix. Then your shift to a dedicated developer's environment to create and deploy an NFT contract to an actual test network. In lesson 3 you added tiers to your NFTs. And you finally learnt to make your contracts airtight by building your own automated tests in the fourth in the series. Now we're going use all of this knowledge and connect it to a frontend for users to see and interact with.
3030

3131

3232

3333
We'll create a basic **NFT minting application** that displays the three tiers of NFTs
34-
created in our smart contract and gives users a one-click option to mint them. Once minted, users will be redirected to a page that displays information of their mint. We'll need some extra magic to make that all happen. For handling wallet connections to our application, we'll be introducing you to *RainbowKit*. And using the provided *hooks* from *WAGMI*, we can check the connection to the wallet and call functions from our smart contract through the frontend. *RainbowKit* and *WAGMI* are just another couple of shining examples of open source public goods. We love open source at *Developer_DAO*. Public goods are goood!
34+
created in our smart contract and gives users a one-click option to mint them. Once minted, users will be redirected to a page that displays information of their mint. We'll need some extra magic to make that all happen. For handling wallet connections to our application, we'll be introducing you to *RainbowKit*. And using the provided *hooks* from *WAGMI*, we can check the connection to the wallet and call functions from our smart contract through the frontend. *RainbowKit* and *WAGMI* are just another couple of shining examples of open source public goods. We love open source at *Developer_DAO*. And public goods are gooood!
3535

3636

3737
{/* - [RainbowKit](https://www.rainbowkit.com/docs/introduction) for out-of-the-box
@@ -46,11 +46,13 @@ functions from our smart contract through the frontend using the provided *hooks
4646
### Lesson breakdown
4747
### Quick breakdown of lesson steps */}
4848
## Lesson steps
49-
-
50-
-
51-
-
52-
-
53-
-
49+
- Set up our development environment with TierNFT project
50+
- initialise a nextJS app
51+
- Install RainbowKit, WAGMI and Ethers to create main application
52+
- import dependencies
53+
- Create an Index page as main entry point for displaying the app content.
54+
- Create NFT cards
55+
- Enable minting of NFTs in the application.
5456

5557

5658
<br/><br/>
@@ -59,12 +61,15 @@ functions from our smart contract through the frontend using the provided *hooks
5961
### Developer tooling
6062
### Developer tools and libraries we'll be using */}
6163
## Tools to get the job done
64+
- [nextJS](https://nextjs.org/) - a React framework for building a full-stack app
6265
- [RainbowKit](https://www.rainbowkit.com/docs/introduction) is a React library for out-of-the-box
6366
wallet management
64-
- [WAGMI](https://wagmi.sh/) is a collection of React hooks that allow us to work effectively with Ethereum
65-
-
67+
- [ethers](https://docs.ethers.org/v6/) is a compact JavaScript library for interacting with the Ethereum eco-system
68+
- [WAGMI](https://wagmi.sh/) is a collection of React hooks that allows us to work effectively with Ethereum
69+
- [Alchemy](https://dashboard.alchemy.com/) is an RPC provider that lets our app connect to the blockchain
6670
-
6771
-
72+
**always make sure you access up-to-date release notes and documentation*
6873

6974
Let's dive in!
7075
<br/><br/>
@@ -73,33 +78,62 @@ Let's dive in!
7378

7479
## Getting started
7580

76-
We're going to start where we left off in lesson 4. Open your code editor and
77-
`cd` into the **`TierNFT`** project directory.
78-
79-
For all things related to our frontend we are going to create a new sub-directory
80-
within our project's root directory to maintain good practice, keep our code clean,
81-
and easy to locate and read.
81+
We're going to start where we left off in *Write Automated Tests for your TierNFT*.
8282

83-
The first step is to initiate a [nextJS](https://nextjs.org/) application inside the
84-
project's root directory by running the following command.
83+
Open your code editor and `cd` into the **`TierNFT`** project directory. For all things related to our frontend we are going to create a new sub-directory within our project's root directory to maintain good practice, keep our code clean, and be easy to locate and read. The first step is to initiate a *nextJS* application.
8584

8685
<Callout emoji="💡">
87-
Make sure you are in your root directory before running the command.
86+
Make sure you are in your project's root directory before continuing.
8887
</Callout>
8988

90-
The command creates a sub-directory named `frontend` inside our root directory
89+
The next command creates a sub-directory named `frontend` inside our root directory
9190
and sets up all the necessary files and folders within it. The `create-next-app` command
92-
uses the `yarn` package manager by default. *But be careful...*
91+
uses the `yarn` package manager by default. **So be careful and choose your command accordingly**. We have been using `npm` as our package manager for all our previous builds, so we'll choose the `--use-npm` flags:
9392

94-
There is a chance that a different package manager has been used for your previous project
95-
set up, so check that out and choose your command accordingly:
9693

9794
```bash
98-
# default for yarn
95+
# choose the following for npm
96+
npx create-next-app frontend --use-npm
97+
98+
# careful, this is the default for yarn
9999
npx create-next-app frontend
100+
```
101+
{/* I'm assuming the following default steps are correct: */}
102+
Choose 'No' to all the options to create a default JavaScript project:
100103

101-
# possible alternative for npm
102-
npx create-next-app frontend --use-npm
104+
```bash
105+
paul@pcpiablo:~/D_D/d_d_academy/tierNFT$ npx create-next-app frontend --use-npm
106+
Need to install the following packages:
107+
108+
Ok to proceed? (y) y
109+
✔ Would you like to use TypeScript? … No / Yes
110+
✔ Would you like to use ESLint? … No / Yes
111+
✔ Would you like to use Tailwind CSS? … No / Yes
112+
✔ Would you like to use `src/` directory? … No / Yes
113+
✔ Would you like to use App Router? (recommended) … No / Yes
114+
✔ Would you like to customize the default import alias? … No / Yes
115+
Creating a new Next.js app in /home/paul/D_D/d_d_academy/tierNFT/frontend.
116+
117+
Using npm.
118+
119+
Initializing project with template: default
120+
121+
122+
Installing dependencies:
123+
- react
124+
- react-dom
125+
- next
126+
127+
128+
added 24 packages, and audited 25 packages in 12s
129+
130+
4 packages are looking for funding
131+
run `npm fund` for details
132+
133+
found 0 vulnerabilities
134+
Initialized a git repository.
135+
136+
Success! Created frontend at /home/paul/D_D/d_d_academy/tierNFT/frontend
103137
```
104138

105139
Once the setup is complete, we open the `frontend` directory and get cracking.
@@ -114,27 +148,25 @@ cd frontend
114148
## The Frontend
115149

116150
For users to easily interact with our smart contract and mint the NFTs we must
117-
provide an interface. A simple process that is easily accessible.
118-
119-
Let's start by creating a way to handle wallet connections.
151+
provide an interface. A simple process that is easily accessible. Let's start by creating a way to handle wallet connections.
120152

121153
### The Main Application
122-
154+
{/*I don't think we need all these links all through the lesson*/}
123155
We will use [RainbowKit](https://www.rainbowkit.com/docs/introduction) for handling
124156
the wallet connections. It provides us the ability to handle wallet connections,
125157
support for numerous wallets and a customisable `ConnectButton` out-of-the-box among
126-
other features. It relies on the [WAGMI](https://wagmi.sh/) and [ethers](https://docs.ethers.io/v5/)
158+
other features. It relies on the [WAGMI](https://wagmi.sh/) and [ethers](https://docs.ethers.org/v6/)
127159
libraries for interoperability between various chains and wallet providers and
128160
thus needs some configurations.
129161

130162
But first we need to install the necessary dependencies.
131163

132164
```bash
133-
yarn add @rainbow-me/rainbowkit wagmi ethers
165+
npm install @rainbow-me/rainbowkit wagmi ethers
134166
135-
# or
167+
# or if you have chosen to use yarn:
136168
137-
npm install @rainbow-me/rainbowkit wagmi ethers
169+
yarn add @rainbow-me/rainbowkit wagmi ethers
138170
```
139171

140172
To get this setup we need to start working on the `_app.js` file in the `/frontend/pages`
@@ -185,6 +217,7 @@ of our choice along with some other customisations.
185217
for the providers we will be using. In our app we are using an `alchemyProvider` along
186218
with a fall back `publicProvider`. A provider allows our application to communicate with
187219
a blockchain.
220+
{/* It would be better to have a side drawer on 'state' and 'useEffect' here. We already have a few external links, and we have hardly built anything so far in this lesson. That's a lot of potential rabbitholes. */}
188221
- `useEffect` and `useState` are react hooks that help us perform side effects and
189222
capture the state, respectively. More on [state](https://www.freecodecamp.org/news/what-is-state-in-react-explained-with-examples/)
190223
and the [useEffect](https://www.freecodecamp.org/news/react-useeffect-absolute-beginners/) hook.
@@ -226,6 +259,7 @@ be added simply using the following syntax: `chain.chain_name`.
226259
For custom providers, like the `alchemyProvider` we can pass in our private
227260
`apiKey` as well.
228261

262+
{/* Only the API key? Or the whole URL?: */}
229263
Set your API Key in a new file named `.env` inside our `frontend` directory
230264
as follows:
231265

0 commit comments

Comments
 (0)