Skip to content

Commit e6db725

Browse files
authored
Merge pull request #12 from cybernoob2/docs/add-react
docs(react): add setup guide for React environment
2 parents 59d5e76 + 842c979 commit e6db725

4 files changed

Lines changed: 74 additions & 0 deletions

File tree

docs/React/images/framework.png

18.4 KB
Loading

docs/React/images/project-name.png

4.65 KB
Loading

docs/React/images/variant.png

19.2 KB
Loading

docs/React/setup.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Setting Up a React Environment
2+
3+
In this guide, we’ll set up a React project using **Vite** using four easy steps.
4+
5+
---
6+
7+
## Step 1: Check if Node.js is Installed
8+
9+
Open your terminal and type:
10+
11+
```bash
12+
node -v
13+
```
14+
If Node.js is installed, you’ll see a version number
15+
```bash
16+
v23.8.0
17+
```
18+
19+
If not, download and install [Node official website](https://nodejs.org/en/download/).
20+
21+
💡 Installing Node.js also gives you npm (Node Package Manager), which we’ll use later.
22+
23+
## Step 2: Create a Vite Project
24+
A development server is like a playground where we build and test our React app.
25+
We’ll use Vite for this.
26+
27+
Run the following command in your terminal:
28+
29+
```bash
30+
npm create vite@latest
31+
```
32+
## Step 3: Configure Vite
33+
Vite will ask you a few questions:
34+
35+
Project Name → type a name for your project folder.
36+
![Project name](./images/project-name.png)
37+
38+
39+
Framework → select React.
40+
![Selecting framework](./images/framework.png)
41+
42+
Variant → select JavaScript.
43+
![Selecting variant](./images/variant.png)
44+
:::tip NOTE
45+
There are two Javascript variants, but in our project we will use plain Javascript.
46+
:::
47+
48+
## Step 4: Start the React Environment
49+
Move into your project folder:
50+
51+
```bash
52+
cd my-react-app
53+
```
54+
Install the required dependencies:
55+
56+
```bash
57+
npm install
58+
```
59+
60+
Then start the development server:
61+
62+
```bash
63+
npm run dev
64+
```
65+
If successful, you’ll see something like:
66+
```bash
67+
VITE v7.1.4 ready in 760 ms
68+
69+
➜ Local: http://localhost:5173/
70+
➜ Network: use --host to expose
71+
➜ press h + enter to show help
72+
```
73+
74+
Open the Local URL in your browser to view your React app 🎉.

0 commit comments

Comments
 (0)