Book Image

Serverless Web Applications with React and Firebase

By : Harmeet Singh, Mayur Tanna
Book Image

Serverless Web Applications with React and Firebase

By: Harmeet Singh, Mayur Tanna

Overview of this book

ReactJS is a wonderful framework for UI development. Firebase as a backend with React is a great choice as it is easy, powerful, and provides great developer experience. It removes a lot of boilerplate code from your app and allows you to focus on your app to get it out quickly to users. Firebase with React is also a good choice for Most Viable Product (MVP) development. This book provides more practical insights rather than just theoretical concepts and includes basic to advanced examples – from hello world to a real-time seat booking app and Helpdesk application This book will cover the essentials of Firebase and React.js and will take you on a fast-paced journey through building real-time applications with Firebase features such as Cloud Storage, Cloud Function, Hosting and the Realtime Database. We will learn how to secure our application by using Firebase authentication and database security rules. We will leverage the power of Redux to organize data in the front-end, since Redux attempts to make state mutations predictable by imposing certain restrictions on how and when updates can happen. Towards the end of the book you will have improved your React skills by realizing the potential of Firebase to create real-time serverless web applications.
Table of Contents (16 chapters)
Title Page
Copyright and Credits
Packt Upsell
Contributors
Preface
Free Chapter
1
Getting Started with Firebase and React
Index

React and Firebase setup with Node.Js


Earlier, we created a React application with plain JavaScript; now we need to do the same with React and Firebase setup with using node. For this, we must have Node.js and npminstalled in our system; if not, first download the Node.js from https://nodejs.org/en/download/. Once you are done with the installation, run the following command to ensure that node and npm are installed properly:

For node, use this:

node -v

For npm, use the following:

npm -v

The output of the command should be as follows:

Now we need to install the create-react-app module, which provides the initial and default setup, and gives us a quick start to the React app. Run the following command in your CMD, and it will install the create-react-app module globally (that is, with -g or --global appended to the command):

npm install -g create-react-app
or 
npm i -g create-react-app

Once the installation is done, run the next command in your local directory where we need to create a project; that...