-
Notifications
You must be signed in to change notification settings - Fork 26
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.
Install the following applications.
-
GitBash (recommended to use git bash when running
makecommands). - 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
-
Create a fork of the repository https://github.com/bcgov/psp.
-
Clone the forked branch you want work on. If using Docker, ensure you are using a local (not network) drive.
git clone https://github.com/[username]/bcgov/psp
-
Generate the
.envfiles 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.envfiles).make env
Manually copy secrets into your /source/backend/api .env file as per https://confluence.th.gov.bc.ca/display/PIMS/Development+secrets
-
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)
-
Setup your local development container environment. This will require installing
.NET Core CLI. Follow the below commands for container environment setup.
make upIn order to show the running containers
docker psdocker-compose up databasedocker-compose up -d databaseIn order to start the MS SQL Server and to run the scripts .
docker logs psp-dbIn order to Seed the database with test data run
make db-seeddocker logs psp-dbdocker-compose up -d geoservercd tools/mayan-edms
docker-compose --profile all up -dNote: Make sure API_URL=http://localhost:5000/ found in /frontend/.env before running the solution.
-
Once running you can now start using the solution - http://localhost:3000
For git developer workflow instructions, see GitHub Workflow.
-
required make commands to start developing (assuming above steps already completed: make keycloak-sync
-
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. Next, manually start the frontend in your preferred development tool for React by running npm start, and then run the backend in your preferred development tool for .Net Core .
While there is no set list of "required" vscode extensions, the following are used by many team members and are helpful
- GitLens
- Jest/Jest runner + coverage gutters
- ESLint
- Prettier