← Back to list

πŸš€ Understand React Like a Professional: Installation, Vite Setup, Project Files, Commands, and…

πŸ’‘ β€œEvery great React application starts with understanding the structure behind the screen. Learn the foundation first, and building…

Rajalaxmi Biswal Β· 2026-05-21 16:49 Β· 50 claps Β· 7.1 min read
#react #javascript #vites
Open on Medium β†—
Wiki topics: 🌐 Β· Web Development πŸ₯Š Β· Combat Sports

πŸš€ Understand React Like a Professional: Installation, Vite Setup, Project Files, Commands, and Real-World Concepts βš›οΈ

πŸ’‘ β€œEvery great React application starts with understanding the structure behind the screen. Learn the foundation first, and building scalable apps becomes far easier.”

Introduction:

React has become one of the most powerful and widely used JavaScript libraries for building modern web applications. From startups to large-scale tech companies, React is used everywhere because of its component-based architecture, reusable UI system, and fast rendering capabilities.

However, many beginners start learning React without fully understanding:

  • How React projects are created
  • Why Vite is used
  • What each file and folder does
  • How npm commands work
  • How the entire project structure connects together

Understanding these fundamentals is extremely important because React development becomes much easier when developers understand the architecture behind the project.

In this article, we will cover:

βœ… React installation βœ… Vite setup βœ… Multiple project creation methods βœ… Important npm commands βœ… React file structure βœ… Explanation of every major file and folder βœ… Real-life analogies for easier understanding βœ… Professional React development concepts

Let’s begin.

βš™οΈ Prerequisites Before Installing React

Before installing React, developers must install Node.js because React uses npm (Node Package Manager) to install packages and run applications.

Download Node.js from:

Node.js Official Website

After installation, verify it using:

node -v
npm -v

If version numbers appear, the setup is ready.

⚑ What Is Vite?

Modern React applications are commonly created using Vite.

Vite is a modern frontend build tool designed to provide:

  • Faster development server
  • Instant hot reload
  • Better optimization
  • Lightweight configuration
  • Improved performance

πŸ—οΈ Real-Life Analogy

Imagine building a smart house using modern automated machines instead of old slow manual tools.

That modern automated construction system is Vite.

πŸ› οΈ METHOD 1 β€” Complete Step-by-Step React Installation

This is the best method for beginners because every setup step is clearly explained.

Step 1 β€” Open Terminal

Open any terminal:

  • CMD
  • PowerShell
  • VS Code Terminal
  • Git Bash

Step 2 β€” Run Vite Command

npm create vite@latest

Press Enter.

🧠 Understanding the Command

npm

Node Package Manager.

Used for installing packages and managing dependencies.

πŸ—οΈ Real-Life Analogy

Imagine an online marketplace that delivers all tools needed for building a house.

create

Used for creating a new project.

πŸ—οΈ Real-Life Analogy

Like starting construction of a new building.

vite

Uses the Vite build tool.

πŸ—οΈ Real-Life Analogy

The modern construction company building the house quickly and efficiently.

@latest

Installs the newest version.

πŸ—οΈ Real-Life Analogy

Using the latest construction technology instead of outdated machines.

Step 3 β€” Enter Project Name

Terminal asks:

Project name:

Example:

react-learning

This becomes:

  • Project folder name
  • Application name
  • npm package name

Step 4 β€” Select Framework

Terminal displays:

Select a framework:

Choose:

React

Why Choose React?

React provides:

βœ… Reusable components βœ… Faster rendering βœ… Better scalability βœ… Huge ecosystem βœ… Strong community support

Step 5 β€” Select Variant

Terminal displays:

Select a variant:

Choose:

JavaScript + React Compiler

Why Beginners Should Choose β€œJavaScript + React Compiler”

Advantages

βœ… Faster compilation βœ… Better performance βœ… Faster hot reload βœ… Simpler learning experience βœ… Modern React optimization

This helps beginners focus on:

  • JSX
  • Components
  • Props
  • State
  • Hooks

without TypeScript complexity.

Step 6 β€” Install With npm and Start Now?

Terminal may show:

Install with npm and start now?
β”‚  ● Yes / β—‹ No

Choose:

Yes

Why Choose β€œYes”?

Choosing β€œYes” automatically:

βœ… Installs dependencies βœ… Creates node_modules βœ… Configures packages βœ… Starts development server

Internally, Vite automatically runs:

npm install

and

npm run dev

Step 7 β€” Open Browser

Terminal displays:

http://localhost:5173

Open this URL in browser.

