Before starting, you should install Node.js, Git and Visual Studio Code on your computer. The software is free and open-source.
You can install the software manually, or use a package manager.
-
Node.js (https://nodejs.org/en/) is an interpreter that allows you to run JavaScript code on your computer or a server. You will use Node.js to write the logic of your web server.
-
Git (https://git-scm.com/) is a tool that you will use to share code changes and collaborate with a team.
-
Visual Studio Code (https://code.visualstudio.com/) is an editor that has excellent support for web development and internet programming. [1]
In addition, I encourage you to install the MongoDB and PostgreSQL database management systems: [2]
-
PostgreSQL (https://www.postgresql.org/) is an open-source SQL database management system. It is one option you may choose to store application data.
-
MongoDB (https://www.mongodb.com/) is a commercial document-oriented database management system with a free community edition. It is one option you may choose to store application data.
Package managers
You can get a better programming experience by installing your software using a package manager.
- Mac
-
-
Open your macOS terminal
-
Install Homebrew (https://brew.sh) by entering the installation command into your macOS terminal
-
Enter the following commands to access the MongoDB ‘tap’ and install the required software:
$ brew tap mongodb/brew ... $ brew install node postgresql mongodb-community telnet ... $ brew cask install visual-studio-code ...
-
- Ubuntu Linux (Ubuntu Desktop 20.04 LTS recommended)
-
-
Open a terminal window
-
Enter the following commands to update and upgrade your system, and then install Git, Node, Postgres and Visual Studio Code:
$ sudo apt update ... $ sudo apt upgrade ... $ sudo apt install git npm postgresql ... $ curl -o code.deb -L http://go.microsoft.com/fwlink/?LinkID=760868 ... $ sudo apt install ./code.deb ... $
-
Follow the official instructions to install MongoDB on Ubuntu
-
- Windows
-
-
Install Visual Studio Code in Windows, using the installer provided on the Visual Studio Code website
-
Enable Windows Subsystem for Linux (WSL) (WSL1 will work fine, but WSL2 has higher compatibility with Linux applications)
-
Install Ubuntu 20.04 LTS (Windows Subsystem for Linux) from the Microsoft Store in Windows. After you “Get” the software in the store, the first time you “Launch” the software in the store, it will complete the installation and ask you to set up a username and password. [3]
-
Open a WSL terminal window
-
Update your system, then install Git, Node and Postgres:
$ sudo apt update ... $ sudo apt upgrade ... $ sudo apt install git npm postgresql ... $
-
Warning
|
For Windows: Some exercises in this workbook make use of the MongoDB database management system. However, MongoDB does not support WSL1. You can sign up to a online MongoDB service with MongoDB Atlas for a free ‘start cluster’. Node.js code running in WSL1 can access the cluster over the internet. |
Whether you have a PC or a Mac, I recommend using Linux (e.g., Ubuntu 20.04 LTS) for web application development. This recommendation is because most servers on ‘the cloud’ run Linux. It is very convenient to use the same operating system locally as you use remotely. In addition, it helps you learn more about Linux. You can set-up Linux on your computer in at least three ways:
-
Using a virtual machine (such as VirtualBox or VMWare Workstation Player)
-
Using Windows Subsystem for Linux on Windows. You may find Linux difficult at first, but it will gradually become familiar and comfortable to you.
-
Setting up ‘dual boot’ so that you can start Linux as an option when your computer turns on
Virtual machines are the slowest option, but will cause you the least difficulty if you are new to Linux.