CS 312 Software Development

Getting Started

In CS312 we will use a variety of software tools and online services. This semester, we will be using repl.it, which will provide us with a virtual platform in the cloud with a number of the tools we need already installed, but there are still some steps that you need to go through to get ready.

The Essentials

Browser

All of the modern browsers should work fine, however to ensure a common, multi-platform environment we will standardize on Firefox. While I won't police your browser use, I will expect your work to function in Firefox. I also spend more time using Firefox these days, so I am more familiar with the Firefox developer tools.

I also encourage you to install the Rect Development Tools extension in Firefox, which will allow you to inspect your React component hierarchies (including state and props).

Github

We will be making extensive use of Git and GitHub this semester, including using it for distributing assignment templates and assignment submission. If you have not already, please create a free GitHub account. Note that you can have multiple e-mail addresses associated with your account, e.g. you can add (and should) add your Middlebury e-mail address to an existing GitHub account.

Once your account is set up, request an education discount for your individual GitHub account (not as an organization). Doing so gives you free private repositories and will unlock free accounts at other services that integrate with GitHub (some of which we will use)!

repl.it

I will send out invitations to join the class "Team". If you do not already have an account, you will need to create one at this time. You are welcome to get a jump on this and create an account ahead of time to poke around a bit.

You will want repl.it to be connected to your GitHub account. You can do this by using 'Log in with GitHub' when you first join, or by connecting GitHub explicitly to your profile. To edit your profile, click on your username in the upper left and select 'Profile' from the drop-down menu. Then click 'edit your profile' on the upper right.

Heroku

We will deploy our applications to Heroku, a "platform-as-a-service" (PaaS). Please create a free Heroku account.

Travis CI

We will also use Travis CI for continuous integration (CI). https://travis-ci.com (the commercial side for private repositories) offers free accounts to students enrolled in GitHub's education program.

After you have successfully enrolled in GitHub's education program, sign-up for a free account at Travis CI.

Offline development (Optional)

repl.it is great in that it equalizes all of us so we are all running a single platform and requires very little setup from us. However, you may still want a local development environment if your Internet connection isn't great, or you just want to know how to run all of this locally.

Read the following instructions completely before starting, paying close attention to the version numbers when specified. You may have some of these tools already installed. Don't just copy-and-paste, some commands require modifications (e.g. with your e-mail address).

A note to Windows users, most of the core tools we are using should be available for Windows. Some of the ancillary tools, e.g. NVM, may not. Our various workflows and exercises will have been developed and tested on OSX and Linux, but not on windows. If you would like to work in a more tested environment, you could make use of VirtualBox or the Windows Subsystem for Linux to get a Linux distribution up and running on your machine.

A note to OSX users, many of these tools can be installed via Homebrew. If you are a current Homebrew user, keep an eye out for that install option. If you are not yet a Homebrew user, I recommend it. Homebrew is "package manager" for OSX that makes it easy to install (and remove) software (especially open-source CLI SW).

Editor

You will need a good programmers editor. There are a number of them out there, but I am going to suggest VSCode, which has a good combination of features, a lot of useful plugins, and runs on practically everything.

Git

  1. Make sure you have git installed. You likely already have Git installed (e.g. as part of OSX developer tools).

    As an aside, OSX users should install XCode Command Line tools (which includes compilers and other relevant tools like Git) if you don't already have XCode installed. You will likely need those tools in another class. This guide includes step-by-step instructions.

  2. If you haven't already, configure git with your name and e-mail

    git config --global user.name "your name"
    git config --global user.email "your email address"
    git config --global color.ui auto
    

    For example:

    git config --global user.name "Christopher Andrews"
    git config --global user.email "candrews@middlebury.edu"
    
  3. GitHub offers both SSH and HTTPS-based interfaces to your repository. SSH requires you to set up a public-key. See GitHub's help page for more information on these two options.

Node.js

Node.js is a stand-alone JavaScript engine that can be used to execute JavaScript outside the browser, either locally on your computer or on a "backend" server (i.e. "full-stack" JavaScript). repl.it appears to be using v12.16.1, so for the purposes of this class, you should stick to that. It will be important that you get this version and not use an older version you may happen to have (which may be missing features) or the latest, cutting edge version (which may have changed some features, and has certainly added some). The "Long Term Support" (LTS) version is probably safe, though it is now at 14.15.5. You certainly do not want the "Current" version. which is the bleeding edge version.

There are many ways to install Node, but the best way is to use a tool that will allow you to easily migrate between versions. The recommended approach is to use nvm on OSX or Linux and chocolatey on Windows. https://nodejs.dev/ has the short version of the commands you need to run to install node (and the OSX and Linux instructions also include the commands for installing nvm at the same time.)

The default setup for NVM is to invoke the nvm.sh setup script whenever a new shell starts. Doing so takes a few seconds, and depending on how often you create a new shell that delay might be annoying. If you find yourself bothered by the delay, and are comfortable at the command line, you can modify your .bashrc (or .bash_profile) with the following (test the default setup first -- I no longer need the following):

Replace the following lines in your .bashrc (and any others, e.g. bash completion, added by NVM installation):

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm

with:

# lazy loading nvm
setup_nvm() {
  unset -f node
  unset -f npm
  unset -f nvm
  unset -f npx
  export NVM_DIR="$HOME/.nvm"
  [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
}

node() {
  setup_nvm
  node "$@"
}

npm() {
  setup_nvm
  npm "$@"
}

npx() {
  setup_nvm
  npx "$@"
}

nvm() {
  setup_nvm
  nvm "$@"
}

This lazily loads NVM whenever you use nvm, or the Node.js tools (node, npm and npx). Note that you may need to modify the above if you install NVM via Homebrew or another package manager. Specifically if you use Homebrew, you will likely need to replace [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" with source "$(brew --prefix nvm)/nvm.sh".

Users on all platform should configure npm, the Node.js package manager, distributed as part of the Node.js installation (replacing email address with your e-mail address, etc.) with their information:

npm set init.author.email "email address"
npm set init.author.name "name"
npm set init.license "Apache-2.0"

SQLite

  1. Install the sqlite-tools for your platform to obtain the sqlite3 CLI for SQLite. Note that this tool is typically already installed as part of MacOS. This tool is not needed until the second half of the class, the absence of SQLite will not prevent you from completing the programming assignments in the first half of the course.

Heroku

  1. Install the Heroku CLI tools.

Last updated 02/18/2021