πŸŽ‰ Your React application is now running.

⚑ METHOD 2 β€” Create Project Using Single Command

This method automatically creates folder and project together.

npm create vite@latest my-react-app

Then run:

cd my-react-app
npm install
npm run dev

πŸ“ METHOD 3 β€” Create Folder Manually Then Install React

Some developers prefer manually creating the folder first.

Create folder:

mkdir portfolio-app

Move inside folder:

cd portfolio-app

Install React inside current folder:

npm create vite@latest .

The dot (.) means:

Install inside current folder.

Then follow the remaining setup steps from Method 1.

πŸ“‚ React Project Structure Explained with Real-Life Analogies (2026 Edition)

A React project is not just a collection of files β€” it behaves like a fully functioning smart system or ecosystem where every part has a specific role.

Let’s understand each file and folder using real-world analogies so it becomes easy to remember forever.

my-react-app/
β”‚
β”œβ”€β”€ node_modules/
β”œβ”€β”€ public/
β”œβ”€β”€ src/
β”œβ”€β”€ .gitignore
β”œβ”€β”€ index.html
β”œβ”€β”€ package.json
β”œβ”€β”€ package-lock.json
β”œβ”€β”€ vite.config.js
└── README.md

Now let’s understand every important file and folder.

πŸ“¦ node_modules

Definition

Stores all installed packages and dependencies.

Key Points

βœ… Automatically created βœ… Contains React packages βœ… Managed by npm βœ… Usually very large

🌌Real-Life Analogy

Imagine your project is a galaxy.

Inside this galaxy exists a black hole called node_modules.

  • It pulls in everything needed:
  • React
  • Vite tools
  • Utility libraries
  • Sub-dependencies (dependencies of dependencies)

πŸŒ€ Key Behavior

  • Extremely large and powerful
  • Invisible in normal development
  • Never manually edited
  • Can be regenerated anytime
node_modules

Example

npm install

πŸ‘‰ Recreates the entire black hole universe again.

🌐 public

Definition

Stores static files directly accessible by browser.

Key Points

βœ… Publicly accessible βœ… Stores images and icons βœ… Not processed by React

πŸ™οΈ Real-Life Analogy

Think of a city’s public square:

  • Anyone can enter
  • No permissions required
  • Information is directly visible

Example

public/logo.png

Access in browser:

/logo.png

πŸ’» src

Definition

Contains the main source code.Main development folder where all logic and UI lives.

Key Points

βœ… Most important folder βœ… Main development area βœ… Contains components and logic

🧠 Real-Life Analogy

This is the brain of a human body:

  • Controls everything
  • Processes logic
  • Sends instructions
  • Manages behavior

Without it, the system is lifeless.

⚑ main.jsx

Definition

Entry point of the React application.

πŸ”Œ Real-Life Analogy

Imagine a main power switch in a smart building:

  • When ON β†’ entire system starts working
  • When OFF β†’ everything stops

Code Example

import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './App'
ReactDOM.createRoot(document.getElementById('root')).render(
  <App />
)

🧩 App.jsx

Definition

Root component of the application.

Code Example

function App() {
  return <h1>Hello React</h1>
}
export default App

πŸŽ›οΈ Real-Life Analogy

Think of a control room in a smart city:

  • Manages all systems
  • Connects different departments
  • Controls overall structure

Everything in React flows through App.jsx.

🎨 index.css

Definition

Contains global styling.

Code Example

body {
  margin: 0;
  font-family: Arial;
}

Real-Life Analogy 🎨

Overall interior design rules of the house.

πŸ›‹οΈ App.css

Definition

Styles specific to App component.

🎭 Real-Life Analogy

This is the interior design rulebook of a building:

  • Wall colors
  • Font styles
  • Spacing rules
  • Overall theme

Applies everywhere in the project.

🧱 components

Definition

Stores reusable UI components.

Code Example

function Navbar() {
  return <h2>Navbar</h2>
}

🧩 Real-Life Analogy

Think of LEGO blocks:

  • You build small pieces once
  • Reuse them anywhere
  • Combine them into big structures

Examples:

  • Navbar
  • Button
  • Card

πŸ“„ pages

Definition

Stores page-level components.

🏑 Real-Life Analogy

A house has different rooms:

  • Bedroom
  • Kitchen
  • Study
  • Bathroom

Each serves a different purpose β€” just like pages.

πŸ–ΌοΈ assets

Definition

Stores media resources.

πŸ“Έ Real-Life Analogy

A photo album or storage room in a house:

  • Keeps memories safe
  • Organized for later use

