Link with Firestore

Now we need to link the app with Firestore so we can easily deploy our indexes and rules

firebase init firestore

This command will prompt a few questions

  1. Select to use an existing project
  2. Select the recently created project my-app
  3. On What file should be used for Firestore Rules? press enter
  4. On File firestore.rules already exists. Do you want to overwrite press N
  5. On What file should be used for Firestore indexes? press enter
  6. On File firestore.indexes.json already exists. Do you want to overwrite press N

Then CLI should generate 2 new files .firebaserc and firebase.json containing specific firebase configs.

Deploy rules and indexes

Now we can safely deploy Chatness rules and indexes. These are going to be important for the seed step.

firebase deploy --only firestore:indexes,firestore:rules

Learn more about Firestore rules and Firestore indexes

Edit this page on GitHub Updated at Tue, Apr 26, 2022