Skip to content

Commit b94e6b8

Browse files
committed
Initial commit Video 01
1 parent 4f5f724 commit b94e6b8

13 files changed

+107
-48
lines changed

.gitignore

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,25 @@
1-
.vscode
2-
.cursor/*
3-
.covarage
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
410
node_modules
5-
ping-pong-dapp/.DS_Store
11+
dist
12+
dist-ssr
13+
*.local
614
.DS_Store
715

16+
# Editor directories and files
17+
.vscode/*
18+
!.vscode/extensions.json
19+
.idea
20+
.DS_Store
21+
*.suo
22+
*.ntvs*
23+
*.njsproj
24+
*.sln
25+
*.sw?

tutorial/VIDEO_01/SETUP_README.md

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@ This directory contains bash scripts to automate the setup process for a React d
55
## Quick Start
66

77
### Option 1: Run All Steps Automatically
8+
89
```bash
9-
./run_all_steps.sh
10+
./run_project_setup.sh
1011
```
11-
This will run all 8 steps with confirmation prompts for each step.
12+
13+
This will run all 8 steps automatically.
1214

1315
### Option 2: Run Steps Individually
16+
1417
Execute the scripts in order:
1518

1619
```bash
@@ -27,49 +30,62 @@ Execute the scripts in order:
2730
## What Each Script Does
2831

2932
### Step 1: `step_01_create_project.sh`
33+
3034
- Creates a new Vite React project with TypeScript template
31-
- Project name: `ping-pong-dapp`
35+
- Project files are created directly in the root directory
3236

3337
### Step 2: `step_02_install_dependencies.sh`
38+
3439
- Installs the initial project dependencies using yarn
3540

3641
### Step 3: `step_03_install_tailwind.sh`
42+
3743
- Installs Tailwind CSS and its dependencies
3844
- Creates `tailwind.config.js`
3945
- Creates `postcss.config.js`
4046

4147
### Step 4: `step_04_configure_eslint_prettier.sh`
48+
4249
- Installs ESLint, Prettier, and all related plugins
4350
- Creates `.prettierrc` configuration
4451
- Creates `eslint.config.js` with comprehensive rules
4552

4653
### Step 5: `step_05_configure_vite.sh`
54+
4755
- Installs Vite plugins (basic SSL, node polyfills, SVGR, tsconfig paths)
4856
- Creates `vite.config.ts` with development server configuration
4957

5058
### Step 6: `step_06_configure_tsconfig.sh`
59+
5160
- Removes extra TypeScript config files
5261
- Creates a unified `tsconfig.json` with proper settings
5362

5463
### Step 7: `step_07_add_lint_command.sh`
64+
5565
- Adds lint script to `package.json`
5666
- Runs the linter to fix any initial issues
5767

5868
### Step 8: `step_08_start_dev_server.sh`
69+
5970
- Starts the development server
6071
- Server runs on `https://localhost:3000`
6172

6273
## Prerequisites
6374

6475
Before running these scripts, make sure you have:
76+
6577
- Node.js (version 16 or higher)
6678
- Yarn package manager
6779
- Git (optional, for version control)
6880

6981
## Project Structure After Setup
7082

71-
After running all scripts, you'll have a `ping-pong-dapp` directory with:
72-
- React + TypeScript setup
83+
After running all scripts, your root directory will contain:
84+
85+
- `src/` - React + TypeScript source files
86+
- `tutorial/` - Tutorial documentation and scripts (existing)
87+
- `.auto-type/` - Auto-type configuration (existing)
88+
- `package.json` - Project dependencies and scripts
7389
- Tailwind CSS configured
7490
- ESLint + Prettier configured
7591
- Vite development server with plugins
@@ -78,13 +94,15 @@ After running all scripts, you'll have a `ping-pong-dapp` directory with:
7894
## Next Steps
7995

8096
After the setup is complete, you can:
81-
1. Start developing your dApp in the `ping-pong-dapp` directory
97+
98+
1. Start developing your dApp in the root directory (`src/` folder)
8299
2. Add MultiversX SDK dependencies for blockchain integration
83100
3. Build your ping-pong game logic
84101

85102
## Troubleshooting
86103

87104
If any script fails:
105+
88106
1. Check that you have the required prerequisites
89107
2. Make sure you have internet connection for downloading packages
90108
3. Ensure you have sufficient disk space
@@ -94,4 +112,4 @@ If any script fails:
94112

95113
- All scripts are designed to be idempotent (safe to run multiple times)
96114
- The development server (Step 8) will run indefinitely until stopped with Ctrl+C
97-
- Each script provides clear success/failure feedback and next step instructions
115+
- Each script provides clear success/failure feedback and next step instructions

tutorial/VIDEO_01/VIDEO_01_README.md

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,30 @@ Creating a new React project with Vite
99

1010
### Step 1: Create a new Vite React project (TypeScript template).
1111

12+
The project will be created directly in the current directory.
13+
1214
```bash
13-
npx create-vite@latest ping-pong-dapp --template react-ts --yes
15+
# Navigate to root directory
16+
cd ../../
17+
18+
# Create temporary project and move files to current directory
19+
npx create-vite@latest temp-project --template react-ts --yes
20+
mv temp-project/* .
21+
mv temp-project/.* . 2>/dev/null || true
22+
rm -rf temp-project
1423
```
1524

1625
### Step 2: Install dependencies:
1726

1827
```bash
19-
cd ping-pong-dapp && yarn
28+
# Already in root directory
29+
yarn
2030
```
2131

2232
### Step 3: Install Tailwind CSS and its dependencies:
2333

2434
```bash
35+
# Continue working in root directory
2536
yarn add -D tailwindcss postcss autoprefixer @tailwindcss/postcss
2637
```
2738

@@ -30,11 +41,11 @@ Add tailwind config:
3041
```ts
3142
/** @type {import('tailwindcss').Config} */
3243
export default {
33-
content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
44+
content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'],
3445
theme: {
35-
extend: {},
46+
extend: {}
3647
},
37-
plugins: [],
48+
plugins: []
3849
};
3950
```
4051

@@ -44,14 +55,15 @@ Add postcss config:
4455
export default {
4556
plugins: {
4657
'@tailwindcss/postcss': {},
47-
autoprefixer: {},
48-
},
58+
autoprefixer: {}
59+
}
4960
};
5061
```
5162

