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

fix: add firebase service account key to env variable #204

Merged
merged 2 commits into from
Aug 5, 2023

Conversation

evan-desu
Copy link
Contributor

@evan-desu evan-desu commented Aug 3, 2023

Prior to this change, a new developer starting server would get an error message saying private key is missing. Installed dotenv to handle environment variables in the code. Updated README with instructions on how to get a private key from firebase and how to add it to the local env file.

Resolves #198

What changed

  1. Added dotenv package to load environment variables into process.env.
  2. Added firebaseServiceAccountKey.json to gitignore to keep private_key private.
  3. Removed unused imports from database.ts.
  4. Changed credentials variable to point to firebaseServiceAccountKey.json.
  5. Added instructions to README for setting up Firebase Service Account.

Testing instructions

  1. Run yarn install to update dependencies.
  2. Make sure to have a private key file generated by Google Firestore.
  3. Add the file to root directory and rename to firebaseServiceAccountKey.json.
  4. Create an environment variable inside of .env by adding the line SERVICE_ACCOUNT_PATH=./firebaseServiceAccountKey.json.
  5. Run yarn dev and confirm server is working.

Prior to this change, a new developer starting server would get an error message saying private key is missing. Installed dotenv to handle environment variables in the code. Updated README with instructions on how to get a private key from firebase and how to add it to the local env file.
@evan-desu evan-desu marked this pull request as ready for review August 4, 2023 01:37
Copy link
Collaborator

@theyokohamalife theyokohamalife left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! (Looks good to me)

Thank you!!

@theyokohamalife theyokohamalife merged commit f0f7646 into main Aug 5, 2023
5 checks passed
@theyokohamalife theyokohamalife deleted the evan-feat-credential-fix branch August 5, 2023 10:57
@ourjapanlife ourjapanlife deleted a comment from allcontributors bot Aug 24, 2023
@ourjapanlife ourjapanlife deleted a comment from allcontributors bot Aug 24, 2023
@ourjapanlife ourjapanlife deleted a comment from allcontributors bot Aug 24, 2023
@theyokohamalife
Copy link
Collaborator

@all-contributors please add @evan-desu for code

@allcontributors
Copy link

@theyokohamalife

We had trouble processing your request. Please try again later.

ermish pushed a commit that referenced this pull request Aug 28, 2023
* fix: add firebase service account key to env variable

Prior to this change, a new developer starting server would get an error message saying private key is missing. Installed dotenv to handle environment variables in the code. Updated README with instructions on how to get a private key from firebase and how to add it to the local env file.

* docs: Add instructions for setting up Firebase Service Account
theyokohamalife added a commit that referenced this pull request Aug 29, 2023
* progress

* fix(deps): update dependency firebase-admin to v11.6.0 (#182)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* got build and queries working again! (#181)

* fix(deps): update dependency csv-parse to v5.3.8 (#183)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Philip Ermish <[email protected]>

* chore(deps): update yarn to v3.5.1 (#190)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Philip Ermish <[email protected]>

* fix(deps): update dependency @apollo/server to v4.7.0 (#185)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency eslint to v8.40.0 (#179)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: LaShawn Toyoda <[email protected]>

* chore(deps): update dependency firebase-tools to v11.28.0 (#184)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: LaShawn Toyoda <[email protected]>

* fix(deps): update dependency firebase to v9.22.0 (#186)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: LaShawn Toyoda <[email protected]>

* chore(deps): update typescript-eslint monorepo to v5.62.0 (#187)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency @types/chai to v4.3.5 (#188)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency all-contributors-cli to v6.26.1 (#189)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update dependency csv-parse to v5.4.0 (#193)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix: add firebase service account key to env variable (#204)

* fix: add firebase service account key to env variable

Prior to this change, a new developer starting server would get an error message saying private key is missing. Installed dotenv to handle environment variables in the code. Updated README with instructions on how to get a private key from firebase and how to add it to the local env file.

* docs: Add instructions for setting up Firebase Service Account

* chore(deps): update graphqlcodegenerator monorepo to v4 (#194)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency node to v18.17.0 (#197)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update dependency firebase to v10 (#210)

* chore(deps): update dependency firebase-tools to v12 (#192)

* feat: add Submission type and input (#208)

The reason for this change is to allow users to submit incomplete information to be reviewed by moderators prior to being searchable on the website

* feat: add mutations for addFacility and addHealthcareProfessional (#203)

* feat: implement mutation for addFacility

* feat: implement mutation for addHealthcareProfessional

* refactor: fix healthcareProfessionalService types

* refactor: fix types and move function

* chore(deps): update reviewdog/action-eslint action to v1.19.2 (#205)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Remove codeowners until the repo goes public (#228)

* chore: set renovate confidence to high (#215)

Co-authored-by: Philip Ermish <[email protected]>

* Refactor FacilityService and HealthcareProfessionalService (#223)

* chore: update healthcareProfessional service

* feat: add new Facility with HealthcareProfessional Ids

* refactor: clean up imports

* feat: add the isDeleted field to Facility and HealthcareProfessional

* chore(deps): update node.js to v18.17.1 (#216)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: LaShawn Toyoda <[email protected]>

* chore(deps): update dependency @graphql-codegen/cli to v5 (#217)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: LaShawn Toyoda <[email protected]>

* 👥 Add @evan-desu as a contributor (#231)

* feat: add a submissionService file and Submission type definitions (#213)

Previously there were no service functions to allow users to get, add, or update submissions. There are now functions to perform these tasks. There is now also a Submission type alias in TypeDefs/dbschema.ts

* feat: add a submissionService file and Submission type definitions (#218)

* feat: implement end-to-end testing with Jest and Supertest (#227)

* feat: implement end-to-end testing with Jest and Supertest

Prior to this commit the tests that were in place were legacy tests for when our tech stack included Prisma and Postgres. Now that we're using Firestore they're no longer needed.

* feat: add GitHub action to run tests

* feat: add mock firebase config for jest

Co-authored-by: Anissa Chadouli [email protected]

* docs: update testing instructions

* test: happy path is successful

* refactor: separate env variables for dev and prod

Co-authored-by: Philip Ermish <[email protected]>

* chore: fix docker in github actions

Co-authored-by: Philip Ermish <[email protected]>

* chore: fix docker in github actions

Co-authored-by: Philip Ermish <[email protected]>

* chore: fix yarn path

Co-authored-by: Philip Ermish <[email protected]>

* chore: check in dev and prod env

Co-authored-by: Philip Ermish <[email protected]>

* Update README.md

* Update __tests__/server.test.ts

* Update src/index.ts

---------

Co-authored-by: Philip Ermish <[email protected]>

* upgraded to node 20 and relevant packages

* got build working!

* merge fixes. build works again

* commenting out in progress workflows

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: LaShawn Toyoda <[email protected]>
Co-authored-by: Evan Peterson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing credentials for Firestore
2 participants