Okay, We are in the terminal now and we have everything installed.
So we are ready to create our first React application.
And I have to say there is not just one way to create a React application.
Basically, you can hook up a react library to your existing websites, just downloading the source
code from example from CDN, and then you can start using React.
What I will show you now is I will show you a command line interface for creating brand new React application
and we'll be using terminal for this.
And that's very handy because we can type one command and everything will be set up for us automatically.
So what I will do is I will go to my desktop here and here I can create a new React app.
To do that, I need to type in NP like that.
So basically NP, it's a command available from NPM.
So since version I think version five you can use NPM and then you can type create React app like that.
So Npx create React app and then after the space you need to name your application.
So let's do first Dash app like that.
We can name it whatever we like, but for this tutorial I will just make it first application like that
and then I click enter.
And what is happening now is NPM will download all the requirements like react, react, Dom and React
scripts.
That's a libraries that are available or the frameworks modules that are available for us and it will
be downloaded automatically from the server and it will create a new application.
So you can see here the progress in a second.
It will be all ready.
And you can see here, everything is ready for us.
So what's happening here is we have installed and create our first application with React.
And you can see here success created first app inside our desktop.
So here the blue one is the commands You can run and you can see all of the commands start with NPM.
So NPM start if you will have yarn, it will be yarn, start, yarn, run, build and so on and so on.
So basically what this is, is that options to run some commands and this will do something for us.
So NPM start will start start a development server and this is what we are after.
We want to have a server running locally.
So we'll build our application and we'll open that in the Chrome or whatever the browser of our choice
is and we will run this application and we will be able to write a code and see the output in the browser
and NPM will help us doing that.
And I will show you in a second how does it work?
Npx Run build will actually build a file for production.
You can see here for production, for for production.
That means for the live server because if you will do NPM start, it will kind of build a development
server.
So it's not going to prepare all the files for us.
Run, build will create take our our code compiled into ready minified version and that's NPM run build.
We can also do NPM test which is testing our application.
If you will write unit test on end to end test with this command, you can run it, but we are not going
to focus on the testing in this tutorial so you can do your research on your own if you would like to
have your application testable and then you can also do a run eject.
So remove this tool and copy this build dependencies, configuration files and scripts into the app
directory.
So if you do that, you can't really revert it.
We are not going to do this.
So I will show you how to do a normal development and then build later on.
So what you need to do now is you can do CD and then name of the folder, which is you can see first
app.
This is the name of the our application and also it's the name of the folder.
So let's go inside our folder.
We are inside this folder now and then we can do NPM start, npm start.
What is happening here?
I put npm start here.
You can see starting development server and automatically our default browser.
For me it's Chrome is starting react application.
So you can see here new tab has been opened localhost which is our local development server on port
3000.
That's a react application.
And you can see here we have some React logo and some output and link to learn, react.
And if I go back to the terminal here, you can see that our server is running and you can see here
local or link to on your network if you would like to access from another computer.
This this React application, you can use this IP to access it if you are on the same network.
So that's pretty much it.
Our application is running.
We had one command and then we run server which is NPM start and application is running.
So let's go to the Visual Studio code and we can open that folder now.
First up, open.
And we have our application here open.
And in the next video I will show you and we will walk through all the files that are included in this
folder.