Course contentsShow
← React
Lesson 39 of 2,3962. Setup and Modern ToolingFree lesson

Understanding the Project Structure

Tour the generated folders: src/ for code, public/ for static assets, and config files at the root.

Understanding the Project Structure

What you'll learn: How a fresh Vite + React project organizes its files and folders so you know where everything lives.

The Layout of Your New Project

When you created your Vite + React project in the previous lesson, several folders and files appeared. Think of this structure like a well-organized toolbox—everything has its place for a reason.

The src/ Folder: Your Code Lives Here

This is your workspace. All the React components, JavaScript logic, and CSS styles you write go inside src/. When you open it, you'll see:

  • main.jsx — The entry point that boots up your React app
  • App.jsx — Your first component (like the front door of your application)
  • App.css — Styles specifically for the App component

Think of src/ as the kitchen where you cook. Everything you create starts here.

The public/ Folder: Static Assets

Files here are served as-is without processing. This is where you put images, fonts, or files that don't need JavaScript bundling. For example, if you have a logo that never changes, drop it in public/.

Analogy: public/ is like the display shelf—things go directly from here to the customer without modification.

Root Configuration Files

At the project root, you'll see:

  • index.html — The HTML shell that loads your React app
  • vite.config.js — Tells Vite how to build your project
  • package.json — Lists dependencies and scripts (like npm run dev)

These are your project's instructions manual—they tell the tooling how everything should work together.

Key Takeaway: src/ is where you write React code, public/ holds unchanged static files, and root config files orchestrate the build process—knowing this layout helps you navigate confidently from day one.