How to Set Up a Basic React App
Aug 27, 2025π± Introduction
React has become one of the most popular libraries for building modern web applications. If you’re just starting out, setting up your very first React app can feel overwhelming—but don’t worry! In this post, we’ll walk through two simple ways to get a React app running on your computer: the modern Vite approach and the classic Create React App (CRA) method.
β Prerequisites
Before you begin, make sure you have the following:
-
Node.js (version 16 or higher is recommended).
-
Check if it’s installed:
-
-
A code editor like Visual Studio Code (VS Code).
β‘ Option 1: Using Vite (Recommended)
Vite is a modern build tool that’s super fast and lightweight. It’s the easiest way to start a new React project today.
Steps
-
Open your terminal and run:
-
When prompted, choose:
-
Framework: React
-
Variant: JavaScript (or TypeScript if you prefer)
-
-
Move into your new project:
-
Open the local URL shown in your terminal (usually
http://localhost:5173
) in your browser.
π Congratulations! You now have a running React app powered by Vite.
π° Option 2: Using Create React App (CRA)
Create React App used to be the default way to start React projects. It’s still widely used but slower compared to Vite.
Steps
-
Run the following in your terminal:
-
Your app will launch at
http://localhost:3000
.
π Understanding the Project Structure
No matter which setup you use, your React project will have a src/ folder. Inside it:
-
App.js / App.jsx → Main component where you build your UI.
-
index.js → Entry point that renders your app into the browser’s DOM.
β¨ First React Component Example
Let’s make a tiny change to see React in action. Open App.js
and replace its content with:
Save the file, and your browser will update instantly!
π¦ What’s Next?
Now that you have a working React app, here are a few things you can try:
-
Add a UI library:
-
Add navigation with React Router:
-
Install the React Developer Tools browser extension to debug your apps easily.
π― Conclusion
Setting up React is simpler than ever. If you want speed and a modern workflow, go with Vite. If you’re following older tutorials, you might still see Create React App. Either way, within minutes, you’ll have a React app ready to customize and build upon.
So go ahead—create your first component, style it a little, and start building something awesome with React! π
Stay Updated with the Latest News!
For simplicity, we donβt have a separate newsletter for CodingArchitect at the moment. However, you can stay informed about learning updates from CodingArchitect, Cloudericks, and BuddyTutorΒ by subscribing to the free Buddy Skills Newsletter on BuddyTutor.com.
π How to Subscribe?
Simply visit BuddyTutor.com and scroll to the bottom of the homepage to sign up.
Stay connected and never miss an update! π