π 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β¦
π 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:
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.mdprofessionally 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β Buildingspagesβ Different zoneshooksβ Automation systemscontextβ Internet networkassetsβ Decorationsmain.jsxβ Power stationApp.jsxβ Central control buildingpackage.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