Book Image

Hands-on Full Stack Development with Angular 5 and Firebase

By : Uttam Agarwal
Book Image

Hands-on Full Stack Development with Angular 5 and Firebase

By: Uttam Agarwal

Overview of this book

<p>This book is a complete package for you to build real-time web applications. You will build an end-to-end social networking web application from development to production with Angular as the frontend and Firebase as the backend.</p> <p>You will create an application called Friends with authentication, friends, and chat features. During the process, you’ll use Firebase authentication to register new users and Firebase database to store your extra user data. You’ll take a look at how to store and retrieve your user's images from Firebase storage. Then, you’ll create a real-time chat module with the Firebase database. Next, you’ll secure your database using Firebase security, make your application live with Firebase hosting, and develop your application with analytics.</p> <p>Moving on, you’ll take a look at how to create web pages using bootstrap with HTML, CSS, and TypeScript. You will use the angularfire2 library API in Angular services to interact with Firebase and write unit tests using the Jasmine framework that will help you to write a production-ready application. You’ll also discover various debugging techniques to troubleshoot any bug in your application. Finally, you’ll make your application Progressive Web Applications compliant.</p> <p>By the end of this book, you’ll be able to confidently build any complex application.</p>
Table of Contents (20 chapters)
Title Page
Packt Upsell
Contributors
Preface
Index

Chapter 12. Firebase Security and Hosting

Firebase provides flexible security rules with a JavaScript-like syntax, as this helps to structure our data and index the frequently used data. Security rules are integrated with Firebase authentication, which helps to define read and write access based on the user. In this chapter, we will add security rules for users and chat nodes to our Firebase database. Firebase security rules provide a nice simulator to check new rules before releasing them into production. We will also index our user's and their friends data for faster queries. Finally, we will deploy our application to the Firebase server. We will set up a different deployment environment so that we can test our application in the staging server and then deploy the application to the production server.

In this chapter, we will cover the following topics:

  • Introducing Firebase security 
  • Adding security rules for users
  • Adding security rules for chat messages
  • Indexing users and their friends
  • Setting...