Podcast Lookup

React JS Folder Structure Explained | Understand How to Organise Your React Project

ReactJS Developers Podcast

  • December 3, 2026
  • 1 h 14 min
  • Episode 33
Episode page
About this episodeIn this episode, we break down the React JS project folder structure in a simple and beginner-friendly way. You'll learn the purpose of…
In this episode, we break down the React JS project folder structure in a simple and beginner-friendly way. You'll learn the purpose of important files and directories, how React organises application resources, and how to structure your code for better development practices.Whether you're creating your first React application or working on larger projects, this tutorial will help you understand how everything fits together.What You'll Learn
  • Understanding the default React project folder structure.

  • The purpose of the src and public directories.

  • Understanding package.json and its importance.

  • The role of node_modules.

  • Organising reusable React components.

  • Structuring pages and application layouts.

  • Managing images, icons, and other assets.

  • Organising CSS and styling files.

  • Understanding entry-point files such as main.jsx and App.jsx.

  • Creating a clean and maintainable folder structure.

  • Best practices for organising scalable React applications.

Who Should Watch?
  • Beginners learning React JS.

  • Students building their first React applications.

  • Frontend developers improving their project organisation skills.

  • JavaScript developers transitioning to React.

  • Developers working on medium-sized and large React projects.

Transcript

From the publisher

This transcript comes from the podcast’s own feed, shown as the publisher wrote it.

React JS Folder Structure Explained | Understand How to Organise Your React Project

