Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update readme with firebase functions setup #848

Merged
merged 1 commit into from
Aug 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading