Create a New React.js App
Let’s get started with our frontend. We are going to create a single page app using React.js. We’ll use the Create React App project to set everything up. It is officially supported by the React team and conveniently packages all the dependencies for a React.js project.
Move out of the directory that we were working in for the backend.
$ cd ../
Create a New React App
Run the following command to create the client for our notes app.
$ npx create-react-app notes-app-client --use-npm
This should take a second to run, and it will create your new project and your new working directory.
Now let’s go into our working directory and run our project.
$ cd notes-app-client
$ npm start
This should fire up the newly created app in your browser.
Change the Title
Let’s quickly change the title of our note taking app. Open up public/index.html
and edit the title
tag to the following:
<title>Scratch - A simple note taking app</title>
Create React App comes pre-loaded with a pretty convenient yet minimal development environment. It includes live reloading, a testing framework, ES6 support, and much more.
Now we are ready to build our frontend. But just like we did with the backend, let’s first create a GitHub repo to store our code.
For help and discussion
Comments on this chapterIf you liked this post, please subscribe to our newsletter, give us a star on GitHub, and follow us on Twitter.