Skip to content

Development

devinleighsmith edited this page Mar 30, 2022 · 30 revisions

Development

Development is currently supported through the use of Docker containers, and or local development with VS Code and Visual Studio 2019. Although any IDE that supports the languages should work.

Computer Setup

Install the following applications.

Windows

  • GitBash (recommended to use git bash when running make commands).
  • chocolately.
  • make with command choco install make. Tutorial Here for installing make and updating your PATH.
  • dotnet cli and dotnet 6 sdk

MacOS

  • Homebrew
  • coreutils with command brew install coreutils.

Initial Setup

  1. Create a fork of the repository https:/bcgov/pims.

  2. Clone the forked branch you want work on. If using Docker, ensure you are using a local (not network) drive.

    git clone https:/[username]/bcgov/pims
  3. Generate the .env files required to run the solution. You will be prompted for usernames, pick ones of your choosing. After generating the files, you may edit the randomly generated password (it's used in multiple .env files).

    ./scripts/gen-env-files.sh
  4. Configure Docker Desktop

    • General > "Use WSL 2 based engine": needs to be unchecked
    • Resources > File Sharing: add /path/to/PIMS, click "Apply & Restart"
  5. Configure Keycloak. This requires logging into Keycloak and updating your .env files with the correct client secret.

    docker-compose up -d keycloak

    Login to the Keycloak Administration Console with your username and password (found in /auth/keycloak/.env). It can take a moment for it to connect, it may not load right away.

    http://localhost:8080

    In Keycloak: Configure > Clients > pims-service-account, copy Credentials > Secret and update all your .env files with the client secret.

    /backend/api/.env - Keycloak__ServiceAccount__Secret={client secret}

    /tools/keycloak/sync/.env - Auth__Keycloak__Secret={client secret}

  6. Setup your local development container environment. This will require installing .NET Core CLI

  7. Once running you can now start using the solution - http://localhost:3000

    For git developer workflow instructions, see GitHub Workflow.

Make Scripts

To simplify development once the initial setup is complete, you can use the make commands.

make help
Clone this wiki locally