Skip to content

Commit d802613

Browse files
Tm/video 1 (#2)
* Project running * Video 2 * Video 2 * video 3 TODO * Video 3 scripts * Update scripts * Update scripts * Minor edit * Lint readmes * Update scripts * Update scripts * Update scripts * Update scripts * git cache cleared * Update gitignore * Update video 4 * Update tutorial structure * Edit sh files * Update test instructions * Update instructions * Update instructions
1 parent b94e6b8 commit d802613

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+3400
-23
lines changed

.DS_Store

-6 KB
Binary file not shown.

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ node_modules
1111
dist
1212
dist-ssr
1313
*.local
14-
.DS_Store
1514

1615
# Editor directories and files
1716
.vscode/*

tutorial/README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Building a dApp from scratch with React, Tailwind, @multiversx/sdk-core and @multiversx/sdk-dapp.
2+
3+
## Overview
4+
5+
This is the scenario description for the instructive video series on how to build a dApp from scratch with React, Tailwind, @multiversx/sdk-core and @multiversx/sdk-dapp.
6+
7+
## VIDEO 1: Creating a new React project with Vite
8+
9+
1. Create a new Vite React project (TypeScript template)
10+
2. Install dependencies
11+
3. Install Tailwind CSS and its dependencies
12+
4. Configure eslint and prettier
13+
5. Configure vite (globals and https)
14+
6. Configure tsconfig.json (absolute imports)
15+
7. Add formatting scripts and run them
16+
8. Check if the project is running
17+
18+
## VIDEO 2: Preparing the basic App structure with routing
19+
20+
1. Install react-router-dom
21+
2. Creating the pages folder and the Home page
22+
3. Create the routes folder under /src
23+
4. Create the index.ts file under /src/routes
24+
5. Create a Layout component
25+
6. Update the App.tsx file
26+
7. Run lint again to fix the errors
27+
28+
## VIDEO 3: Installing sdk-dapp
29+
30+
1. Install sdk-dapp & its dependencies
31+
2. Create the lib folder from where we will re-export dependencies

tutorial/TEST_INSTRUCTIONS.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Tutorial Workflow
2+
3+
## 1. Create the final version of the project
4+
5+
1. Create the final version of the project
6+
2. Split the project into phases (will be videos)
7+
3. Create a folder for each step called VIDEO_NUMBER inside the tutorial folder (E.g. VIDEO_01)
8+
4. Create a VIDEO_NUMBER_README.md in each folder (E.g. VIDEO_01_README.md)
9+
5. Ask agent to create a .sh file for each step of the video (E.g. step_01_create_project.sh)
10+
6. Create a run.sh main file in each folder that runs all the steps of the video
11+
7. In the tutorial folder create a run_all.sh file that runs all main run.sh files
12+
13+
## 2. Setup filming:
14+
15+
1. Start a Chrome browser with remote debugging enabled
16+
2. Install code-server and navigate to the project folder
17+
3. Install the browser instance as a PWA so URL is hidden when filming
18+
4. Make sure code-server PWA is running when filming
19+
20+
## 3. Filming:
21+
22+
1. Create a global tests folder
23+
2. Replicate the VIDEO_NUMBER folder structure in the tests folder
24+
3. In each folder create a main video file (Eg. video01.spec.ts)
25+
4. For each sh file ask agent to create a playwright step file (Eg. step_01_create_project.ts)
26+
5. Include the steps files in the main video file
27+
6. At the beginning of the main video file, use `playwright-video` to record the video and stop it at the end of the video
28+
7. Before each step that edits files, create a git commit to be able to compare the changes. Start commit messages with numbers 01, 02, 03, etc.
29+
8. At the end of each main video, use `videogit` to create a video of the changes for specific files:
30+
`videogit $(git log --grep="^01" --pretty=format:"%h" -n1) $(git log --grep="^02" --pretty=format:"%h" -n 1) -w 180 -r 24 -f tailwind.config.js --show-line-numbers --title "tailwind.config.js" --output-filename 01 -o /Users/tudor/Work/test/playwright-mcp/videos/VIDEO_01`
31+
Explenation:
32+
- $(git log --grep="^01" --pretty=format:"%h" -n1) is the first commit message that starts with 01
33+
- $(git log --grep="^02" --pretty=format:"%h" -n 1) is the last commit message that starts with 02
34+
- -w 180 is the words per minute
35+
- -r 24 is the frame rate
36+
- -f tailwind.config.js is the file to be included in the video
37+
- --show-line-numbers is to show the line numbers
38+
- --title "tailwind.config.js" is the breadcrumb display inside the video for the specific file
39+
40+
NOTE: you can run the edit files videos at the end since commits remain unchanged
41+
42+
9. Run the main test with `chromium.connectOverCDP("http://127.0.0.1:9222")`
43+

tutorial/VIDEO_01/VIDEO_01_README.md

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,19 @@ rm -rf temp-project
2929
yarn
3030
```
3131

32-
### Step 3: Install Tailwind CSS and its dependencies:
32+
Initialize git repository & create first commit:
33+
34+
```bash
35+
git init
36+
git add .
37+
git commit -m "01. Initial commit"
38+
```
39+
40+
### Step 3: Install Tailwind CSS:
3341

3442
```bash
3543
# Continue working in root directory
36-
yarn add -D tailwindcss postcss autoprefixer @tailwindcss/postcss
44+
yarn add -D tailwindcss@3.3.3 postcss autoprefixer
3745
```
3846

3947
Add tailwind config:
@@ -43,7 +51,11 @@ Add tailwind config:
4351
export default {
4452
content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'],
4553
theme: {
46-
extend: {}
54+
extend: {},
55+
backgroundImage: {
56+
// eslint-disable-next-line quotes
57+
'mvx-white': "url('../multiversx-white.svg')"
58+
}
4759
},
4860
plugins: []
4961
};
@@ -54,12 +66,34 @@ Add postcss config:
5466
```js
5567
export default {
5668
plugins: {
57-
'@tailwindcss/postcss': {},
69+
tailwindcss: {},
5870
autoprefixer: {}
5971
}
6072
};
6173
```
6274

75+
Replace contents of src/index.css with the following:
76+
77+
```css
78+
@import url('https://fonts.googleapis.com/css2?family=Inter&display=swap');
79+
@tailwind base;
80+
@tailwind components;
81+
@tailwind utilities;
82+
```
83+
84+
Copy the multiversx-white.svg file to the public folder.
85+
86+
```bash
87+
cp ../../multiversx-white.svg public/multiversx-white.svg
88+
```
89+
90+
Commit the project:
91+
92+
```bash
93+
git add .
94+
git commit -m "02. Add tailwind css"
95+
```
96+
6397
### Step 4: Configure eslint and prettier:
6498

6599
```bash

0 commit comments

Comments
 (0)