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

Setting up Firebase Admin SDK


For using Firebase Admin SDK, we'll need a Firebase project where we have service account to communicate with the Firebase services and a configuration file that includes the service account's credentials.

To configure the Firebase Admin SDK, follow these steps:

  1. Log in to Firebase Console, select the <project_name>project, and click on the setting icon in Project Overview:

Overview tab

  1. Go to the Service Accounts tab inside Project Settings.
  2. Click on the GENERATE PRIVATE KEY button at the bottom of Firebase admin section; it will generate the JSON file that contains the service account credentials:

Note

This JSON file contains very sensitive information about your service account and private encryption key. So never share and store it in a public repository; keep it confidential. If we lose this file because of any reason then, we can generate it again, and we'll no longer access Firebase Admin SDK with the old file.

Firebase CLI

Firebase provides a command-line...