Skip to content

Development

devinleighsmith edited this page Dec 16, 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
  • npm (nvm recommended)
  • github cli

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

Manually copy secrets into your /source/backend/api .env file as per https://confluence.th.gov.bc.ca/display/PIMS/Development+secrets

  1. Configure Docker Desktop

    • General > "Use WSL 2 based engine": needs to be unchecked
    • Resources > File Sharing: add /path/to/PIMS, click "Apply & Restart"
    • Recommend setting a .wslconfig in your users folder to limit docker ram usage (recommend at least 8gb of ram, or 10gb for faster map loading)
  2. Setup your local development container environment. This will require installing .NET Core CLI . Follow the below commands for container environment setup.

make start up

In order to show the running containers

docker ps
docker-compose up database
docker-compose up -d database

In order to start the MS SQL Server and to run the scripts .

docker logs psp-db

In order to Seed the database with test data run

make db-seed
docker logs psp-db
docker-compose up -d geoserver
cd tools/mayan-edms
docker-compose --profile all up -d

Note: Make sure API_URL=http://localhost:5000/ found in /frontend/.env before running the solution.

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

    For git developer workflow instructions, see GitHub Workflow.

  2. required make commands to start developing (assuming above steps already completed: make keycloak-sync

  3. The majority of the team does not use the frontend or backend docker containers for day-to-day development. Preferring to use node and dotnet to run the frontend and backend directly. To do this, manually stop the containers for the backend and frontend.

Clone this wiki locally