/Portal-API

An API dedicated to the what's new feature

Primary LanguageC#MIT LicenseMIT

Portal API

An API dedicated to the portal API.

Setup for DEV ⛵ or PROD 🚀

  • 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

Setup for local 🏗️

There is two way to setup a local environment project.

Remote firebase

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:

  1. Create an authentication method in your firebase console.

    1. Go to Authentication page.
    2. Go to the tab Sign-in method.

    image

    1. Click on email/password and click on the checkbox before saving it.

    image

  2. Create a new cloud firestore project.

    1. Go to Firestore Database page.
    2. Click on Create new database.

    image

    1. Choose production mode.

    image

    1. Choose the nearest region possible (us-east1 is a possible good candidate).

    image

    1. Click on Create.
  3. Generate your admin sdk token.

    1. Go to Project Settings page.
    2. Go to Service Accounts tab.

    image

    1. Click on Generate new private key.

    image

    1. download the key and save it to a file PortalApi/local/admin-sdk.json
  4. Get the project custom information.

    1. Go to Project Settings page in Global parameter tab.

    2. Save the following fields: Project id and API Web Key. image

    3. Create a file PortalApi/local/firebase-settings.json with the following content:

    {
      "FirebaseSettings": {
        "ProjectId": "/* insert ProjectId value here */",
        "ApiKey": "/* insert ApiKey value here */"
      }
    }

Local firebase instance

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.