About
EcoSense Firebase Functions is a repository for codes run in Cloud Functions to enable role-based authentication and synchronize data to Cloud SQL.
Technologies
Dependencies
Production
@google-cloud/secret-manager
firebase-admin
firebase-functions
pg
Development
eslint
firebase-functions-test
typescript
Functions
addAdminRole
- Trigger: HTTP Request
addSuperAdminRole
- Trigger: HTTP Request
addUserRole
- Trigger: HTTP Request
removeAdminRole
- Trigger: HTTP Request
removeSuperAdminRole
- Trigger: HTTP Request
newUserSignUp
- Trigger:
user.create
- Trigger:
onUpdateUserDetail
- Trigger: HTTP Request
insertUserDataToDB
- Trigger: HTTP Request
userDeleted
- Trigger:
user.delete
- Trigger:
Deploy to Firebase Functions
- Make sure you have
firebase-tools
installed by runningnpm install -g firebase-tools
in terminal. - Go to /functions folder by typing
cd functions
in terminal. - Run
npm run deploy
or runfirebase deploy --only functions
. - Wait until Firebase finish deploying.
Run Locally using Firebase Emulator
- Make sure you have
firebase-tools
installed by runningnpm install -g firebase-tools
in terminal. - Go to /functions folder by typing
cd functions
in terminal. - Run
npm run serve
or runfirebase emulators:start --only functions
. - Call the functions to test them out.
2023 © EcoSense Indonesia.