This guide assumes you want to use a virtual machine instead of messing around in your host operative system, it is especially useful if you are using a windows computer.
But the same dependecies are required regardless of what OS you are using so the instructions here should be somewhat relevant anyway.
Download virtualbox for your current OS https://www.virtualbox.org/wiki/Downloads
Download the latest Ubuntu LTS .iso image from https://ubuntu.com/download/desktop
Now create a new virtual machine and install ubuntu, google if you need futher instructions.
First lets update the machine.
$ sudo apt update
$ sudo apt upgrade
The machine might need a restart after this.
The machine is missing some of our dependencies so let's install them.
$ sudo apt install git
Go to https://code.visualstudio.com/docs/setup/linux and download the .deb package install it via the command
$ cd ~/Downloads && sudo apt install ./<file>.deb
Now you should be able to search for and open vscode in your VM.
The frontend part of SpeakIT is built with yarn, the easiest way to install is via the node pakcage manager, so install npm first using:
$ sudo apt install npm
Ather this we can install yarn with npm
$ sudo npm install --global yarn
The backend is built with go so lets install go with the instructions at https://golang.org/doc/install
$ sudo tar -C /usr/local -xzf go1.16.4.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin
From your terminal run the following command $ source ~/.profile
Now $ go version
should return the version you just installed
SpeakIT can also use docker and docker-compose for development so lets install them.
$ sudo apt install docker-compose
First we need to set a GOPATH variable, e.g. you could set it in a directory called go
in your home directory:
$ cd ~
$ mkdir go
Now set the variable in your .profile by adding the following line
export GOPATH=~/go
And run the following command:
$ source ~/.profile
Now we clone our repo into our GOPATH-directory
$ git clone https://github.com/cthit/speakIT $GOPATH/src/github.com/cthit/speakIT
Since SpeakIT started before go modules you need to modify go to be able to build
the backend without complaining. This can be done with the following command.
$ go env -w GO111MODULE=auto
Now run the following the download the rest of the dependencies
$ cd $GOPATH/src/github.com/cthit/speakIT
$ (cd backend; go get -d)
$ (cd frontend; yarn)
When this is done the application can be started
$ (cd backend; go install) && $GOPATH/bin/backend
$ (cd frontend; yarn start)