Skip to content

Merge pull request #1 from web/master #12

Open
wants to merge 180 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
180 commits
Select commit Hold shift + click to select a range
905eb3c
deleted advanced materials
aa7401 Jul 18, 2019
01885aa
added extra labs
aa7401 Jul 18, 2019
fd0ca40
updated the readme file
aa7401 Jul 18, 2019
82e8c7a
added class information
aa7401 Sep 1, 2019
0ce0cf0
fixed section numbers
aa7401 Sep 1, 2019
11daaa2
added VS Code setup
aa7401 Sep 11, 2019
f00e947
added section numbers
aa7401 Sep 11, 2019
8b244a5
renamed labs
aa7401 Sep 11, 2019
b9020ed
renamed section
aa7401 Sep 11, 2019
2fb1a85
renamed lab directory
aa7401 Sep 12, 2019
9cfe29d
added lab directory for topic 1
aa7401 Sep 12, 2019
383609d
code cleanup
aa7401 Sep 12, 2019
c20f866
fixed push issue
aa7401 Sep 12, 2019
5d258ac
explanantion of push and pull
aa7401 Sep 12, 2019
c96feef
added http explanation
aa7401 Sep 12, 2019
ae5ed3e
fixed hyperlink
aa7401 Sep 12, 2019
6925dda
added hyperlinks
aa7401 Sep 12, 2019
c33b19b
renamed labs
aa7401 Sep 12, 2019
7693186
added standard upstream note
aa7401 Sep 12, 2019
dba43ff
updated link to Koa
aa7401 Sep 12, 2019
0b5cf57
updated resource links
aa7401 Sep 12, 2019
7849d67
moved a paragraph
aa7401 Sep 12, 2019
9733cdd
re-numbered sections
aa7401 Sep 12, 2019
783876c
added callback examples
aa7401 Sep 12, 2019
fa4c0bd
Merge branch 'master' of https://github.coventry.ac.uk/web/foundation
aa7401 Sep 12, 2019
1c92266
aded json section to lab
aa7401 Sep 12, 2019
deb39f3
added material
aa7401 Sep 12, 2019
922bb3d
Merge branch 'master' of https://github.coventry.ac.uk/web/foundation
aa7401 Sep 12, 2019
433c905
added base code for tests
aa7401 Sep 13, 2019
34b43ed
added base code for todo
aa7401 Sep 13, 2019
0737165
basic todo working
aa7401 Sep 13, 2019
4a0202e
explained unit testing
aa7401 Sep 13, 2019
e2825ba
completed tdd exercise
aa7401 Sep 13, 2019
32d2b60
finished unit testing lab
aa7401 Sep 13, 2019
3be9420
reverted module code
aa7401 Sep 13, 2019
934a8b2
removed code comment
aa7401 Sep 13, 2019
d2a6180
created todo app with database
aa7401 Sep 13, 2019
c5794e0
basic code for db
aa7401 Sep 14, 2019
8708e52
finished database exercise
aa7401 Sep 14, 2019
c665bb2
added comment
aa7401 Sep 14, 2019
e886bde
added comments
aa7401 Sep 14, 2019
67e18b1
added supertest files
aa7401 Sep 14, 2019
f156f90
fixed issue handling errors from async functions
aa7401 Sep 15, 2019
8941501
added notes on matchers
aa7401 Sep 15, 2019
5d305c3
replaced a matcher
aa7401 Sep 15, 2019
fa6f71c
hidden the old setup lab
aa7401 Sep 15, 2019
69ae6c8
emphasise directory notes
aa7401 Sep 15, 2019
f354d16
removed formatting
aa7401 Sep 15, 2019
53cc5e5
fixed link error
aa7401 Sep 15, 2019
4e8c733
bug fix
aa7401 Sep 15, 2019
5269f65
Merge branch 'master' of https://github.coventry.ac.uk/web/foundation
aa7401 Sep 15, 2019
6a5cf97
disabled some linter rules
aa7401 Sep 15, 2019
49921f1
disabled max-lines rule
aa7401 Sep 15, 2019
c197be6
fixed pull request
aa7401 Sep 15, 2019
0fdcf8f
To be consistent with 04 CSS3, Section 1.1
harjaus Sep 15, 2019
172af05
views/ --> html/
harjaus Sep 15, 2019
32957f6
Merge pull request #2 from harjaus/master
harjaus Sep 15, 2019
c16cb7f
Formatting
harjaus Sep 15, 2019
cac9d69
Merge pull request #3 from harjaus/master
harjaus Sep 15, 2019
b5c8cad
Removed Nested Callbacks because they appear in 06.
harjaus Sep 15, 2019
9bae150
Merge pull request #4 from harjaus/master
harjaus Sep 15, 2019
fe907e5
Made consistent with Worksheet 06
harjaus Sep 16, 2019
14c7e33
Merge pull request #5 from harjaus/master
harjaus Sep 16, 2019
820e07a
clarified some tasks
aa7401 Sep 16, 2019
2b7df97
Merge branch 'master' of https://github.coventry.ac.uk/web/foundation
aa7401 Sep 16, 2019
616b78e
added notes on changing shell
aa7401 Sep 16, 2019
f694407
Test
handley7 Sep 17, 2019
fae1963
1.3.2
nathwan2 Sep 17, 2019
ffe6e8c
added notes on running nodejs on Windows
aa7401 Sep 18, 2019
ddb628d
Fixed inconsistency with test suite
harjaus Sep 20, 2019
660bcf1
Added missing file for sheet 06.
harjaus Sep 20, 2019
0d5f324
Merge pull request #6 from harjaus/master
aa7401 Sep 20, 2019
73dfc6a
Changed sheet to specify which folder
harjaus Sep 20, 2019
3e5f457
Added missing files
harjaus Sep 20, 2019
e486943
Merge pull request #7 from harjaus/master
harjaus Sep 20, 2019
d2c7f53
Minor spelling mistake
harjaus Sep 21, 2019
745c463
Merge pull request #8 from harjaus/master
harjaus Sep 21, 2019
beb81da
Merge remote-tracking branch 'upstream/master'
handley7 Sep 21, 2019
9a87865
Update 01 Setup.md for Windows 10 WSL setup
handley7 Sep 21, 2019
36d7da9
Update 01 Setup.md
handley7 Sep 21, 2019
a8c2edb
Merge branch 'master' of https://github.coventry.ac.uk/handley7/found…
handley7 Sep 21, 2019
c6dd19d
Update images for WSL tutorial in 01 Setup.md
handley7 Sep 21, 2019
08c89b7
Update 01 Setup.md
handley7 Sep 21, 2019
de5af6f
Merge pull request #9 from handley7/master
aa7401 Sep 21, 2019
2c5dcaa
improved clarity of task
aa7401 Sep 22, 2019
da834a3
Merge branch 'master' of https://github.coventry.ac.uk/web/foundation
aa7401 Sep 22, 2019
1c19206
updated extensions list
aa7401 Sep 24, 2019
83c9e2d
update
nathwan2 Sep 24, 2019
847df4b
update
nathwan2 Sep 24, 2019
2456d1c
minor spelling amendment
charle44 Sep 24, 2019
afd9df0
Merge pull request #10 from charle44/patch-1
harjaus Sep 24, 2019
c78e77d
updated name of extension
aa7401 Sep 26, 2019
fd6f91d
added notes on debugging the test explorer
aa7401 Sep 26, 2019
1054bd3
Merge branch 'master' of https://github.coventry.ac.uk/web/foundation
aa7401 Sep 26, 2019
b9fed75
added extra task to lab
aa7401 Sep 26, 2019
6f04e7d
test
nathwan2 Sep 27, 2019
ddc5667
shortcut
charle44 Sep 28, 2019
c5881dd
03_html/05_semantic change & video word change
charle44 Oct 1, 2019
44e093f
updated the lab list and deleted old notes
aa7401 Oct 2, 2019
7d0bc7d
Merge pull request #13 from charle44/patch-2
aa7401 Oct 2, 2019
888e37d
Merge pull request #15 from charle44/patch-4
aa7401 Oct 2, 2019
f143f1b
added async examples
aa7401 Oct 3, 2019
2f87891
Merge branch 'master' of https://github.coventry.ac.uk/web/foundation
aa7401 Oct 3, 2019
f24e9df
Fixed error in code under 4.4 Static Members
aa6164 Oct 6, 2019
c593b3e
added login project
aa7401 Oct 7, 2019
53fc0b6
updated lab sheet
aa7401 Oct 7, 2019
c1649a0
fixed missing file
aa7401 Oct 8, 2019
7cb6b16
Merge branch 'master' of https://github.coventry.ac.uk/web/foundation
aa7401 Oct 8, 2019
15b4db6
fixed issue
aa7401 Oct 8, 2019
6340dc7
fixed module name
aa7401 Oct 8, 2019
8449b58
another bug fixed
aa7401 Oct 8, 2019
cae34b6
push
nathwan2 Oct 8, 2019
ece3438
oo
nathwan2 Oct 8, 2019
357f86f
added open file debug option
aa7401 Oct 8, 2019
006c796
Merge branch 'master' of https://github.coventry.ac.uk/web/foundation
aa7401 Oct 8, 2019
21c2366
replaced api used
aa7401 Oct 9, 2019
393a730
added a currencies data file
aa7401 Oct 9, 2019
ca82a75
fixed all urls
aa7401 Oct 9, 2019
7564ca2
added async functions file
aa7401 Oct 9, 2019
053389a
deleted old readme file
aa7401 Oct 9, 2019
d4ddbc7
started mocking file system
aa7401 Oct 9, 2019
64be017
Merge branch 'master' of https://github.coventry.ac.uk/web/foundation
aa7401 Oct 9, 2019
87c1585
fixed text input issue
aa7401 Oct 11, 2019
c8fcbf0
Merge pull request #1 from web/master
kenyonJ Oct 11, 2019
111e500
Updated Git Installation
aa7401 Oct 12, 2019
23eca50
Cleaned Up Files
aa7401 Oct 12, 2019
a43b857
Merge branch 'master' of https://github.coventry.ac.uk/web/foundation
aa7401 Oct 12, 2019
9b23edb
Updated ESLint and JSDoc Exercise
aa7401 Oct 12, 2019
d1c17c9
Fixed Callback Code
aa7401 Oct 12, 2019
9629baa
Updated Lab Sheet
aa7401 Oct 12, 2019
c0aa4ed
Completed Lab Sheet
aa7401 Oct 12, 2019
63ea40e
grammatical change
charle44 Oct 12, 2019
54e75d8
Updated the Nested Callback Lab
aa7401 Oct 15, 2019
c3cc178
Added Promise Working Example
aa7401 Oct 15, 2019
a736124
bug fix
aa7401 Oct 15, 2019
cc11aad
Merge branch 'master' of https://github.coventry.ac.uk/web/foundation
aa7401 Oct 15, 2019
6d5c6a9
Fixed Promise Bug
aa7401 Oct 15, 2019
edceed4
Modified the Modularity Exercise
aa7401 Oct 18, 2019
dd1f05f
Fixed Some Spelling Errors
aa7401 Oct 18, 2019
96e8e4b
Added More Exercises
aa7401 Oct 20, 2019
bbcc9ab
Merge branch 'master' of https://github.coventry.ac.uk/web/foundation
aa7401 Oct 20, 2019
b385bb0
Removed Module Call
aa7401 Oct 22, 2019
93cc681
Added Code to Callback
aa7401 Oct 22, 2019
648ead1
added instructions for Win10 Users
aa7401 Oct 22, 2019
c035290
Merge branch 'master' of https://github.coventry.ac.uk/web/foundation
aa7401 Oct 22, 2019
ba038cb
Added Component Notes
aa7401 Oct 23, 2019
8b1f989
fixed typo in 3.3
charle44 Oct 23, 2019
0e7ec41
typo ammendment
charle44 Oct 23, 2019
210ae92
Added Notes on Installing the Browser Preview
aa7401 Oct 25, 2019
48310c0
resolved Issue #25
bordasb Oct 25, 2019
fbf8869
Merge pull request #27 from charle44/patch-7
aa7401 Oct 26, 2019
59e3e7f
Merge pull request #26 from charle44/patch-6
aa7401 Oct 26, 2019
e12506b
Merge pull request #18 from charle44/patch-5
aa7401 Oct 26, 2019
afa4426
Merge pull request #19 from nathwan2/master
aa7401 Oct 26, 2019
fd08afd
Merge pull request #21 from kenyonJ/master
aa7401 Oct 26, 2019
a4ffe9c
Added Notes on Script Explorer
aa7401 Nov 2, 2019
c46de19
Merge branch 'master' of https://github.coventry.ac.uk/web/foundation
aa7401 Nov 2, 2019
ce57bbc
#28 mock-fs example created
bordasb Nov 4, 2019
a4b7917
Merge pull request #1 from web/master
ngussed Nov 5, 2019
7e1bc04
added database and can chnage name of pictures with what file its
Nov 5, 2019
b0d1c68
fixes done to file_system unit test
Nov 8, 2019
7cf77b6
trying to fix file_system unit test
Nov 8, 2019
5b4ac41
Removed Merge Conflict
aa7401 Nov 8, 2019
c4d788d
Replaced Module
aa7401 Nov 8, 2019
a98fdec
Merge branch 'master' of https://github.coventry.ac.uk/web/foundation
aa7401 Nov 8, 2019
54a02fa
Now we throw specific errors, not generic
harjaus Nov 8, 2019
a69a9c8
Added dependency
harjaus Nov 8, 2019
bc98b02
We no longer done.fail() on everything, we expect no errors on catch
harjaus Nov 8, 2019
6e14868
trying to fix mockfs exercise
Nov 8, 2019
5e5e55d
Now throws correct error on file not existing
harjaus Nov 8, 2019
39db18b
Reading mocking works
harjaus Nov 8, 2019
8102229
Now reads as binary
harjaus Nov 8, 2019
0b9b9e1
Now writes synchronously, fixes bug
harjaus Nov 8, 2019
39518ac
Now can mock writing to filesystem
harjaus Nov 8, 2019
213478a
Removed unnecessary files
harjaus Nov 8, 2019
0789e71
Merge branch 'fixingMockFS'
harjaus Nov 8, 2019
d4fc244
minor typo and semantic fixes
bordasb Nov 11, 2019
2cf6567
corrected the bracket notation example
bordasb Nov 12, 2019
9a7dcc7
Merge branch 'master' of https://github.coventry.ac.uk/ngussed/dynami…
Nov 12, 2019
d899994
h
Nov 12, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
@@ -15,7 +15,7 @@
"arrow-spacing": ["warn", {"before": true, "after": true}],
"brace-style": ["error", "1tbs", { "allowSingleLine": true }],
"camelcase": [2, {"properties": "never"}],
"complexity": ["error", 4],
"complexity": ["error", 5],
"eol-last": "warn",
"eqeqeq": "error",
"func-call-spacing": ["error", "never"],
@@ -27,10 +27,14 @@
"max-depth": ["error", 3],
"max-len": ["warn", { "code": 120, "tabWidth": 4 }],
"max-lines": ["error", 100],
<<<<<<< HEAD
"max-lines-per-function": ["error", 25],
=======
"max-lines-per-function": ["error", 20],
>>>>>>> upstream/master
"max-nested-callbacks": ["error", 4],
"max-params": ["error", 5],
"max-statements": ["error", 10],
"max-statements": ["error", 20],
"no-cond-assign": 2,
"no-dupe-args": "error",
"no-dupe-keys": "error",
@@ -53,11 +57,11 @@
"no-var": 2,
"prefer-arrow-callback": 1,
"prefer-const": 2,
"prefer-template": "error",
"quotes": [1, "single"],
"semi": [1, "never"],
"space-before-blocks": ["error", { "functions": "always", "keywords": "always", "classes": "always" }],
"space-before-function-paren": [2, "never"],
"strict": [2, "global"],
"yoda": 2
},
"overrides": [{
@@ -7,10 +7,15 @@ data/
coverage/
docs/
sessions/
<<<<<<< HEAD
screenshots/
__image_snapshots_/
__diff_output__/
trace/
=======
screenshots/*
out/
>>>>>>> upstream/master

# sqlite databases
# *.db
@@ -32,3 +37,6 @@ website.db
# IDE setting files
*.codio
*.c9

messages.txt
todo.db
@@ -1,14 +1,42 @@

{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Jest Tests",
"program": "${workspaceFolder}/exercises/12_spa/books/node_modules/.bin/jest",
"name": "Launch Current Opened File",
"program": "${file}"
},
{
"type": "node",
"request": "launch",
"name": "Jest All",
"program": "${workspaceFolder}/exercises/07_unit_testing/todo/node_modules/jest/bin/jest",
"args": ["--runInBand"],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true,
"windows": {
"program": "${workspaceFolder}/exercises/07_unit_testing/todo/node_modules/jest/bin/jest",
}
},
{
"type": "node",
"request": "launch",
"name": "Jest Current File",
"program": "${workspaceFolder}/exercises/07_unit_testing/todo/node_modules/jest/bin/jest",
"args": [
"-i"
]
"${fileBasenameNoExtension}",
"--config",
"jest.config.js"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true,
"windows": {
"program": "${workspaceFolder}/exercises/07_unit_testing/todo/node_modules/jest/bin/jest",
}
}
]
}
}
@@ -0,0 +1,60 @@

# Setup for Windows 10 Users

The tools used in this module are designed to be used in a Unix or Linux environment. Whilst this will create challenges for Windows 10 user there are some steps you will need to take. Please read and follow the steps below carefully:

Install the Windows Subsystem for Linux (WSL). Open PowerShell as Administrator and run:

``` shell
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
```

Restart your computer when prompted.

Now install Visual Studio Code and once launched install the [remote-wsl](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl) component by Microsoft. You should also install the [browser-preview](https://marketplace.visualstudio.com/items?itemName=auchenberg.vscode-browser-preview) component which will allow you to open html web pages.

![remote-wsl](exercises/.images/remote-wsl.png)

Now you need to install Ubuntu. This can be found by searching for `run linux on windows` in the Microsoft Store. You will be presented with the following screen.

![Microsoft Store](exercises/.images/store.png)

Choose the Ubuntu operating system (v18.04 LTS) and install. Once installed, click on the **Launch** button, this will open a console window and you will need to wait for a few minutes for the installation to complete.

## Cloning the Forked Repository

You will now need to fork the foundation lab by clicking on the Fork button. This will create a copy of the repository. See the standard setup instructions for more details.

Now you can clone your forked repository by running the following command in the Ubuntu console, replacing xxx with the URL of your repository.

```shell
git clone xxx
```

This will create a directory called `foundation` in the Ubuntu console. The final step is to launch VS Code from within the WSL environment by running the following command:

```shell
code foundation
```

This will launch VS Code from within the WSL with the contents of the `foundation/` directory. If you open the integrated terminal (using the **Terminal** menu) you will see that you have the full ubuntu bash shell. You can now run all the remaining steps from this integrated terminal, just as you would for a standard Linux install.

## Installing NodeJS

These steps are identical to those used on a full Ubuntu installation. Start by installing the Node Version Manager (NVM) tool:

```shell
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash
nvm --version
nvm install node
```

If the `nvm` command is not found you will need to reload the shell:

```shell
source ~/.profile
```

Now try to install again.

Now you can go directly to step 4 in the standard setup instructions.
@@ -0,0 +1,197 @@

# Setup

In this worksheet you will learn how to configure your work environment using VS Code. You should start by installing **Visual Studio Code** (NOT VISUAL STUDIO!) from the [website](https://code.visualstudio.com), note that it might already be installed. If you are using a Coventry University computer and the software is not installed you can do this using AppsAnywhere.

If you are using Windows 10 you will also need to install [Git](https://git-scm.com/download/win), this may already be installed on a Coventry University computer. If you are on MacOS you may already have it installed as it comes with the XCode IDE but if you have recently updated your OS you may need to run the `xcode-select --install` command to update the **Xcode Command-line Tools** but if you don't want to install XCode you can install git using [HomeBrew](http://brew.sh/) using the `brew install git` command. If you are running Ubuntu you can install it using the `sudo apt install git` command.

DO NOT INSTALL THE GIT GUI TOOLS!

Visual Studio Code comes with an integrated **Terminal** that can be used instead of the standard _Command Prompt_ or _Terminal_. If you are using Linux or MacOS this will give you a Bash prompt however on Windows 10 it defaults to the _Command Prompt_ and will need to be changed to the _Bash Shell_.

Press CTRL-SHIFT-P and a selection box should appear at the top of the editor. Type in `default shell` and click on the `Terminal: Select Default Shell` option.

![Changing the Default Shell in Windows 10](exercises/.images/windows_shell.png)

Now the integrated terminal uses the _Bash Shell_ meaning you can use the standard *nix bash commands!

# If _Bash Shell_ is _not_ listed on your Windows 10 machine

On some versions of Windows 10, some extra configuration is required before Bash Shell is able to be selected within VS Code. If this is the case on your machine, follow the below troubleshooting steps before reattempting to change your shell as above.

To start, we need to make sure Developer Mode is enabled in the Update and Security section of Windows 10. Press **WIN+R** (Windows Key and R simultaneosly) to open a Run dialog. In the dialog enter **ms-settings:developers** followed by the enter key. The window shown below should appear on screen.

![Enabling Windows 10 Developer Mode](exercises/.images/developerMode.PNG)

Select the **Developer mode** radio button and **yes** on any succeeding dialog boxes. Wait for any neccessary installations to complete.

Once that has completed, we need to enable the WSL (Windows Subsystem for Linux). Press **WIN+R**, in the dialog enter **powershell** followed by the enter key. In the powershell window copy and paste the following:

```
Start-Process powershell -Verb runAs
exit
```

Press the enter key and accept the UAC (User Account Control) dialog. A new powershell window will launch with Administrator rights.

Copy and paste the following:

```
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
```

Press the enter key and wait for the process to complete. Once complete, restart your computer before continuing.

Finally, we need to install [Ubuntu from the Microsoft Store](https://www.microsoft.com/en-gb/p/ubuntu/9nblggh4msv6?activetab=pivot:overviewtab). Click the blue **Get** button and accept any dialogs to launch the Microsoft Store and begin the installation. Once Ubuntu for WSL (Windows Subsystem for Linux) has installed, restart Windows.

Once restarted, reattempt to enable Bash Shell in VS Code as per the section above.

## 1 Forking the Foundation Materials

You should start by logging in to the University GitHub server using your university username and password. Make sure you don't log into GitHub.com!

Next you should open the [web page](https://github.coventry.ac.uk/web/foundation) containing the foundation materials and click on the small Fork button in the top-right corner of the page

![The Clone Button](exercises/.images/fork01.png)

You will be asked to select where you want to place the forked repository, make sure you choose your own personal space (the one that is named using your username).

![The Clone Button](exercises/.images/fork02.png)

This will create an exact copy (clone) of the repository in your personal workspace. It should indicate where the original version was (see below).

![The Clone Button](exercises/.images/fork03.png)

## 2 Cloning the Lab Exercises

Locate the green **Clone or Download** button and click this. You will see the option to clone with HTTPS. Click on the copy icon as shown to copy the URL to the clipboard.

![The Clone Button](exercises/.images/clone01.png)

Make sure the url begins with `https://`, if it begins with `git` you need to click in the small **Use HTTPS** link!

Launch the **terminal** app (Mac and Linux users) or Bash Shell (Windows 10 users). Now use this to navigate to the directory where you want to store the lab materials. You should use the following bash commands:

1. `ls` is used to see the contents of the current directory.
2. `pwd` prints the path to the current directory.
3. `cd` changes to the directory you specify, `cd ..` takes you to the parent directory.

When you are in the chosen location you need to clone the repository using the URL we copied earlier:

```shell
git clone xxx
```

Replacing xxx with the content of the clipboard.

This will create a directory called `foundation` which contains all the content from the repository.

Now you can launch Visual Studio Code and use the **File** menu to open this `foundation/` directory.

### 2.1 Additional Steps for Windows 10 Users

If you are using Windows 10 you will need to carry out some additional steps before starting the lab exercises:

2. Open the integrated terminal using the **Terminal** menu.
3. Type - Select Default Shell
4. Select Git Bash from the options
5. Click on the + icon in the terminal window.

This will open a new Git Bash shell in the project directory.

## 3 Installing NodeJS

Next we need to install and configure NodeJS. If you are using MacOS or Linux the first task is to install the Node Version Manager tool. You can find detailed [instructions](https://nodesource.com/blog/installing-node-js-tutorial-using-nvm-on-mac-os-x-and-ubuntu/).

Once installed you may need to restart your computer. Now check it was installed correctly:

```bash
$ command -v nvm
nvm
```

Now we can install the latest version of NodeJS:

```bash
nvm install node
node -v
```

If you are running Windows 10 you need to [download the installer](https://nodejs.org/en/) for the **Current** version of NodeJS (12.10 at the time of writing).

## 4 Running a Web Server

Use the terminal to navigate to the `exercises/01_setup/` directory and try running the `index.js` script:

```shell
$ cd exercises/01_setup/
$ node index.js
Error: Cannot find module 'koa'
```

If you are using Windows 10 you will need to use the command prompt instead and navigate to the `01_setup/` directory.

Notice you get an error, we need to install the missing module using the _Node Package Manager_ tool. We can then try to run the script again:

```shell
$ npm install koa
$ node index.js
app listening on port 8080
```

Now we have the server up and running so the final task is to view the web page using the web browser. Simply open the Chrome browser and navigate to localhost:8080 where you should see a message. If this works you are ready to start the lab exercises.

## 5 Pushing the Changes to GitHub

As you work through the lab activities two things are likely to happen:

1. You make changes to the code that you want to push to the forked copy of your repository.
2. You will need to pull any bug fixes from the original repository.

### 5.1 Configuring the Repository

Before you start interacting with the GitHub server you need to configure the local repository. Open the Bash Shell and run the following commands:

```shell
git config user.name 'John Doe'
git config user.email 'doej@coventry.ac.uk'
```

remember to replace the values with you own name and your university email (but without the uni part).

### 5.2 Pushing Changes

**NOTE: You only need to carry out this step when you have make changes to the code! This will normally need to take place each time you complete a "Test Your Understanding" section.**

As you save your changes you will see a blue circle against the **Source Control** tab that indicates how many files have been changed, we need to get these changed files up to GitHub. Start by opening the tab, you will see a list of all the files you have changed.

1. Click on the + button to stage these changes.
2. Type in a commit message to explain what changes you have made.
3. Click in the tick button to commit the changes.

![Committing Changes](exercises/.images/push01.png)

Now you should click on the **Sync** icon (shown below) to push the new commit up to your GitHub repository, this will also pull doen any commits that are on the GitHub server but that you don't have on your local computer. The first number is the number of commits it will pull from GitHub (down arrow) and the second the number of commits it will push from your local computer to GitHub (up arrow).

![Pushing Commits](exercises/.images/push-pull.png)

At this point you should be able to refresh your GitHub repository page to see the changes.

### 5.3 Pulling from Upstream

As new materials and resources are added to the original repository (and bugs fixed) you will want to merge these into your forked repository. Before you can do this you will need to add a link to the upstream repository. Open a bash shell:

```bash
git remote add upstream https://github.coventry.ac.uk/web/foundation.git
git remote -v
```

Now, every time you have committed and pushed you changes you can pull the changes from the master repository:

```shell
git fetch upstream
git checkout master
git merge upstream/master
```

Don't worry if you don't understand what is happening, this will be explained in a future lab.