Skip to content

Commit

Permalink
update readme with firebase functions setup
Browse files Browse the repository at this point in the history
  • Loading branch information
shivareddy6 committed Aug 3, 2023
1 parent 5b2a131 commit c24178f
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,24 @@ This will setup your project along with firebase emulator in a docker environmen
- This nickname is an internal, convenience identifier and is only visible to you in the Firebase console.
- Click Register app.
5. Copy the firebase configuration.
6. Paste the configuration `.env` file. **(this will be found in the project settings section of firebase cloud)**
7. You can find your `<FIREBASE_DATABASE_URL>` in the Realtime Database section of the Firebase console. Depending on the location of the database, the database URL will be in one of the following forms:
6. Follow the below steps to setup firebase functions
- Go to functions directory (`cd functions`) and install dependencies (`npm install`)
- Create a folder `private` inside functions directory
- Then you have to generate a private key file for your service account. Follow the below steps to get private key:
1. In the Firebase console, open Settings > Service Accounts.
2. Click Generate New Private Key, then confirm by clicking Generate Key.
3. Securely store the JSON file containing the key and rename it to `cl-dev-pk.json`
4. Move the `cl-dev-pk.json` to `Codelabz/functions/private`
7. Paste the configuration `.env` file. **(this will be found in the project settings section of firebase cloud)**
8. You can find your `<FIREBASE_DATABASE_URL>` in the Realtime Database section of the Firebase console. Depending on the location of the database, the database URL will be in one of the following forms:
- `https://DATABASE_NAME.firebaseio.com` **(for databases in us-central1)**
- `https://DATABASE_NAME.REGION.firebasedatabase.app`**(for databases in all other locations)**
8. You can get your `<FIREBASE_VAPID_KEY>` from Cloud-Messaging tab
9. You can get your `<FIREBASE_VAPID_KEY>` from Cloud-Messaging tab
- navigate to the setting of your project Open the Cloud Messaging tab.
- scroll to the Web configuration section.
- In the Web Push certificates tab, click Generate Key Pair. The console displays a notice that the key pair was generated. You get your Vapid key form there.
9. As you're using emulator, set `<USE_EMULATOR>` to "true"
10. You can get your `<CYPRESS_PROJECT_ID>` as cypress project id from [cypress cloud](https://cloud.cypress.io)
10. As you're using emulator, set `<USE_EMULATOR>` to "true"
11. You can get your `<CYPRESS_PROJECT_ID>` as cypress project id from [cypress cloud](https://cloud.cypress.io)

You should fill in these values in their relevant fields in the `.env` file.

Expand Down

0 comments on commit c24178f

Please sign in to comment.