Lesson 1 - Introduction

1.2 - Folder Structure

To create your first React application, simply type the following command in your command prompt:

npx create-react-app my-react-app

Replace my-react-app with the name of your choice. This will create a react project with the following folder structure:

Let's discuss the files and directories in detail:

  • node_modules/: Contains all the project's dependencies.  

  • public/: Contains the static assets of the project. The most important file here is index.html, which serves as the template for the single-page application.  

  • src/: Contains the React components and styles. The main files here are:   - index.js: The entry point for the React application.   - App.js: The root component of the application.   - Other components and style files.

  • .gitignore: Specifies intentionally untracked files that Git should ignore.

  • package.json: Contains dependency list and version ranges.

  • package-lock.json: Documents the precise dependencies, sub-dependencies, and installation paths.