-
Install Node with Node Version Manager:
- macOS, Linux, and WSL: https://github.com/nvm-sh/nvm
- WindowS: https://github.com/coreybutler/nvm-windows
After installing set your Node version to be "v12"
Note: On Windows you may have to be more specific than v12 and use the full latest version string (e.g. v12.18.3)
nvm install v12 nvm use v12
-
Setup GitHub Packages authentication
Copy
sample.npmrc
to.npmrc
and replace<YOUR_AUTH_TOKEN>
with a GitHub personal access token, you only need to allow theread:packages
permission. -
Install dependencies.
# Execute *in* the project directory. yarn install
-
Copy
sample.env
to.env
. -
Follow Firebase's instructions on generating a private key file here.
-
Once you have obtained your key file do not commit it to the repository.
-
Format the file so that it is a single line:
{ "type": "service_account", "project_id": "", "private_key_id": "", "private_key": "", "client_email": "", "client_id": "", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "token_uri": "https://oauth2.googleapis.com/token", "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "client_x509_cert_url": "" }
becomes...
{ "type": "service_account", "project_id": "", "private_key_id": "", "private_key": "", "client_email": "", "client_id": "", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "token_uri": "https://oauth2.googleapis.com/token", "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "client_x509_cert_url": "" }
... and replace
FIREBASE_CREDENTIALS
in.env
with this string. -
Replace
GOOGLE_CLOUD_PROJECT
andFIREBASE_PROJECT_ID
with your Firebase project's ID.Note:
GOOGLE_CLOUD_PROJECT
should matchFIREBASE_PROJECT_ID
unless you specifically changed it. And if you did that, you should know what it was changed to.
# Runs a development server!
yarn dev
yarn lint
Run the full test suite with coverage:
yarn test
Run the test suite without coverage:
yarn test:nocov
Run the test suite without the verbose flag set:
yarn test:quiet
# Build for production
yarn run build
# Run (like) production
yarn run serve
Project structure derived from Microsoft's TypeScript Node Starter Pack.