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-toolsinstalled by runningnpm install -g firebase-toolsin terminal. - Go to /functions folder by typing
cd functionsin terminal. - Run
npm run deployor runfirebase deploy --only functions. - Wait until Firebase finish deploying.
Run Locally using Firebase Emulator
- Make sure you have
firebase-toolsinstalled by runningnpm install -g firebase-toolsin terminal. - Go to /functions folder by typing
cd functionsin terminal. - Run
npm run serveor runfirebase emulators:start --only functions. - Call the functions to test them out.
2023 © EcoSense Indonesia.