Skip to main content

Create a React project in 60 seconds

We use Vite (pronounced “veet”) as the build tool. It’s fast, simple, and the recommended way to start React projects.
Your app is now running at http://localhost:5173. Every time you save a file, the browser updates instantly.
Vite is to JavaScript what FastAPI is to Python — the modern, fast, no-nonsense choice. It replaces the older Create React App (CRA), which is no longer recommended.

Project structure

The files that matter

index.html — The single HTML page. React renders everything into <div id="root">.
src/main.jsx — The entry point. Renders your App component into the root div.
React.StrictMode is a development-only helper. It may render components (and run effects) more than once in development to help catch bugs. This can look surprising at first, but it does not happen in production builds.
src/App.jsx — Your main component. This is where you start building.
Start by editing App.jsx. Delete the default content and replace it with your own. You’ll add more components as files in the src/ folder and import them into App.jsx.

The .jsx extension

React files use .jsx instead of .js. JSX lets you write HTML-like syntax inside JavaScript — you’ll learn more in the next lesson.
.jsx and .js both work in Vite. The convention is .jsx for files that contain JSX (which is almost every React file). Some projects use .tsx for TypeScript + JSX.

Key scripts

Your package.json includes these scripts:
You’ll spend 99% of your time using npm run dev.

Adding your first component

Create a new file in src/:
Import and use it in App.jsx:
That’s the entire workflow: create a component file, export it, import it where you need it.

Organizing components

As your app grows, create folders to organize:
Don’t over-organize early. Start with all components in src/, and extract into folders when you have 10+ files. The folder structure isn’t enforced by React — use whatever makes sense for your project.

What’s next?

Your project is running. Now let’s learn the core building blocks — components and JSX.

Components and JSX

Build UI with reusable components using JSX syntax