An API dedicated to the portal API.
- To access some features you will need the Firebase admin sdk, these files are encrypted. To decrypt them you will have to do two simple steps:
You need to ask an admin user to provide the dev password for encrypted files saved in the pasword manager, then run:
# Run this for dev environment
export ENCRYPTED_FIREBASE_DEV_PASSWORD="ABCDE12345";
# Or run this for prod environment
export ENCRYPTED_FIREBASE_PROD_PASSWORD="ABCDE12345";
# Then run:
scripts/decrypt.sh
There is two way to setup a local environment project.
In most case, you will want a remote firebase project. If you want more flexibility or want to develop without needing an internet connection, you can check this out.
Otherwise, follow these steps to create a new project in the firebase console:
-
Create an authentication method in your firebase console.
- Go to Authentication page.
- Go to the tab Sign-in method.
- Click on email/password and click on the checkbox before saving it.
-
Create a new cloud firestore project.
- Go to Firestore Database page.
- Click on Create new database.
- Choose production mode.
- Choose the nearest region possible (us-east1 is a possible good candidate).
- Click on Create.
-
Generate your admin sdk token.
- Go to Project Settings page.
- Go to Service Accounts tab.
- Click on Generate new private key.
- download the key and save it to a file
PortalApi/local/admin-sdk.json
-
Get the project custom information.
-
Go to Project Settings page in Global parameter tab.
-
Create a file
PortalApi/local/firebase-settings.json
with the following content:
{ "FirebaseSettings": { "ProjectId": "/* insert ProjectId value here */", "ApiKey": "/* insert ApiKey value here */" } }
-
You can use the firebase emulator to create a local firebase instance. follows these guidelines to setup a cloud firestore and a firbase authentication service.