5263
### Step 4: Configure eslint and prettier:
5364

5465
```bash
66+
# Continue working in root directory
5567
yarn add -D @eslint/js eslint prettier eslint-config-prettier eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-sort-exports
5668
```
5769

@@ -222,6 +234,7 @@ export default tseslint.config([
222234
### Step 5: Configure vite
223235

224236
```bash
237+
# Continue working in root directory
225238
yarn add -D @types/node @vitejs/plugin-basic-ssl vite-plugin-node-polyfills vite-plugin-svgr vite-tsconfig-paths
226239
```
227240

@@ -268,7 +281,7 @@ export default defineConfig({
268281
});
269282
```
270283

271-
### Step 5: Configure tsconfig.json
284+
### Step 6: Configure tsconfig.json
272285

273286
Keep only one tsconfig.json file in the root of the project (remove the tsconfig.app.json file and the tsconfig.node.json file).
274287

@@ -299,7 +312,7 @@ Keep only one tsconfig.json file in the root of the project (remove the tsconfig
299312
}
300313
```
301314

302-
### Step 6: Add formatting scripts and run them
315+
### Step 7: Add formatting scripts and run them
303316

304317
```json
305318
"lint": "eslint --ext js,ts,tsx src --fix",
@@ -311,10 +324,8 @@ Keep only one tsconfig.json file in the root of the project (remove the tsconfig
311324
yarn lint
312325
```
313326

314-
### Step 7: Check if the project is running using BrowserMCP
327+
### Step 8: Check if the project is running
315328

316329
```bash
317330
yarn dev
318331
```
319-
320-

tutorial/VIDEO_01/run_project_setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
echo "🚀 React + Tailwind + MultiversX dApp Setup Script"
44
echo "=================================================="
55
echo ""
6-
echo "This script will run all 8 steps to set up your ping-pong-dapp project."
6+
echo "This script will run all 8 steps to set up your project in the root directory."
77
echo "Running all steps automatically..."
88
echo ""
99

tutorial/VIDEO_01/step_01_create_project.sh

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,20 @@
22

33
echo "=== Step 1: Creating a new Vite React project with TypeScript template ==="
44

5-
# Create the project
6-
npx create-vite@latest ping-pong-dapp --template react-ts --yes
5+
# Navigate to root directory
6+
cd ../../
77

8-
echo "✅ Project 'ping-pong-dapp' created successfully!"
8+
# Create the project in current directory by creating a temp project and moving files
9+
echo "Creating temporary project..."
10+
npx create-vite@latest temp-project --template react-ts --yes
11+
12+
echo "Moving files to root directory..."
13+
# Move all files from temp-project to current directory
14+
mv temp-project/* .
15+
mv temp-project/.* . 2>/dev/null || true
16+
17+
# Remove the temporary directory
18+
rm -rf temp-project
19+
20+
echo "✅ Project created successfully in root directory!"
921
echo "Next: Run './step_02_install_dependencies.sh'"

tutorial/VIDEO_01/step_02_install_dependencies.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
echo "=== Step 2: Installing dependencies ==="
44

5-
# Change to project directory
6-
cd ping-pong-dapp
5+
# Change to root directory
6+
cd ../../
77

88
# Install dependencies
99
yarn
1010

1111
echo "✅ Dependencies installed successfully!"
12-
echo "Next: Run '../step_03_install_tailwind.sh'"
12+
echo "Next: Run './step_03_install_tailwind.sh'"

tutorial/VIDEO_01/step_03_install_tailwind.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
echo "=== Step 3: Installing Tailwind CSS and creating config files ==="
44

5-
# Change to project directory
6-
cd ping-pong-dapp
5+
# Change to root directory
6+
cd ../../
77

88
# Install Tailwind CSS and dependencies
99
yarn add -D tailwindcss postcss autoprefixer @tailwindcss/postcss
@@ -33,4 +33,4 @@ EOF
3333
echo "✅ Tailwind CSS installed and configured successfully!"
3434
echo "✅ tailwind.config.js created"
3535
echo "✅ postcss.config.js created"
36-
echo "Next: Run '../step_04_configure_eslint_prettier.sh'"
36+
echo "Next: Run './step_04_configure_eslint_prettier.sh'"

tutorial/VIDEO_01/step_04_configure_eslint_prettier.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
echo "=== Step 4: Configuring eslint and prettier ==="
44

5-
# Change to project directory
6-
cd ping-pong-dapp
5+
# Change to root directory
6+
cd ../../
77

88
# Install eslint and prettier dependencies
99
yarn add -D @eslint/js eslint prettier eslint-config-prettier eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-sort-exports
@@ -171,4 +171,4 @@ EOF
171171
echo "✅ ESLint and Prettier configured successfully!"
172172
echo "✅ .prettierrc created"
173173
echo "✅ eslint.config.js created"
174-
echo "Next: Run '../step_05_configure_vite.sh'"
174+
echo "Next: Run './step_05_configure_vite.sh'"

tutorial/VIDEO_01/step_05_configure_vite.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
echo "=== Step 5: Configuring Vite ==="
44

5-
# Change to project directory
6-
cd ping-pong-dapp
5+
# Change to root directory
6+
cd ../../
77

88
# Install Vite plugins
99
yarn add -D @types/node @vitejs/plugin-basic-ssl vite-plugin-node-polyfills vite-plugin-svgr vite-tsconfig-paths
@@ -52,4 +52,4 @@ EOF
5252

5353
echo "✅ Vite plugins installed and configured successfully!"
5454
echo "✅ vite.config.ts created"
55-
echo "Next: Run '../step_06_configure_tsconfig.sh'"
55+
echo "Next: Run './step_06_configure_tsconfig.sh'"

tutorial/VIDEO_01/step_06_configure_tsconfig.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
echo "=== Step 6: Configuring tsconfig.json ==="
44

5-
# Change to project directory
6-
cd ping-pong-dapp
5+
# Change to root directory
6+
cd ../../
77

88
# Remove additional tsconfig files if they exist
99
rm -f tsconfig.app.json tsconfig.node.json
@@ -37,4 +37,4 @@ cat > tsconfig.json << 'EOF'
3737
EOF
3838

3939
echo "✅ tsconfig.json configured successfully!"
40-
echo "Next: Run '../step_07_add_lint_command.sh'"
40+
echo "Next: Run './step_07_add_lint_command.sh'"

0 commit comments

Comments
 (0)