Introduction To Firebase

Introduction

 
In this article, we are going to see how to set up a real-time database in Firebase.
 
Firebase is a platform provided by Google for building the backend for web and mobile apps. It is categorized as a backend-as-a-service (BaaS) which gives developers the opportunity to create applications without the hassle of setting up the backend.
 
It also provides multiple platforms in iOS, Android and JavaScript.
 

What is Firebase?

 
Firebase is a technology that allows us to create web applications without server-side-programming, making development faster and easier. It can control data without thinking about how data is stored and synchronized across different instances of the application in real-time.
 
It is a mobile platform from google offering a number of different features. These features allowing users to save and retrieve data to e accessed from any device or browser.
 
Firebase is categorized as a NoSQL database program, which stores data in JSON documents.
 
Firebase provides a feature like:
  1. It is a fast, scalable and real-time database in the cloud 
  2. User Authentication
  3. Cloud Messaging
  4. Storage
  5. Analytics
Firebase Databases are real-time. As soon as we modify the data in the firebase database, it will reflect in the client app immediately without refreshing the page. It works with Android app OS apps and web apps.
 

How To Set Up a Firebase Project 

 
To set up a firebase project you just need to go to firebase.google.com.
 
Step 1
 
To start with Firebase, you must have a Google Account. You should sign in with your Google account.
 
Step 2
 
After logged in successfully, click on Firebase Console.
 
Step 3
 
Here you can see all the projects that you have created. Click on Add new Project.
 
Introduction To Firebase
 
Step 4
 
Give your project a name. I am giving the name “AngularCRUD” so that I can use this one later on. Click on continue.
 
Introduction To Firebase
 
Introduction To Firebase
 
Step 5
 
Choose Default account for Firebase, or if you want to create a separate account, then you can create it. 
 
Introduction To Firebase
 
Step 6
 
After selecting, click on Create Project.
 
Introduction To Firebase
 
Step 7
 
After finishing the setup, click on Continue.
 
Introduction To Firebase
 
Step 8
 
After finishing, you can see a project overview page of Firebase. Over there, click on "</>" to add Firebase in our web, you can choose iOS or Android.
 
Introduction To Firebase
 
Step 9
 
Now add Firebase to the web app. For that, we want to give a name. Here, I will use "Angular_crud" click on the ckeck box and register it . 
 
Introduction To Firebase
 
Step 10
 
Now add Firebase to the web app. For that, we want to give a name. Here, I will use "Angular_crud" click on the check box and register it. 
 
Introduction To Firebase

Step 11
 
You can see our Angular CRUD is showing in our Angular CRUD project. Also, you can see the features provided by Firebase, such as
Authentication, Database, Storage, Hosting, etc. For this article, we will see its database creation, so click on the Database menu on the left side of it.
 
Introduction To Firebase
 
Step 12
 
Click on the Database menu on the left side of the Firebase. Then the database screen will pop up.
 
Introduction To Firebase
 
Step 13
 
If you want to create Cloud Firestore, then Go to Cloud Firestore and click on Create Database. 
 
Introduction To Firebase
 
Step 14
 
Then the security rules for the Cloud Firestore screen will appear, click on 'Start in test Mode'. Enable it, and then we can see the Cloud Firestore screen over there collections of records are there.
 
Introduction To Firebase
 
Step 15
 
If you want to create a Realtime Database, go to real database and click on it.
 
Introduction To Firebase
 
Step 16
 
The below image shows some security rules which I will select to start in test mode so that it will allow us to read and write to our database. 
 
Introduction To Firebase
 
Step 17
 
Now we have successfully created the realtime database, as you can see it in the below image. 
 
Introduction To Firebase
 
Step 18
 
We can add in the collection as a name-value pair as shown in the below image. 
 
Introduction To Firebase
 

Summary

 
In this article, we have seen how to set up a real-time database in Firebase. In my next article, we will learn about CRUD operations using Angular 9 with Firebase. 


Similar Articles