Skip to content

Create Database

GogoVega edited this page Oct 23, 2023 · 2 revisions

Follow the next steps to create a Firebase realtime database:

Build Project

Go to the Firebase website and click on Get started

Capture d’écran 2023-03-30 à 12 49 33

Enter a name for your project

Capture d’écran 2023-03-30 à 12 58 09

Disable Google Analytics then click on Create project

Capture d’écran 2023-03-30 à 12 58 48

Build Database

Click on Build then select Realtime Database

Capture d’écran 2023-03-30 à 13 03 26

Click on Create database

Capture d’écran 2023-03-30 à 13 03 40

Select your time zone (url depends on it)

Capture d’écran 2023-03-30 à 13 03 54

Select your default security rules

Capture d’écran 2023-03-30 à 13 04 31

Database Console

The console is an overview of your data, these are stored in the form of a JSON tree

Capture d’écran 2023-03-30 à 13 30 25

In red, you have the URL of your database (need for authentication) and in blue: you have the content of your database.

Database Rules

Firebase Security Rules provide robust, completely customizable protection for your data in Realtime Database.

Capture d’écran 2023-03-30 à 13 30 38

For example, this rule allows anyone to read a data set, but restricts the ability to create or modify data at a given path to the authenticated content owner only:

{
// Allow anyone to read data, but only authenticated content owners can
// make changes to their data

  "rules": {
    "some_path": {
      "$uid": {
        ".read": true,
        // or ".read": "auth.uid !== null" for only authenticated users
        ".write": "auth.uid === $uid"
      }
    }
  }
}

Read more about Security Rules.

Next Step

Clone this wiki locally