This repository contains backend components and configuration of the JAC digital platform.
We have kept folder and file names closely aligned to the corresponding Firebase and Google Cloud services..
See database/firestore.rules for our Firestore database rules.
See database/realtime.rules.json for our Realtime Database rules.
See database/firestore.indexes.json for our current indexes.
See storage/storage.rules for our current rules.
See functions/backgroundFunctions for our functions which are triggered when defined events happen.
See functions/callableFunctions for our HTTPS callable functions.
See functions/scheduledFunctions for functions triggered according to a pre-defined schedule.
You must be running Node.js 10.
You can use nvm
or
Homebrew to manage installed Node.js versions.
You'll need the Firebase Command Line Interface (CLI) installed to interact with the staging and production projects on Firebase.
Install the Firebase CLI:
npm install -g firebase-tools
Then sign in with your Google account:
firebase login
Configure Firebase CLI to use the staging environment:
firebase use staging
Install dependencies for Cloud Functions:
cd functions
npm install
npx firebase deploy --project=digital-platform-develop --only functions:exportApplicationCharacterIssues
Deploy to staging using the Firebase CLI:
firebase deploy --project staging
You can also use CircleCI to deploy to staging.
Just prefix your branch name with staging-
and every new push will automatically deploy to staging.
You can also perform partial deployments to only update specific apps, Cloud Functions or Firebase services.
We use CircleCI to deploy to production.
Open a Pull Request to merge your code into the master
branch.
Once approved, merge your Pull Request and it'll be deployed to production automatically.
firebase emulators:start --only functions
firebase emulators:exec "npm run test:functions"