00:00—
  1. Speaker 1

    Hello, today we are going to read folder structures in MongoDB. MongoDB? Really? I'm just kidding. We are going to read folder structures in React. Now you must be knowing where MongoDB comes from. We will definitely read folder structures in React. So in react js we are going to understand folder structure properly. Because to understand react js folder structure is very important. If you understand this folder structure, not in detail, you will not understand everything because you have not read everything. So, you will understand it to a great extent and if you understand it to a great extent then you will definitely enjoy React. So, what is most important to understand the folder structure? Definitely we should have that folder. Only then we will be able to understand the files in the folder. So where will that folder come from? It will come only when we will make an app for react and we have not learned to make that. So let's learn to make that quickly. And I hope you have set up properly. Setup means VS Code, Node.js etc. And you are watching the whole sequence. If you are watching in the sequence, you will have a lot of fun in react. Nothing will be missed. You will be learning extra. But if you are watching it from the middle, then you may think that this thing should have happened in this video, but it is not yet. This is because I have already told you in the previous video or in the coming videos. So playlist means sequence. So please watch it in sequence, nothing will be missed, you will not even feel that something is missing. Otherwise, if you watch it from the middle, then it may seem that this should have happened in this video, but it is not, while it will happen in the previous or next video. So, you must have heard the story of React. So, what are we going to do now? Now, we are going to do the installation of React. So, I will search React.js here. Where? On Google. Chrome is open and here you have to search React.js on Google. So, can you search React.js? Definitely. What's the problem in this? So, we have searched React.js and the first website you can see is react.dev. There is also an old documentation of this, react.org, I believe. So you don't have to go to this, you have to go to react.dev. So you will come to react.dev. This is the official new documentation and they have made a very beautiful documentation. It was not so beautiful before, but now you will also become a fan of the documentation they have written in such a beautiful way. It will be very fun to read. So here you can see all the things. It is very good to learn. You keep watching this along with what I am telling you through video lectures. And we will definitely do practical. So here you have to come to the installation. Before starting, understand the installation and folder structure. So you have to come to the installation. You will come to the installation and scroll down a little. You can definitely read all these things. If I sit here to teach one by one, then So, you can read all the things written here. For now, I have to install the react app. For that, we have to install the folder structure. So, I can see here creating a react app. So, you can find this way by coming to the installation. You will get this way of creating a react app. Now I will tell you properly from where to do what. If you are getting it, then it is fine, if you are not getting it, then you will also get to know. But, but, but, but, but, you can see the installation here for the time being. If you are doing it right now, then it may be possible that the documentation will be updated later. So here is the create a react app coming, scroll a little. So here you have to click on the create a react app. Now here as soon as you come, creating a react app installation, here you can see building a react app from scratch, creating a react app, okay. So, if you come to the Creating a React app, then this brother is saying that you can use the framework. If you want to build a new app or website with React, we recommend starting with a framework. Okay, we are recommending a framework, but we have come to learn React.js library. Okay, which framework are you recommending? So, you will see here that they are recommending Next.js. So, did we have to learn Next.js? No, we have come to learn React. So, definitely we will learn React. We will not go to Next.js now. Next.js is very powerful. Next.js is based on React. It is a framework based on React. If you have heard the whole story of React, So developers were saying that we can't even make a full stack project with this. Then what is the use of react? So definitely you have next.js, with next.js you can make a full stack You can make strong applications. Can't you make it with ReactJS? You can definitely make it. You will understand all the things that what is the disadvantage of React. To solve it, we have to do ReactJS. We will not go into the framework now. Next.js is your full stack framework. Listen to me carefully. Full stack framework. Full stack means both frontend and backend. What does full stack mean? Frontend and backend. So, we are learning react.js as frontend. You will learn backend as well. When you learn backend, you will be able to properly utilize next.js. You will be able to use all its powers. Otherwise, if you are just working on frontend, then there is no use. Next.js is a full stack framework. So, if you want to properly utilize it, then learn backend along with frontend and then come to next.js. So, now you have to do react. So we have to build React from the core from scratch. So here it says, build a React app from scratch. If you want to do it from scratch, then come here. Click on this. So what do we have to do to do it from scratch? So here we can use Vite. I am not doing this. I am showing all this on the official documentation. So Vite is a build tool that aims to provide a faster and learner development experience for modern web projects. Vite is basically a bundler. There is a bundling tool and a building tool so that you can use React properly in a very fast way. If only create react app, which was our old syntax, some people must be doing it. Create react app, which was the older syntax, that is also fine. You can also do it with create react app. But it is a little slow in the build. There are a lot of things that are better in wheat. It is also based on React. They must be doing React. Listen carefully, I am saying VEET not REACT, it is a bundling tool and it is recommended by VEET itself. I am taking all the updated things. If you have seen it from the Create React app, then you can do it from that too. No problem. I will show you both now. And there will be no difference. There may be a little difference in the folder structure, but there will be no difference in the rest. The same work that we do in React.js, we will also do in Vite.js. Okay. It's the same thing. So, let me quickly come here and show you. First of all, I will make a folder by right-clicking here. And I will give the name of the folder React. What did I give? The name of the folder React. Let's do it on the side. Okay. Double click on it and open it. Right click on it and open with VS Code. This option will come only when you have seen the setup properly. Let's close it. And our VS Code has been opened in the React folder. So what we have to do is open the terminal here. I have told you how I have opened the terminal directly. You can open the terminal by going to the terminal, new terminal or control backcode. So watch the setup video. We have discussed a lot of settings, shortcuts and many things. So what you have to do is, you have to install the react app. Now I have told you in the documentation that we are using wheat to install the react app. So we come directly to the wheat site. This is our official documentation of wheat. Click on get started and it will tell you how to use it. You can scroll down and see NPM, YARNP, NPM1, whatever you are using. We are using NPM here. So, copy it here. I will also tell you the old one, if you are thinking of doing it with the old one, then what is the problem, you can do it with both, you can follow both, but I am recommending the one who is recommending you officially, do it that way, definitely it is very good and you will understand why it is good, why it is very fast, if you are doing it with create react app, it will look a little slow to you, then npm create wheat at the latest, from where I copied it from here, you will copy it like this and come here and You have to go to the ZEIT site, paste the command and press enter. Now you will get an error. I want to show you this error on purpose because those who have a new laptop or have never run a project by running a command on the terminal, then this error must be visible to them and people definitely see it in the beginning. If you have a new laptop or are doing react for the first time, then you will see this error. So I wanted to show you this error that this error cannot be loaded because running scripts is disabled on the system. So this script running option is disabled in your system. Basically it is restricted. So you have to make it unrestricted. So how will you do it? So see this error carefully, you will get it in the starting. So to make it unrestricted, you have to search PowerShell here. What do you have to search? PowerShell. And wait a minute. You have to search PowerShell. typing. Let me fix this first. So, this is fixed. It is recording the proper sound of the keyboard. So, you must be able to hear it. You must be able to see what I am pressing. Feedback is very important. Now open PowerShell and type run as administrator in PowerShell. Let me zoom in to show you. Now you want to check your execution policy. Execution policy. In this way, get execution policy. Look at the spelling carefully and write. Take the exact same spelling. You will also get it on Google. You can go and see. That this error is coming. Basically, how can I fix it? So you will be getting this solution here. So, how will you get the execution policy here? You can get it from the get execution policy. Now see, I remember that I have fixed this error many times. You definitely have to go to google and see, you can see. Okay, I also didn't remember before, but now I remember, I have to do it again and again. So, I remember it. So, if you do get execution policy, then you are getting restricted here. Okay, because of this, we are not able to run exactly. You have to make it unrestricted. So, you have to set it instead of get. Okay. Set execution policy. Here you have to do unrestricted. Alright. So previously it was restricted. What did I do? I did unrestricted. So if you do enter. So on doing enter. Why is it not working basically? Okay. Okay. So here you are getting Yes, Yes to all, No, No to all. You can read all of this if you want to read. You can do Yes to all here. If you do Yes, then it will work, but I apply it for everyone. So I will do A, Yes to all is done. Now you can close it from here. This whole work is complete. I basically cleared the command with CLS. Now let's run the command npm create-vit-at-the-rate-latest and press enter. Now you can see that it is working and no error is coming. So you can get that error in the starting. So how will you solve it? You can see it on google and I have told you that you can solve it that way too. So here I will do y, for ok to proceed you have to do y. Now it is asking the name of the project, so I will give the name of the project. So here I just give the name of the wheat. If you enter, then it is asking you which framework you have to use, basically you have to use it on view, you have to do it on react. You can do anything here, you have to work on react. Select react and press enter. Then it will ask you if you want to use javascript or typescript. If we want to use typescript then we will select javascript. We have selected javascript. Otherwise, tsx will come in the extension. So I believe we have done javascript not typescript. So this is made from wheat and see how fast it is made. So this is our whole app made from wheat. Now we will see how to run it. We will see it very well but for now As you can see the installation is done. I have installed the installation. I have copied the command and paste it. After pasting, the app will ask for the name. I said V2. This is our second project. And we have to select react. So we selected react. Then we have to select javascript. I selected javascript. Ok. We have to do all the work on javascript. And then our work is done. To run it, it is telling you to go inside V2. First install npm. Install all the dependencies. Then you can run with run dev. So in this way you can install the VIT project. And see this is react basically. This is the whole react folder structure but if anyone is confused then I will show you the old one too. In the old one I do this npx create react app and here you give the name of the app like I give the name of react here. So I will enter, see this is being installed, we have done it with the create react app, do y here ok to proceed. Now it will install all the dependencies. And see we are getting a lot of deprecated error here. We are getting a warning basically. Cannot create a project name react because this dependency with the same name exists. Alright. So we can't use the name react. No problem, let's use another name. So npx create-react-app and here let's give the name of the app. So it should be installed now I believe. I am showing you how to install the old syntax. No folder structure is different. We are working in the same way. But if there is any confusion, then I will show you here. Install quickly. And have you eaten or not? So this one we have installed with the npx create react app. And this one we have installed with the vits app. So you saw how fast it was installed. And see how much time it took. Just watch carefully, I won't cut anything. See how much time it takes. It's taking so much time. In this much time, you can do something. Hmm. Will it be today or not? Hmm. It also depends on the net. Whether the net is going fast or not. And it also depends on the laptop. It depends on everything. Okay. Otherwise, it does it on the net. So, make sure that your net is on. So, my net is on. But it is a little slow, I believe. But still, even if the net speed is there, it takes so much time. Okay. Hmm. So... Will it be done today? We will build only one project in this. After that we will not do it again like we did in VEET. I did it in VEET because I knew that it takes less time. So in this much time... We will create at least 10 projects. And if you look at the folder structure, then it is installing node modules only. Rest is not even initialized here. And look at this, all these folder structures have come. There are no node modules in this, so we will install it now. We will see everything, everything. And the charge is also over, I believe. So I will also put the charge now. But first let it install. Let's see how much time it takes to install. So wow, it's installed. And see how much time it took. It took about 2 minutes to install. Now it's initializing the git repository. Okay. Have you learned git? If you haven't learned it, then I'll definitely teach you. It's the work of one or two videos. So I'll teach you that too soon. Because git is very important. You have to host projects. Basically, you have to keep the project properly. You have to work with multiple people. So git is also important to learn. So this is your whole react app installed. So we have done this with the create react app command and we have done this with the wheat command. So what difference do you see here, node modules are coming, public is coming, src is coming, get ignore, package log json, package dot json, readme. Public is coming, src is coming, get ignore, is linked, config.js and you will also get a wheat.config.js in it that you want to change some port or something else. So you are getting some extra files. And it is better to use. The wheat syntax is better. I am talking about syntax. Bundler is better. Readme.md and package.json are also available. Package.log.json is not available and node modules are also not available. Why? Because it has node modules and package.log.json. It has islin.config.js and package.log.json is not available. I will show you that. It has installed node modules. You must be not understanding that we will learn folder structure properly. But for now I am showing you what is in it and what is not in it. So note module is coming in it. That means all the dependencies are installed. That means this app is ready to run. I can run it definitely. So how will we run it? So you have to go to the app folder. To run the app, you have to go to the app first. To run the car, you have to sit in the car first. So if you want to run the app, you have to go to the app folder first. Now we are in the react folder, so here we will come to the CD app. So these are all the basics and foundations. Let me tell you this properly once, then you will know, as we have also gone to the javascript advanced topics, we will go to this too. And as soon as the interview comes, then don't worry about it, it is also being made. So here we have come inside the app and we will start npm so it will start. Now how did I know that I have to start npm, so I will tell you all the things, but for now you allow it here and you will see that it has started, you will come here in the browser, see this is running, it is starting basically and now for the time being I will show you how I got to know that I have to start from NPM start, see here In this script, to start, this is start script add. To build, build. To test, test. To eject, eject. So, I did npm start, so it started. If we do npm build, then it will build. You don't know what all those things are. Even I don't know, I won't tell you. Okay, we will talk about it later. It has been successfully run. The whole react app is ready. The whole app has been built and we were able to run it. Now I will open another terminal and try to run the VEET app. To run the VEET app, we have to install the node module. So wait for a minute, it's getting a lot of noise. So to run this project, we will first come to the wheat folder. So we have come to the wheat folder. Now here we have to install the node modules and dependencies. Now you will not understand what I am saying, I agree. But for now, you can see how it is working. This is a detailed video on the folder structure, so we will learn everything. So you have to do npm i app or npm install. If you write install then also it will be installed. If you write npm i then also it will be installed. So let's enter. So here the installation has started. And see how much time it takes in this. You saw how much time it took in the react app. Now let's see how much time it takes in this. So it will be much faster than that. First of all, we have created a project and the project is also very fast. Now here we are installing node modules etc. This will also be done quickly. So let it be installed. See the folder of node modules has been made here. Package.log.json will also come which was not here and was in the app. See package.log.json. See it has been installed here. See how fast it was installed here. So here we have node modules and package log.json. Now how to run it? So here we will see that in the script there is a dev command. Ok, it is built to build, but there is a dev to run. So here we have to do npm dev. Will we do npm dev? So by doing npm dev, the run is not done. Here you have to do npm run dev. NPM RUN DEV and see your run is done but you can't see it now. This is the one of react which we were running here. And here this one is how to run it. So here you copy this link and paste it in the browser. So you can see how it is running or you will click control. See this control plus click. So if you click control then it will open in your browser. Wow. So we have made it through wheat. Wheat plus react. Ok. So it is better than wheat. Sorry it is better than react. Bundling is very fast and in a very good way. Reject is an upgraded version. So you will be able to work here very easily. In folder structure, there is a lot of difference between node modules. In public, src, files, etc. There are some less files in it, but there are all the files in it. So we will see this wheat one. And if you come here in src, then it is using app.js syntax. Rest all the code written here is similar to this, nothing is different, but the extension is. jsx. You can also do. jsx here. This is the app that we have installed from react. So here is the syntax of app.jsx index.js and here is. jsx. So here the restriction is a little more. Here you have to use JSX only and not JS. Here you have to use capital letter in the starting and not small letter in the beginning. This app should have capital letter and not small letter in the beginning. So all these things are the restrictions in VEET. If you don't follow them, you will get an error. Rest, you will solve it easily. And in react, there are very few restrictions and it is not a problem. Now what we will use? We will use the wheat one. Will we use this one? No. React itself says that use this one. We will use this one. And we have seen that its bundling is very fast. And actually it is very fast too. There is not much difference in the folder structure. So you understood this much. I have also told you the old one that you can also do it with it. But here what is recommended to you now? You have to do it with Vite. So we have learned installation. What did we learn? We learned that we have to go to the site of Vite. React is recommending Vite. So we have to go to the site of Vite. There you will get a command. You have to copy the command. You have to come to the terminal and paste it. If there will be an error, then we will fix it. We will open PowerShell and make it unrestricted there. Definitely. Then after that we will paste the command there. We will enter and our Pura ka pura react basically install ho jayega. Pura ka pura folder structure hamare paas banke a jayega. So, we have learnt this. Now, in the folder structure, it is important to understand about each folder and each file, that which file and which folder is running. We have run it. We saw that something was made there. But how will they make it? We have to make our own project. So, how will they make it? For that, it is very important to understand the folder structure. Exactly. So, we will understand each folder and each file definitely. But only as much as is needed. Rest, you must be able to understand while doing the project. So our folder structure looks like this. If I show you the code. So this is your code. I open V2 here. We will run V2 only. So our V2 is fresh. We haven't done any changes in it. So you can see public here. SRC is visible. Okay. Node modules are not visible. So you have to install here. I told you. So first of all you have to go to the V2 project. So V2 is there. So we will do CD V2. We have come to the V2 project. Okay. Now what you have to do here? I said you have to do npm i, you have to install npm. When you have to do? You have to do it when you need to install some package. You can't see any node modules here. So can you see any node modules here? No, there is no package log.json either. So there is no dependency installed here, there is no package installed. So you have to install it? Yes, you have to install it. You have to install all the packages, whatever is there in package.json. So, install all these. So, will you install one by one or not? It is written in package.json. You just have to do npm i or install npm. What will be installed? Definitely, I do npm i. Short, the more the better. So, it will be installed. This is our folder structure. Public, SRC, gitignore, islinconfig.json. These are all things. Node modules will come and log.json will come. So, how will it look like? It will look something like this. So, here is our app. Basically, it is a Vite app. This is a main folder in which our entire app setup is inside. First of all, node modules. So, node modules are very important. Now, we have seen that inside node modules, whatever we are installing, packages etc. React is a library, we are working by installing all the packages here. Whatever the need is, even if there is a need of a third party library, then we can easily install it and use it here. So whatever dependency we are installing, it must be coming inside this node module. So actually I am coming inside this node module and from here we are working on all the things, definitely. So, whatever package we install in node modules, that package comes inside node modules. We understand this much. So, node modules are important and you don't have to make a mistake in node modules. Don't make a mistake in node modules. You don't have to make a mistake in node modules right now. If you become a pro later, then there is a need for a mistake. If you are making an editor, then you can make a mistake. You don't have to make a mistake in node modules right now. You have to do a very good job on the package you have installed. And if we are not getting the node modules, then you have to do npm i or npm install. I said you have to do npm i or npm install. So will the node modules come? Definitely. Listen to me carefully. Because we can install node modules, that's why if we want to send this code to someone, Listen carefully, if you want to send this code to someone, or if you are uploading it online, like you are uploading it on GIT, then we don't upload node modules there, because node modules are very bulky, very bulky, heavy, so we don't upload it, we don't spend net or anything on it, or whenever you are converting it to a zip file, then you are deleting node modules. Why? Because we will easily install node modules in npm i, all the packages in node modules will be installed. Your package.json is the main one. Okay. So node modules are important. You have to install it. But I am saying that you are sending someone your code structure or file or you are uploading it on git online. So you have to remove node modules. You don't have to upload node modules. Okay. Node modules are very bulky. All the things are in node modules. And we can easily install it by doing npm i. Okay. Very good. This much we can understand. So, in Node modules, all the things are there. Do you want to shake it? No. Everything is in it. Can we install it again? We can. Did it get deleted? No problem. No problem. Hmm. You told it well. Then, after that, we will see all these things. In package.json, important in these files, then this is important. How important it is? It is important because we have done NPM IE, node modules have been installed. Node modules will be in this package. Whatever you were seeing here in the dependency, package log.json. Let me close it for a while. So here you were seeing azure dev dependency. So it is installed here. All the things must be coming in it. There is everything here. If you do a little more down, then a lot of things have been installed here. All the things related to dependency and devdependency are coming here. So, you have installed react-react-dom and you can see it somewhere. Come to R and see react-react-dom. So, you can see it somewhere. So, you don't have to open it. It is very big. If you open it, you will get tired of going down. It is very less now. But as you make projects of big size, you will have a lot of things in it. So, don't open it by mistake. You will get scared. You can delete it if you want to install it again. This package.json is very important. This is the most important part of the app. Everything is written in this. Name of the app, version, type, private true, script, lint, preview, etc. You don't have to think too much about it. Dependency, dev dependency, etc. You don't understand a lot of things in this. Just keep in mind that package json is very important. The whole configuration is in this. What are the dependencies that you have installed? What are the dev dependencies that you have installed? Basically, either you have to install it or you have to install it. Okay. Then what are the things that are happening with the script? Like if we want to run, then we can run from dev to build. We have a build command. So we have written this script. Name, type. See, here we are using the module. Remember the java script? Oh, last lecture. Module. CommonJS and ES6 modules. See here it is using a new module. You can use CommonJS here also but it is using a new module. You don't have to make fun of it. You have to use it like this. I am telling you all the latest things. Alright. So after seeing we are understanding something that this is a JSON type. I have also taught you JSON in JavaScript. So if you are reading JavaScript. You will enjoy it a lot. I am telling you, you will enjoy it a lot. From where will you read JavaScript? So, I have made a full course of Premium JS. If you haven't seen it, then you can go and read all the things in depth. It is proper. I have given all the things there. On Google, not on Google, basically you have to search Premium JS on YouTube. There, I believe, you will get the course of Premium JS at the top. You can read the whole thing there. So, I have told you about JSON. See, you can see JSON. Key is also in string format, value is also in string format and all the things are properly written here. So, dot json means that we are storing all the things in json format. So, package dot json. Can we change the name or not? Here we don't have to change the name in any of them. The name of node module is node module, public name is public and src name is src. We don't have to change the name. If you are making different files, there is no problem in giving any name. But now, by default, you don't have to change the name in this. Okay. So, here you can see the script. So, what is the difference between Dependency and Dev Dependency? You are making a React project. So, in React project, you will find some dependencies. To fetch the data, you will install the axios package and install it as a dependency. Then you will install something like react-hot-toastify to show the toast message. Okay. Dev dependency means, dev dependency means, it will be useful only during development. Dependency means, when you will be hosting, then it will be installing all the dependencies. Why? Because these are the dependencies on which your project is running. Listen carefully, clear it now, then it will be very good. Dependencies are those on which your project is running. Okay. which is running your project, what are the dependencies, what are the packages, what are the libraries that you have used in that project, those are your dependencies. Without that, your project will not be able to run properly. It will not run. Okay, bugs will come. What am I saying? Bugs will not come, errors will come. Okay, bugs can also be called, bugs will come. So, what is dev dependency? Dev dependency is the dependency which we use only in development time. Only in development time. To check the state of the Redux Toolkit, you have to check the state of the dependencies that you are installing here. Basically, for state management, you just want to see that in the time of development, whether we are able to configure the state properly or not. So, here you will install the dependencies, you will go to the node.js and read the node.mon. So, all these are your dev dependencies that you will use it in the time of development. If you are serving, then there is no use of all those dependencies. It will only work during development. So, the dependencies, the packages that are working during development, those are your dev dependencies. And the packages that actually depend on your project, those are your dependencies. So, you have to keep this in mind. So, wherever you install dev dependencies, you put slash D at the end. So, as a dev dependency is installed. And where you don't put slash D, it is installed as a dependency. I also show you by installing one package. Let's make it a little smaller, let's make it CLS. And look carefully, I am inside V2. So you have to come inside it and install it. Otherwise, a folder of node modules will be made outside. So now see in dependency you have react and react-dom. I install npm i here. I will install react-router-dom now you can see react-router-dom in dependency now we can use our react-router-dom in react project I told you exeos now you can see exeos in dev dependency If you are installing something which is coming in your dev-dependency, then it will be coming here. For now, I will install npm i nodemon slash d if I want to install dev-dependency. That means it will be useful only during development, so I have to use it only during development. I don't need it during hosting. as you can see as a dev dependency node mon is installed here and in dependency we have xios and react-rotter-dom which we have just installed so this much you can understand, yes this much we can understand this whole package.json we can understand and this also we can understand this is very important this should not be deleted This should not be deleted, it is very important. By chance, if this package.json is deleted, then you have to configure the whole thing yourself. So, don't let it be deleted. Okay. Then its package log.json is also looking similar. What is this? So, see what is this? Understand this together and then come to the main files. So, here you are seeing its version. In dependency, here in axios, you are seeing version 1.10.0, 19.1.0, 19.1.0, 7.6.3. This is the version of the package you are installing. This is the version of the package you have installed. There can be older or newer version of the package. But you are using this version of the package. Use 1.10.0 of Xeos. Then you are using 7.6.3 of React Router. So, these are the dependencies and the version is written here. So, whenever it is installed, it will be installed. But in the time of installation, whatever you have written in the dependency, see here is a symbol of caret and after that you have given the version that this is the version. So, this means that whatever package you are installing, either install the current package or the latest version package. Basically, your version will be 19 only. I don't know whether you have read it or not. I will tell you how to check the version. Here you can see the two digits of the dot. There are three parts in the dot. The first part is 7, then the middle part and the last part. The first part is the major version. The middle part is the minor version. The last part is called the patch. So, this is the major version in the starting. What is the major version? Sevan. You can understand it in this way that your web series is coming. So, season by season comes. So, season 1, season 2, season 3. So, this is season 7. We call this major version. That your season 7 is going on here. This is the minor version of the beach. Basically, in this version, something can be added, nothing can be removed. Basically, whatever version is being used, if this version is also used, then there is no problem. Suppose if someone is using version 7.5, then if we also give it 7.6, then there is no problem. 7.6 means that we have added something in version 7. The old one will work, we have added something. And this 3 means patch, means we are fixing some small bugs. Or we are improving some typos. So it tells you this patch, which you can see in the last. So from 3 to 4 means some bug has been fixed. From 4 to 5 means some bug has been fixed. From 6 to 7 means some features have been added here. In which version? Same, in the 7th version. And from 7 to 8 means the whole version has changed. If you are using the old version, then you will get to see the error. Then you have to change the code if the whole version is changed. So this is the way to look at the version. If the whole version has changed, then you will definitely have to change the code. But if the version is the same and only minor improvements have been made, that means some changes have been made, the old code will work as it is. If something has changed in the patch, that means some bug has been fixed, typos have been fixed, then you can work easily. So, these dependencies are written in package.json. This means that whatever version you are getting, install it. Or if a new version is coming in the patch, this is coming from 3 to 4, this is coming from 5, then you install that one. So, this accurate version is not telling you right now. In future, if you will install it again, then it is possible that instead of 7.6.3, 7.6.5 is installed. 5 is installed. So, that accurate version is visible in package.json. Look here. You can see all the things here. In dependencies, you can see all the things like axios, react, react-dom, react-router-dom and nested. You can see everything here in detail. Okay, so you understood package.json also. And you can read more in depth about this. What other things we can do in package.json. Or package.json. If package.json is lost, then it is not a problem. You can install it again from package.json. But package.json is very important for you. You don't want to lose this. Keep this in mind. You don't want to delete this. Or you don't want to do much of things in this. Like if I assume some version like this. From some other application. Who has made another application. I want to install all these dependencies at once, so I have to do NPM I only. Otherwise, if I want to install Axios, then I have to do NPM I, Axios, NPM I React, NPM I React DOM. Hmm, can you understand what I am saying? See, I am explaining you so much because this is your base. After that, when we will move forward, I will not tell you all these things by turning. What is this? How is it happening? I will give you a little idea that I will move forward in this way. So this is the base. If you understand this at once. Okay, what I am telling you now, a lot of things will be going from above. But overall you understood the folder structure. You will be able to work on React in a very fun way. Okay, in a fun way. JavaScript you have done, React is nothing. It is the whole JavaScript. Okay. See, I told you about JSON. So, we have read JSON in JavaScript. Nothing but object. What is this object? In object, you have given some nested object in key value pair. Is there anything else? No. So, you understood package.json. So, package.json and package.log.json is also understood. Whatever you are installing in this, your accurate version is mentioned. In this, if there is any improvement in the next patch, then that version will be installed. And here you can see the accurate version. So, if package.log.json is also in your file, then if a developer is installing, then through package.log.json, he will be able to install the accurate version. And the chances of bugs are less. When multiple developers are working, then here your All this is very useful. Okay. And I haven't drunk water, so again I'm getting a little tongue-sleep. I'm saying something from time to time. So, will you take a break? No, I will tell you a little, I will take a break. This is a small topic. Then we will discuss about it. Basically, you need plugins etc. and extra plugins etc. So, you will bring it here. When you are installing something, you will have to put plugins etc. here. If you want to use anything extra, So, here you will put plugins etc. How will you put? We will see everything further. So, in vid.config.js, you can mention all the plugins here. You have seen this port, we were running it. We do NPM RUN DEV. So, while doing RUN DEV, you will see here which port it is running on. See, it is running on the HTTP colon slash slash localhost 5173 port. If you run here and see, it is running on the 5173 port. You can also change the port here. So, how can we do it? So, I believe server. We can mention the port here. So let's say I mention 3001 port. Now it was running on 5001. Let's see how much it was running. I will comment it. So it was running on the port of 5173. As I will mention my server port 3001 in this way. So here it started running on 3001. See this. So in this way you can also change the port. You think that you have already run some software on the 5173 port. So you change the port there. You can work here easily. Anyway, when you will be doing all these things, when there will be confusion, then we will see there. So, don't put too much mind in it. I just told you that we can do all these things from here. Readme.md is basically made to read. You can prepare the documentation with the app you are making. What are the things in your app? How to run your app? So that if any other person tries to use this repository or this app or you give it to another person. If you read the git then I will be able to explain you better. Suppose you have given this project to someone by making a zip folder. Now he will understand how to use this project and what are the things in it. You are writing all these things in readme.md that these are the things, first you have to install it like this, after installing it, you have to run it like this. Then you will get all these things in this folder. So, whatever you want to write according to your convenience. It is just for reading. Documentation. You can write that in readme.md. Then what is islint.config.js? We will talk about it properly later. You are also mentioning in this that how your file will be being utilized here. I don't know where is this crow? There is a tree next to it, so they are disturbing. In Islint, you are also mentioning the configuration of the project. Like you want to tell about the styling of the project. Like you want to tell about the styling of the project. So, all these configuration you mention here, then it is telling you by checking that you are actually following that thing or not. So, you made a rule, according to that rule, it is telling you that you are following the rule or not. Something like that. Okay, and you don't have to go into too much depth now. So, you understood VEED.CONFIG.JS. Now, let's come to node modules. You understood public folder. SRC is very important. You can understand this engine. It is like the engine of the car. It is SRC. So, what is public folder doing? Public folder is basically serving static files. Static files are being served. That means, whatever files you are seeing here, as it is in the browser, you can access it and you can use it directly in other folders also. How? I will show you how. Like we can do it in the direct browser. Here you have wheat.svg. So I believe wheat.svg. Here you can see the wheat icon. So we are getting wheat.svg here. So what I have done is I have just done slash wheat.svg and we are getting wheat. That means it is serving on the browser. Whatever we have kept in public, it is directly serving on the browser. All the static files are being served directly on the browser. So here you can keep all the files and icons in public that you have to serve publicly. And whatever you keep in the public folder, you can directly access it in SRC without importing. This is not the way you are importing. You are directly here in href. Like you are using it in HTML. slash something image etc. you can do it that way. What you have written in public, here directly slash vid.svg. This way you can render your own. Now I have put it in anchor tag, which doesn't have any meaning. So, we will see all the things in the future. So, you put the things in the public that you have to serve statically like images etc. Some logos etc. So, you have to serve that. So, you keep it in public. Rest, you don't have to do a lot of teasing in the public folder. When you have to do it, I will tell you how to do it. Okay. So, you understood this public node module. All the packages are there. You understood that the public is directly serving the static files on your browser. Now, I have shown you how you can access the browser. And you can directly access the files in the public folder in the src that you have made. If you have made a folder structure in it, then you can directly access it. you can access it, you will see everything, little by little, just take an idea of ​ ​ how the car looks, what is the seat in front, what is the seat in the back, how the engine looks, how the gear works, etc., just see everything, then after that, after that, git ignore What is gitignore? In gitignore, I have told you that when you are keeping your file on git, you will not have much idea of git. So, you can understand git as an online storage. For now, you can understand it as an online storage. Where you are keeping your code base and storing it online. And multiple people are working there by cloning the repository or collaborating. Wherever you have stored online, multiple people can work by cloning from there on your project. So git ignore means which are the files that you don't have to push on GitHub. Wherever you are storing in online storage, you don't have to push there. Which files don't you have to push? Like I don't have to push node modules. So I will mention here that we don't have to push node modules. Why? Because I told you that node modules are very bulky. So why will we push node modules? Why will we push such a bulky file? When we can install the entire NPM I command run. Important is package.json. PackageLog.json. Why will we upload this? No, we will not upload this. So, we will ignore this git. We will say that you don't have to go. Okay, you stay here. So, wherever you are basically uploading on GitHub, this will not be uploaded. Note modules. Anyway, this is the part of git when we will learn. This is not going to be used here. When I will tell you about the project of React, I will tell you about Git in between. Or I will take a separate lecture about Git in between. Because it is important. So don't think too much about Git right now. We are keeping configurations in it. Then you understood package log.json. Yes, accurate version and nested structures are stored here. It stores the details. Package.gestion is very important. It contains all the dependencies. Readme is for documentation. How your app is working? What are the things in your app? How to install? How to build? You are writing all that in readme.md as a documentation. The developers are writing that only. Then, read.config.gestion Sorry, what are we doing in VEED.CONFIG.JS? In this, we are also telling you about the plugins you have installed here, which plugins you are using, and you can mention different things here, like you can mention the port here if you want to change the port. There are many more things that we will see in the future during the project. So, our folder structure was something like this. Now let's move towards SRC. You must have understood this folder structure. And if you understood this much, that's good. Your work is done. After that, you will not even look at it by turning it. After that, whatever work you are doing, you will be doing it inside SRC. So let's tell this first. No, I didn't tell this first because the main work of this is to understand all this. And I didn't tell index.html. Why? Because we already know. No, that's why I didn't tell. Because I will tell it now. Okay. As index.html and main.jsx are linked, I will tell you about them later. You can change the name of the assets in the assets folder. You can keep the name of the main.jsx as it is. If you want to change the name of the app.jsx, you can do it in the same way. So, I will tell you how. In assets, we are keeping icons, logos, etc. which you don't want to keep publicly accessible. So, you can keep it in assets. You can use it in all the files. So, you have to use the import syntax there. We will see how to do it later. Now you can change the name of the assets folder. In app.css you are writing css which is app.jsx. You can understand that this is the file of javascript. Now we will understand what is jsx. I told you in the untold story that jsx is the combination of javascript and html. For now, you can understand jsx as javascript or as html. For now, jsx is the combination of javascript and html. So, whatever we are writing in app.jsx, we have to style it. So, to style it, we can style it in app.css. Okay? Very good. So, we will be styling it in app.css. In app.jsx, we will be writing our HTML code. We can also write JavaScript. So, you will be seeing something like this. Okay. After that, we have index.css. This is your global CSS. Global CSS means, whatever you will write in it, globally, it will be working everywhere. Alright. So, this is our global CSS. Yes. This is our global CSS. And when you will be using it, you will be getting more clarity. After that, your main.jsx. This is important. This is important. Now, listen carefully. Now, here comes the actual thing to understand. What is the thing to understand here? I had told you. I had told you. Here in React. Okay. In React, you have two things. HTML is there. CSS is also there. Basically, I am telling you HTML and JS. It is a mix of these two. That's why people were hating it. Untold story. You have heard the untold story, right? The first lecture was ours. So, the mixture of HTML and JS is basically made by combining HTML and JS to manage the code base properly. So, it is very important to understand that one will be HTML and one will be JavaScript. So, the main file is index.html. index.html this is your main file index.html which is running on your browser definitely when you make a project in a normal way index.html style.css script.js these are the three files which is running on your browser index.html inside that you can you link css here and here you link js here rest of the things are running so this is your root index.html understand this this is your root here in react your main root file is this index.html is running now whatever we will link with this index.html it will do its work so in index.html we have to link a script file so that we can link with javascript Do you agree? It is index.html. We will link it with script file. That's why it will be linked with JavaScript. And we have to learn how to mix JS and HTML. Yes. Exactly. So, we will add script in it. Okay. So, it is linked with JavaScript. Yes. Now, you are saying JSX syntax. So, how will this come? Now, let's understand. Come here. What is the root file? Index.html. Look carefully. What is the root file? Index.html. Is it running all the things in it? Yes. If we come here in the browser and run our project again. Look at this. It is running. Very good. And what is the name here? Let me close all this. Very good. What is the name here? Vite plus React. Look here. Vite plus React. Can you see it? Is it coming from here? Yes, it is coming. If I change it here, if I give the name here, MKL, then what will come here? MKL is coming. Wow, wow. So run is doing index.html here. Yes, yes. But, but, but, but, but, here all these things are not there. This VEET plus react, this count which is visible, here all this text which is written, all this, and here this logo, where is all this coming from? This is not visible to us here. In the body, this is just a div. After that, we have added java script. In the body, this is just a div. And div is also empty. There is nothing in it. Okay. So, where is all this coming from? Hmm. Now, here comes React. Now, here comes React. Okay. Now, understand carefully. This div is empty. What is the ID given? Root. And what have we attached here? Script. Script. Okay. That means JavaScript. Yes, JavaScript. But in JavaScript, in SRC, there is not. js extension. There is. jsx extension.. jsx means javascript and html will be together in this file. Now we have to understand JSX and virtual DOM in detail in the coming folder. So I will not talk much about it now. Just understand from where all things are linked. So we have linked this script. So src main.jsx is linked. So now find where it is. Here is src. In src main.jsx. Oh alright. So is this file main? Is this file main? Yes, that's why its name is main. I'm joking. If you see in React, its name is index.js. What is index.js? Here it is main.jsx. So, it depends on your different framework and library. Here it is main.jsx. So, from index.html, main.jsx is directly linked. That means, the code we will write in main.jsx, which is javascript and html, will run the same code. Yes. The code we will write will run the same code. But we don't have to write only JavaScript. No. We don't have to write only HTML. No. We are using React. Yes. React has JSX syntax. Yes. So we have to do the JSX work. Yes. So how will he understand that we are writing JSX and that virtual DOM which I have told you in Untold Story. I have told you the whole story. What is happening in it? So you don't have to go into much depth. Just understand that document.getElementById We can select any element in HTML. We have selected the root element. We have selected this element. That means we will be injecting all the code in it through java script. Oh, alright. We will be injecting all the code in it. Yes. Look carefully. We have selected this. Then I am asking to create a root. Now how will this be created? So, react dom slash client is coming from here. That means now the game of react starts here. Now we have involved react here. Now it is working internally. Do we have to understand internally now? No, we don't have to understand now. Now we just have to understand the involvement of react. So it is here. We have created a root. You can understand it in a different way. I will show you in 2-3 lines. Let root element is equal to This is our root element. After using this root element, we made a root. Let root is equal to. This is our root. And then inside that root, we rendered our application. Now what is given here? Strict mode. So remove this now. You don't have to go to strict mode now. In strict mode, it is basically checking if there are chances of bugs coming. So There are a lot of things, I will tell you later. So, remove this for now, there is no use of this. Very good, we don't need strict mode. So, what we did? We selected this root element first from index.html. The run should be here. So, we selected this root element. Okay, the root element is selected. Then here we selected the create root, which we are taking from react. So, we have created this root. We have rendered this app inside the root. Now, what is the component of this app? This is app.jsx. So, will we run all the things inside app.jsx? Exactly. See, it is running the same thing. See, the logo is visible here. See, this is react.jsx. Here you can see all the things like edit, and save to test HMR, click on the V10 and react logos to learn more. All these things you can see here. Oh, alright. So this was the funda here. Tell me one more time, I don't understand. I don't understand clearly. See, what did I say? I said index.html is your main file. At the end, HTML, CSS, Javascript is running on the browser. Browser understands HTML, CSS, Javascript only. So, here is the HTML. Now, we have to link Javascript. What is the link? Main.jsx. Here is the main.jsx. We can understand this import. We had read the import. We will see everything in detail in the next lecture. We will see how to work. Now we are understanding the folder structure. We have linked main.jsx in index.html. This is main.jsx. What did I say here? I said that all the things in this. we have to render all the javascript and html and jsx that we have to render here ok, how we will do it? here we have selected document.getElementById root name it as root if you give some other name like alpha name then your name should be alpha too will it run? it will definitely run ok, why it came here? because there is some problem in CSS we have selected it from root, we have selected alpha, that's why there is a problem. So let's make it root again, because our CSS will also get spoiled. So we have selected it from root, but what will we do after selecting it? We don't have to do DOM manipulation. Do we have to do DOM manipulation? No, we don't have to do DOM manipulation. We need the power of React. We have to use React. So, we have to use React to create a root. And we have made a root using it. And we have put the root element inside it. That means our root is ready. This is the root. And we have created our root using React. Now, what we have to render inside the root? So, we have to render this component. App.jsx. See this app. We are importing app.jsx here and rendering this app here. That means whatever we are writing in this app, it will be working here. So if I remove all these things from here and write a heading, hello, how are you? So will it run here? Look at this, hello, how are you? Wow! Wow! Is it running here? Yes, it is running here. You can remove all this. I have removed all this. I have cleaned it completely. You can remove app.css as well. Your css is spoiled. We need css that's why we are importing css. Why are you doing like this? We will see further. That is not our aim. Now we have to learn folder structure. So this is ours. Don't you think this is like a function? Yes, it is a function. We call it a component. We will see everything further. So, we are using app.jsx in main.jsx and we have linked main.jsx here. That means main file is index.html. Okay. After that main.jsx. Okay. After that we are doing all things in app.jsx. Okay. Then all the things we are importing in app.jsx will be linked and we will be using them. Alright. Alright. So, if we want to run Hello World in this way, then we have to maintain such a long folder structure. That's why I told you earlier that when Facebook built it, they built it because their UI was very complex. To solve, to remove the complexity, they built this whole package. It's not like we are making a small project of Hello World, we are making a calculator for that, we are using React, no. For big projects. You are making a Flipkart clone, you are making an Amazon clone, for big projects. Okay. Does it get very easy in that? Very easy. Whatever you do with JavaScript, your condition will get worse, you will do that very easily with React. Hmm. Now we understand that for small projects, this is our index.html. Do JavaScript link, do CSS link, it's done. Why do this much? This is for big projects. Okay. So should we MC for big projects? Yes. For small projects, your JavaScript is enough. Okay. Hmm. Wow, now we understand. So this main.js is important. Inside main.jsx, we are using app.jsx. And inside app.jsx, we are using app.css. And inside main.jsx, we are using index.css. That's why I was saying it global. Because in main parent, we are using this css. So that's why it's global css. And how to use css, tailwind css, we will learn everything. So now you must have understood folder structure, I believe. You must have not understood code. I believe you must have not understood code. Folder structure must have been understood. Okay. So now let's come back here. And let me give you a recap. What are the things you have here? Node modules. Where all your packages. Actually installed packages are in all the node modules. Delete it. No problem. Give it to the other friend or those who also want to work. We will install it by doing npm i. How will it be installed? In package.json you will have dependencies. Dependencies will be there. Dev dependencies will be there. Through that it will install. Whatever dependencies will be there. It will be installed and come in node modules. Okay. Then we don't have to delete the public folder, the node modules and other things. Whatever you are working in SRC, you can delete it easily. I will tell you how you can do it later. So you don't have to delete it, you don't have to delete the public. In this, basically your public files are being served. It is serving the direct browser. You can also use it directly here in SRC. So we will see everything in the future. Okay, so whatever you want publicly, you want the logo or you want something like this, then you can put it in public here. Okay. But we will work on SRC. Now you can see that while pushing the whole folder structure on git, we can tell which folder should not be pushed. Like node modules should not be pushed. So we will put it in gitignore. So it will not be pushed on git. We are writing the configurations in it. index.html is our main which is running. package.log.json package.json is our main. In package.json, whatever dependencies are there, when we are installing, it is possible that something will change in the patch, a new patch version will come, then it will be installed. So the actual version is handled by package.log.json. Readme is for your documentation, you can make documentation here. And in V8config. js you can mention your own configuration like which port you want to run on. Or some plugins you are working on after installing. After that your main is src. Your index.html is your main html file. In this we made an empty div which was an empty div. We gave some id and some root. Now we have to inject all the things in this div. So what we did in main.jsx? We selected the root element and made a root using the power of react. Where we can use all the things of jsx. So we made a root and rendered app.jsx. That means whatever we are doing in app.jsx, we are doing through react. All those things will be rendered on the browser because we have linked index.html to main.jsx and app.jsx to main.jsx. So indirectly app.jsx will be rendered on our browser. So can we do all the work in app.jsx? Yes we can. But in between we have used the powers of react, we have created the root using react. So now we are going to use all the functions and components in react to work here. We are not using core HTML, CSS, JavaScript. We are using React. CSS and index.css. So I have given the notes for you. You can read the purpose here. This folder contains all the dependencies and package. Packages your project needs. So all the dependencies and packages are installed in this. You can generate by installing npm. You don't have to touch it unless you are very much pro. Then public file contains static files that do not go through the VIT build. What is VIT build? We will see further. In VIT build, a lot of things are being optimized. So whatever we keep in the public folder, there is no need for optimization. Because it is serving directly. So whatever you want to directly serve, you keep it in public. Example, vid.svg is a default logo provider. So I have written a lot for you here, you can read it easily. In SRC, you can change the name of your asset, you are basically keeping a logo in it. If you want to keep it in a separate folder, you can keep it. There is no restriction, you can work according to yourself in SRC. App.jsx is your main HALT and you can see the UI you are creating here. And app.css is the style for app.jsx and whatever skeleton you are creating in it, it is your app.css to style it. Index.css is the global style for all the applications and it will apply to all. Main.jsx is the entry point for react. Rendered app.jsx into the DOM. In DOM, it is injecting the entire render. Then git ignore, tells git which files or folder to ignore. Which folder to ignore and which to accept. islint.config.js islint helps catch errors and enforce code style. This config file defines rules and plugins. index.html is your main html file which is being rendered. Here you make a root which is being mounted. package.json Very important. It describes your project, contents, project name, version, script, get, build, dependencies, etc. Everything. Your package.json. This whole raw letter is yours. This is the raw letter of your application. This is lost. It's a problem. package log json auto generated by npm looks exact version of dependency to ensure consistency so this is the exact version that is being stored readme.md is for your documentation you can make your documentation here you can write instructions here You can easily change the port, plug-ins, default settings etc. That's it for this video. Folder structure is complete. I have explained it a little more because it was very important. These are the basics. Do you know Javascript? There is no problem in React. I am telling you. You can learn it very easily. Okay. So, see you in the next video. Till then, bye-bye.