πŸͺ hooks

Definition

Stores reusable React logic.

πŸ€– Real-Life Analogy

Like smart home automation:

  • Motion sensors
  • Auto lights
  • Temperature control

They work automatically when needed.

🌍 context

Definition

Stores Context API files for global state management.

πŸ“‘ Real-Life Analogy

A WiFi router in a building:

  • One connection
  • Shared across all rooms
  • No need to reconnect individually

πŸ“œ package.json

Definition

Stores project metadata and npm scripts.

Code Example

{
  "scripts": {
    "dev": "vite"
  }
}

πŸš€ Understanding npm run dev

When developers run:

npm run dev

npm checks:

"dev": "vite"

and internally runs:

vite

πŸ”„ Can We Change dev Name?

Yes.

Example:

"scripts": {
  "raj": "vite"
}

Run using:

npm run raj

Why Developers Usually Use dev

βœ… Standard naming convention βœ… Easier collaboration βœ… Used in tutorials βœ… Improves readability

πŸ“˜ Real-Life Analogy

A blueprint of a building:

  • Structure details
  • Material list
  • Construction rules
  • System instructions

Without it, project has no identity.

Pressing:

npm run dev

πŸ”’ package-lock.json

Defination

Locks exact dependency versions.

πŸ“Œ Real-Life Analogy

A construction record book:

  • Exact cement brand
  • Exact steel type
  • Exact measurements

Ensures same result everywhere..

πŸ”’ .gitignore

Definition

Tells Git which files should not be uploaded.

Example

node_modules
dist
.env

πŸ›‘ Real-Life Analogy

A security blacklist:

  • Hidden rooms
  • Private documents
  • Sensitive data

These are never exposed publicly.

βš™οΈ vite.config.js

Definition

Contains Vite configuration settings.

πŸŽ›οΈ Real-Life Analogy

A smart home control panel:

  • Speed settings
  • Automation rules
  • System tuning

🌍 index.html

Defination

Main HTML file with root div.

🧱 Real-Life Analogy

A building foundation slab:

Everything is constructed on top of it.

<div id="root"></div>

πŸ‘‰ React builds everything inside this.

🌍 .env

Definition

Stores environment variables.

Example

VITE_API_URL=https://api.example.com

πŸ”‘ Real-Life Analogy

A safe locker in a house:

  • Passwords
  • API keys
  • Private credentials

Not visible to outsiders.

πŸ“˜ README.md

Definition

Project documentation file.

πŸ“– Real-Life Analogy

A user manual of a machine:

  • How to start
  • How to use
  • What it does
  • Safety instructions

Without it, users feel lost.

πŸš€ β€œIn my upcoming article, I’ll explain README.md professionally in depth β€” including Markdown syntax, real-world industry practices, GitHub optimization, advanced documentation structure, and how modern developers use it in production-level projects.”

πŸ”₯ Common React Commands

Install Dependencies

npm install

Start Development Server

npm run dev

Build Production Version

npm run build

Install Additional Package

npm install react-router-dom

πŸ™οΈ Final Real-Life Analogy β€” React as a Smart City

A React application is like a modern smart city:

  • components β†’ Buildings
  • pages β†’ Different zones
  • hooks β†’ Automation systems
  • context β†’ Internet network
  • assets β†’ Decorations
  • main.jsx β†’ Power station
  • App.jsx β†’ Central control building
  • package.json β†’ City planning document

Every file and folder has a specific purpose, and together they create a scalable and professional web application.

🎯 Conclusion

Learning React installation and project structure properly is one of the most important first steps in frontend development.

Once developers understand:

βœ… Installation methods βœ… npm commands βœ… Project structure βœ… React files and folders βœ… Reusable components βœ… Real-world analogies

React development becomes significantly easier and more professional.

Modern React development with Vite provides a fast, scalable, and developer-friendly experience, making it the preferred setup for modern frontend applications.


메타데이터
post_id
f491dcc70fcb
slug
understand-react-like-a-professional-installation-vite-setup-project-files-commands-and-f491dcc70fcb
url
https://medium.com/@biswalrajalaxmi901/understand-react-like-a-professional-installation-vite-setup-project-files-commands-and-f491dcc70fcb
canonical_url
https://medium.com/@biswalrajalaxmi901/understand-react-like-a-professional-installation-vite-setup-project-files-commands-and-f491dcc70fcb
author_url
https://medium.com/@biswalrajalaxmi901
status
ok
fetched_at
2026-06-23 03:48:11