This document outlines the steps required to set up a development environment for Secret Project 331 on Linux, Windows, and macOS. Note that we use Linux for development at the University of Helsinki, so it may offer the best support and compatibility.
Note: After installing all required tools, run bin/print-versions
to confirm that dependencies are correctly installed.
Install the following tools to manage the development environment:
Install these packages on your Linux system:
Optional utilities:
Other essential commands required by scripts (bc
, find
, jq
, rsync
, sponge
):
# Ubuntu
sudo apt install bc find jq rsync moreutils
# Arch Linux
sudo pacman -Syu bc find jq rsync moreutils
- Install Rust.
- Install
sqlx-cli
:cargo install sqlx-cli --no-default-features --features rustls,postgres
- Install OpenSSL (
libssl-dev
on Ubuntu,openssl-devel
on Fedora). - Install
pkg-config
andoxipng
:cargo install oxipng # or sudo pacman -S oxipng on Arch
DevOps Tools
- Install Chocolatey.
- Use Chocolatey to install the required packages:
choco install kubernetes-cli minikube postgresql kustomize skaffold stern kubectx
- Install Rust.
- Install
sqlx-cli
andoxipng
:cargo install sqlx-cli --no-default-features --features rustls,postgres cargo install oxipng
-
Install Windows Terminal.
-
Install Cygwin, ensuring you include the
postgres-client
andprocps-ng
packages. -
To add Cygwin as a profile in Windows Terminal, include the following in your Windows Terminal settings:
{ "guid": "{00000000-0000-0000-0000-000000000001}", "commandline": "C:/cygwin64/Cygwin.bat", "icon": "C:/cygwin64/Cygwin-Terminal.ico", "hidden": false, "name": "Cygwin" }
-
Install Shell Launcher in VSCode.
-
In your
settings.json
, add the following to use Cygwin as a terminal shell:"shellLauncher.shells.windows": [ { "shell": "C:\\cygwin64\\bin\\bash.exe", "args": ["--login"], "label": "Cygwin Bash" } ]
-
Use
Ctrl+Shift+T
in VSCode to launch a Cygwin terminal.
Install Homebrew if not already installed, then use it to install the required packages:
brew install skaffold [email protected] minikube kustomize docker postgresql actionlint
Additional utilities:
brew install bc jq rsync sponge coreutils kubectx stern
- Install Rust.
- Install
sqlx-cli
:cargo install sqlx-cli --no-default-features --features rustls,postgres
- Install OpenSSL,
pkg-config
, andoxipng
:brew install openssl@3 pkg-config cargo install oxipng
In the root directory, install the project dependencies:
nvm install
nvm use
npm ci
bin/npm-ci-all
Make sure TMC-Langs
is downloaded:
bin/download-tmc-langs
Next, copy the shared module contents:
bin/copy-and-check-shared-module
Set up the environment variables for headless-lms
:
cp services/headless-lms/models/.env.example services/headless-lms/models/.env
Before running Minikube, check for any setup issues:
bin/detect-dev-env-problems
To start Minikube, use:
bin/minikube-start
Retrieve the Minikube IP address:
minikube ip
Add this IP to your /etc/hosts
file:
<minikube-ip> project-331.local
Use the Minikube IP obtained from minikube ip
and add a hosts entry:
<minikube-ip> project-331.local
Hosts file location: C:\Windows\System32\drivers\etc\hosts
Similar to Linux, use minikube ip
to retrieve the IP, then add it to /etc/hosts
.
Ensure Minikube is running, then:
In the root of the repository:
bin/dev
Use Cygwin in Windows Terminal, navigate to the root of the repository:
bin/dev
In the root of the repository:
bin/dev
For efficient workflow, use a terminal with split-window support. Recommended options:
- Linux: Tilix
- Windows: Windows Terminal
- macOS: iTerm2
Verify your setup with:
bin/detect-dev-env-problems