Skip to content

Development Environment Setup Guide

Steven Simko edited this page Oct 5, 2021 · 7 revisions

Pre-Requisites

Git

What is Git?

Windows

Install Git on your system from here. You will probably want the 64-bit version.

Mac

Install Git on your mac here.

Linux

Install Git on your linux distribution here

Docker

WSL2 (Windows only)

You will need WSL2 installed on Windows 10 for Docker to work. WSL2 is the Windows Subsystem for Linux, allowing the linux kernel to run alongside Windows, so you can have the best of both worlds! Note that this doesn't actually modify your OS or boot, it just enables a feature built into Windows 10 :)

Docker for Windows

Install Docker Desktop for Windows here

Docker for Mac

Install Docker Desktop for Mac following the guide here

Downloading the repository

Once you've got all the software above installed, you will need to use Git to "clone" our codebase or repository. This will download the most recent version of our codebase and make a copy on your computer. Once you have Git installed, you should have the ability to use the "git" command in your command line. Note that depending on how you installed it on Windows, you may have to use Git bash, which can be easily accessed by right clicking inside a folder and choosing Git bash To clone the respository, navigate to where you want to store the codebase and enter the following command:

git clone https://github.com/UWCodeForce/student-net.git

Setting up the dev environment

Once you have cloned the repository, you should have a folder called 'student-net' where you downloaded the codebase to. Navigate inside that folder. cd student-net Inside of this folder, you will notice some files with the word "Docker" in them. You won't need to touch these to setup the environment, but just note where they are. Once you are in the folder with 'docker-compose.yml' you will need to run the command

docker-compose up -d

Which will tell Docker to setup a virtual instance of our development environment with the 'docker-compose.yml' configuration. The -d just tells docker to run detached, which means you will be able to keep it running without closing that terminal window. If you are having trouble, trying running without the -d argument in order to see what's going on.

That should be it! At this point you should hopefully be able to navigate to http://localhost:3000 and see the basic web server running!

Starting and Stopping the Development Environment

Starting docker

To start the docker container(s), navigate to the root of your repository (student-net) and run

docker-compose up -d

Stopping docker

To stop the containers, navigate to the root of your repository (student-net) and run

docker-compose stop

If for some reason you need to remove the containers created by student-net, run

docker-compose down