Skip to content

Commit 1c5c553

Browse files
authored
Refactor build e2e dapp guide (#851)
* refactor build e2e dapp guide * address comments * handle redirects * add guide source code
1 parent 801eee1 commit 1c5c553

12 files changed

+417
-646
lines changed

apps/nextra/next.config.mjs

+24-4
Original file line numberDiff line numberDiff line change
@@ -1090,22 +1090,42 @@ export default withBundleAnalyzer(
10901090
},
10911091
{
10921092
source: "/tutorials/build-e2e-dapp/add-wallet-support",
1093-
destination: "/en/build/guides/build-e2e-dapp/3-add-wallet-support",
1093+
destination: "/en/build/guides/build-e2e-dapp/2-set-up-react-app",
1094+
permanent: true,
1095+
},
1096+
{
1097+
source: "/tutorials/build-e2e-dapp/3-add-wallet-support",
1098+
destination: "/en/build/guides/build-e2e-dapp/2-set-up-react-app",
10941099
permanent: true,
10951100
},
10961101
{
10971102
source: "/tutorials/build-e2e-dapp/fetch-data-from-chain",
1098-
destination: "/en/build/guides/build-e2e-dapp/4-fetch-data-from-chain",
1103+
destination: "/en/build/guides/build-e2e-dapp/3-fetch-data-from-chain",
1104+
permanent: true,
1105+
},
1106+
{
1107+
source: "/tutorials/build-e2e-dapp/4-fetch-data-from-chain",
1108+
destination: "/en/build/guides/build-e2e-dapp/3-fetch-data-from-chain",
10991109
permanent: true,
11001110
},
11011111
{
11021112
source: "/tutorials/build-e2e-dapp/submit-data-to-chain",
1103-
destination: "/en/build/guides/build-e2e-dapp/5-submit-data-to-chain",
1113+
destination: "/en/build/guides/build-e2e-dapp/4-submit-data-to-chain",
1114+
permanent: true,
1115+
},
1116+
{
1117+
source: "/tutorials/build-e2e-dapp/5-submit-data-to-chain",
1118+
destination: "/en/build/guides/build-e2e-dapp/4-submit-data-to-chain",
11041119
permanent: true,
11051120
},
11061121
{
11071122
source: "/tutorials/build-e2e-dapp/handle-tasks",
1108-
destination: "/en/build/guides/build-e2e-dapp/6-handle-tasks",
1123+
destination: "/en/build/guides/build-e2e-dapp/5-handle-tasks",
1124+
permanent: true,
1125+
},
1126+
{
1127+
source: "/tutorials/build-e2e-dapp/6-handle-tasks",
1128+
destination: "/en/build/guides/build-e2e-dapp/5-handle-tasks",
11091129
permanent: true,
11101130
},
11111131
{

apps/nextra/pages/en/build/guides/build-e2e-dapp.mdx

+20-17
Original file line numberDiff line numberDiff line change
@@ -2,46 +2,49 @@
22

33
A common way to learn a new framework or programming language is to build a simple todo list. In this tutorial, we will learn how to build an end-to-end todo list dapp, starting from the smart contract side through the front-end side and finally use of a wallet to interact with the two.
44

5-
See the completed code in the [my_first_dapp](https://github.com/aptos-labs/aptos-core/tree/main/aptos-move/move-examples/my_first_dapp).
5+
See the completed code in the [source-code](https://github.com/aptos-labs/developer-docs/tree/main/apps/nextra/pages/en/build/guides/build-e2e-dapp).
66

77
## Chapters
88

99
After meeting the [prerequisites](#prerequisites) and [getting set up](#setup) as described below, you will follow this tutorial in this order:
1010

1111
1. [Create a smart contract](build-e2e-dapp/1-create-smart-contract.mdx)
12-
2. [Set up React app](build-e2e-dapp/2-set-up-react-app.mdx)
13-
3. [Add Wallet support](build-e2e-dapp/3-add-wallet-support.mdx)
14-
4. [Fetch Data from Chain](build-e2e-dapp/4-fetch-data-from-chain.mdx)
15-
5. [Submit data to chain](build-e2e-dapp/5-submit-data-to-chain.mdx)
16-
6. [Handle Tasks](build-e2e-dapp/6-handle-tasks.mdx)
12+
2. [Set up a frontend](build-e2e-dapp/2-set-up-the-frontend.mdx)
13+
3. [Fetch Data from Chain](build-e2e-dapp/3-fetch-data-from-chain.mdx)
14+
4. [Submit data to chain](build-e2e-dapp/4-submit-data-to-chain.mdx)
15+
5. [Handle Tasks](build-e2e-dapp/5-handle-tasks.mdx)
1716

1817
## Prerequisites
1918

2019
You must have:
2120

22-
- [Aptos CLI](../cli.mdx)
23-
- [Aptos TypeScript SDK](../sdks/ts-sdk.mdx)
24-
- [Aptos Wallet Adapter](../sdks/wallet-adapter.mdx)
25-
- [Create React App](https://create-react-app.dev/)
2621
- [node and npm](https://nodejs.org/en/)
2722

2823
Although we will explain some React decisions, we are not going to deep dive into how React works; so we assume you have some previous experience with React.
2924

3025
## Setup
3126

32-
In this section, we will create a `my-first-dapp` directory to hold our project files, both client-side code (React based)and the Move code (our smart contract).
27+
In this section, we will create a `my-first-dapp` directory to hold our project files, both client-side code (React based) and the Move code (our smart contract).
28+
29+
For that, we will be using [create-aptos-dapp](../create-aptos-dapp.mdx) to create the project.
3330

3431
1. Open a terminal and navigate to the desired directory for the project (for example, the `Desktop` directory).
35-
2. Create a new directory called `my-first-dapp`, for example:
32+
2. Run `npx create-aptos-dapp@latest` to create the project.
3633

3734
```bash filename="Terminal"
38-
mkdir my-first-dapp
35+
npx create-aptos-dapp@latest
3936
```
4037

41-
3. Navigate into that directory:
38+
3. Follow the instructions to create the project.
39+
- Choose a name for the project, for example `my-first-dapp`.
40+
- Choose the `Full-stack project` option.
41+
- Choose the `Boilerplate Template` option.
42+
- For simplicity, choose not to use Surf.
43+
- Choose the `Vite app` framework option.
44+
- Choose the `Devnet` network option.
4245

43-
```bash filename="Terminal"
44-
cd my-first-dapp
45-
```
46+
The tool will create the project in a directory with the same name as the project and install the required dependencies.
47+
48+
Follow the `Next Steps` instructions.
4649

4750
Now let's [create a smart contract](build-e2e-dapp/1-create-smart-contract.mdx).

0 commit comments

Comments
 (0)