Skip to content

Local Development Environment

Setting Up WSL (Windows users only)

WSL allows you to effortlessly incorporate a Linux environment into your Windows operating system. This method empowers developers to leverage the robust development tools of Linux while remaining within their Windows ecosystem. For the installation instructions of WSL, please refer to the following links:

Setting Up GitHub project repository

Connecting to GitHub with SSH

For an enhanced method of authentication when interacting with GitHub repositories, employing an SSH key is highly advisable, as opposed to the less secure username and password authentication. For detailed instructions, refer to the GitHub documentation:

Cloning Repository

To clone a repository using SSH and set up essential Git configurations, you can execute the following shell commands:

1
2
3
4
5
# Clone the repository via SSH
git clone git@github.com:bcgov/platform-services-registry.git

# Change into the cloned repository directory
cd platform-services-registry

GPG key signing

To ensure the legitimacy of Git commits, it is strongly recommended to sign them using a GPG key. For step-by-step guidance, please consult the GitHub documentation:

To enable GPG signing in Git, follow these steps in the repository:

1
2
3
4
5
6
7
8
9
# Define the signing key hash
git config user.signingkey "<hash>"

# Specify Git to sign commits and tags with GPG
git config commit.gpgsign true
git config tag.gpgsign true

# Set the GPG program for signing (if not already set)
git config gpg.program gpg

Setting up the local development tools

  • Using Linux or MacOS terminals is advised for the development of web applications and managing their pipelines.
  • asdf is a tool to manage the required packages with specific versions.
  • All the packages are defined in tool-versions.

Installation

  1. Install asdf according to the asdf installation guide.
    • https://asdf-vm.com/guide/getting-started.html#getting-started
  2. Install asdf packages defined in .tool-versions.
    1
    2
    3
    4
    5
    cat .tool-versions | cut -f 1 -d ' ' | xargs -n 1 asdf plugin-add || true
    asdf plugin-add docker-compose https://github.com/virtualstaticvoid/asdf-docker-compose.git || true
    asdf plugin-update --all
    asdf install
    asdf reshim
    
  3. Confirm the packages installed.
    asdf current
    
  4. Install python packages.
    pip install -r requirements.txt
    
  5. Install the pre-commit script.
    pre-commit install
    pre-commit install --hook-type commit-msg
    

Environment variables

In the /app directory, copy .env.example to create two new files: .env.local for local development and .env.test for testing. Make sure both files are placed in the root of the /app directory so the application can load them as needed.