From the course: Building Production-Ready React Apps: Setup to Deployment with Firebase

Get started with the Cloud Firestore

- [Narrator] Now we are making our first steps with the Firebase services. Starting with the Cloud Firestore. The Cloud Firestore is a Cloud-hosted and document-oriented database. Before getting started with the Cloud Firestore, let's have a look at the data model first and then the supported data types. So the Cloud Firestore is a NoSQL, document-oriented database. It is different from the traditional SQL database with tables and rows. The unit of storage is what we call a document. So we use documents in order to store the data, which are then organized into collections. So a document is adjacent format with fields and values. So this is a collection, a set of key value pairs. So let's say that you'd like to save data about a user, to save user information. So you would specify a key for the first, another key for the last, and then define the value in order to indicate the information and the data of that user. So let's see how it works. In order to get started, so you should also have a few requirements. So this is already fulfilled from the previous part. So if you have successfully created a new project, so you are good to go. We're going to follow with the next steps, which is to then create a new Cloud Firestore. And during the process, you're going to set a location, and then you just need to click done. So this is a very easy process that I am showing you next. So for that we're going to go to the console, and then select our project, which is Firestock. So from here, so now you're going to go to the Firestore Database. So from here, from the top you can also select another project. So make sure that you are on the project that you have created for this demo. And then you can go ahead and create a new database. So for the purpose of this demonstration, we're going to select test mode. In another video, we're going to specify the security rules in order to restrict who can read from the database and who can write to the database. Then we're going to click "Next." For the region, you can select whichever you'd like. So I'm going to select a region which is in the Europe area. Location, London, and I'm going to click "Enable." And you can always refresh the page. So once this is done, you should see then that the interface has changed. So now you can see this interface, very user-friendly. In order to start in your collection, so this is very simple. You can simply click here, "Start a collection." Then you can name this one. So I'm going to name it very generically, "items." Then click "Next." And from here, you can set a new document. So by specifying a field and also the data types, and you have different data types that are supported with Cloud Firestore, so the string, number, boolean, and also an auto-generated date types. So we're not going to be doing that from the console. Actually, we're going to be doing that programmatically. So let's see next how to add store and synchronize data in our application with Cloud Firestore.

Contents