# Software Requirements

**The setup for local development environment assumes you are running the latest version of MacOS**

## Install Software Requirements

### Prerequisite

Please do the following steps in order. We are assuming that this is a fresh installation of the newest MacOS operating system.

#### Brief Introduction to Terminal.app (Bash shells)

We also assume the user can find and run a [Bash shell](https://en.wikipedia.org/wiki/Bash_\(Unix_shell\)). To do so in MacOS, find the default terminal emulate known as [Terminal.app](https://en.wikipedia.org/wiki/Terminal_\(macOS\)). It can be located at:

{% code title="Terminal.app" %}

```bash
/Applications/Utilities/Terminal.app
```

{% endcode %}

Please open the `Terminal.app` or an equivalent terminal emulator when this guide prompts to run commands!

### Update MacOS

Wither you have fresh install of an operating system or not, it is always important to check for updates! Thankfully there is a built in tool which we can run from on a command line to check for and install operating system level updates.

```bash
/usr/sbin/softwareupdate -ia
```

While this can also be done manually through the MacOS App Store, it is typically preferred to operate through the command line as much as possible!

### Install Xcode Command Line Tools

We must next install the Xcode Command Line Tools. We no longer have to install `Xcode` (the defacto MacOS programming tool) to get the bundled utilities! We need the Xcode Command Line Tools later in our development and deployment cycle. The main use is to build C modules, which we could not do without this.

```bash
xcode-select --install
```

### Install brew

Next up is installing the missing package manager for MacOS. Most \*unix based operating system's have a built in command line tool to install, remove, and update software. Unforunately MacOS does not :\[

Thankfully a great engineer named [Max Howell](https://mxcl.github.io/) started the project (shout-outs to the rest of the contributors as well) and it has turned into the defacto package manager. [Brew](https://brew.sh/) will allow us to install most, if not all, of our other required software packages painlessly!

To install `brew` run the following:&#x20;

```bash
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
```

Then let `brew` check that it is installed properly:

```bash
brew doctor
```

### Install git and Configure SSH Keys

```
brew install git
```

#### Create a new SSH Key:

```
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
Enter a file in which to save the key (/Users/you/.ssh/id_rsa): [Press enter]
Enter passphrase (empty for no passphrase): [Type a passphrase]
Enter same passphrase again: [Type passphrase again]
```

#### Ensure the SSH Agent is running:

```
eval "$(ssh-agent -s)"
```

#### Update Your SSH Config:

Open and edit your SSH config at \~/.ssh/config to contain the following:

```
Host *
 AddKeysToAgent yes
 UseKeychain yes
 IdentityFile ~/.ssh/id_rsa
```

#### Add your SSH Key to your keychain:

```
ssh-add -K ~/.ssh/id_rsa
```

#### Add Your New SSH Key to GitHub:

```
curl -u "<USERNAME>" --data "{\"title\":\"<KEY NAME>\",\"key\":\"`cat ~/.ssh/id_rsa.pub`\"}" https://api.github.com/user/keys
```

### Install iTerm2

```
brew cask install iterm2
```

### Install SublimeText 3

```
brew cask install sublime-text
sudo ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl
```

### Install Pipenv

```
brew install pipenv
```

### Install Yarn

```
brew install yarn
```

### Install OpenSSL (Upgrade)

### Upgrade Pip and Pip3

###

### Install Postgres

{% embed url="<https://postgresapp.com/>" %}

```
sudo mkdir -p /etc/paths.d && 
echo /Applications/Postgres.app/Contents/Versions/latest/bin | sudo tee /etc/paths.d/postgresapp
```

## Optional Software Requirements

The following is a set of tools that are not required to build our project but are tools I recommend to all engineers!

### Install FireFox Nightly

As a firm believer in moving people away from Google Chrome(bot) I will push engineers to try out the blazing fast [Firefox Nightly](https://www.mozilla.org/en-US/firefox/62.0a1/releasenotes/). It comes bundles with tons of new features, many of which are essential in web development workflow.

```bash
brew cask install firefox-nightly
```

Copyright Dylan Stein - 2018
