Skip to content

Firebase/GCP configuration and components for our digital platform

Notifications You must be signed in to change notification settings

warrensearle/digital-platform

 
 

Repository files navigation

JAC Digital Platform

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..

Database

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.

Storage

See storage/storage.rules for our current rules.

Functions

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.

Local development

Node.js

You must be running Node.js 10.

You can use nvm or Homebrew to manage installed Node.js versions.

Firebase CLI

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 project dependencies

Install dependencies for Cloud Functions:

cd functions
npm install

Deploy a single function to develop

npx firebase deploy --project=digital-platform-develop --only functions:exportApplicationCharacterIssues

Deploy to staging

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.

Deploy to production

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.

Running an emulated firebase database locally

firebase emulators:start --only functions

Running a tests on an emulated firebase database locally

firebase emulators:exec "npm run test:functions"

About

Firebase/GCP configuration and components for our digital platform

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 99.4%
  • Other 0.6%