# Setup This will walk you through all the prerequisites needed to develop software at FSH. This guide assumes you're on a Macbook. ```{note} All code snippets are assumed to be run from a terminal (e.g. the default terminal.app) ``` ## Development environment setup We use a few tools to develop at FSH. First, install [homebrew](https://brew.sh/). ```bash /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ``` Then, install a set of packages via homebrew. ```bash brew upgrade brew install uv postgresql@18 opa ``` This installs: - [UV](https://docs.astral.sh/uv/) - [PostgreSQL](https://www.postgresql.org/) - [OPA](https://www.openpolicyagent.org/) Next, we need to install [node](https://nodejs.org/en): ```bash brew install nvm echo 'export NVM_DIR="$HOME/.nvm"' >> ~/.bashrc echo '[ -s "$(brew --prefix nvm)/nvm.sh" ] && \. "$(brew --prefix nvm)/nvm.sh"' >> ~/.bashrc echo '[ -s "$(brew --prefix nvm)/etc/bash_completion.d/nvm" ] && \. "$(brew --prefix nvm)/etc/bash_completion.d/nvm"' >> ~/.bashrc source ~/.bashrc ``` This sets up [`nvm`](https://www.nvmnode.com/), and configures your shell to invoke `nvm` appropriately. If you use `zsh` instead of `bash`, you should replace `.bashrc` with `.zshrc`. Finally, we need to install [`yarn`](https://yarnpkg.com/getting-started/install). ```bash npm install -g corepack ``` ## Github You should be a member of the [FSHTech](https://github.com/fshtech) GitHub organization. You can test this by visiting a [private](https://github.com/FSHTech/cli) repository. Once that is setup, you will need to authenticate your machine against GitHhub. [This](https://jdblischak.github.io/2014-09-18-chicago/novice/git/05-sshkeys.html) is a good tutorial. In short, you'll need to add a public key from your local machine to Github. This allows requests you make of Github to be validated. ## FSH CLI Many FSH development workflows are automated through the use of the `fsh` CLI. [Installation instructions](https://github.com/FSHTech/cli#install). Once you have `fsh`, attempt running `fsh packages login` -- this will confirm that you can access the private FSH package registries. ## `just-pm` FSH uses a piece of sofftware called [just](https://github.com/casey/just) as a declarative command runner. `just` ships with no native package manager. So, we [built one](https://github.com/FSHTech/just-package-manager). To install it, please follow [these](https://github.com/FSHTech/just-package-manager#install) instructions. Running `just-pm` post installation should give you something that looks like this: ```bash ╭─rodda@pop-os ~ ╰─$ just-pm Usage: just-pm [OPTIONS] COMMAND [ARGS]... A package manager for `just` modules — fetch and vendor shared modules from git. ╭─ Options ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ --directory -C DIR Run as if started in this directory. │ │ --version Show version and exit. │ │ --help Show this message and exit. │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─ Commands ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ sync Fetch + vendor modules and regenerate .just/modules.just. │ │ upgrade Bump version-tag revs in just.toml to the newest remote tag and sync. │ │ verify Hash-check the vendored content against the lockfile (no network). │ │ clean Remove the generated .just/vendor/ and .just/modules.just. │ │ update Update just-pm itself to the latest release. │ │ add Append a module to the manifest (just.toml). │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ```