Milestone -1: Tools#

We’re planning to uses a fair few technologies to build this system, React, PostgreSQL, Java Servlet API, and others; so let’s start with installing the main ones.

Node.js runtime#

We’re developing the UI with React, so we’ll first need a Node.js runtime. If you already have Node.js on your local system make sure that you’re using the version required below. Otherwise, follow the steps below to install the Node.js runtime.

Install#

The best way to install Node.js is with the Node Version Manager (NVM). NVM allows you to easily switch between versions of Node.js; which may not be hugely beneficial for this project, but is often required when working on multiple existing code bases - some of which may target different versions of Node.js. If you’re developing on macOS or Linux, installing NVM is easy and recommended; if you’re working on Windows, NVM may not be well supported and you may need to instead install Node.js directly. Regardless of your OS follow the NVM install guide for your system, falling back to a direct Node.js install - as detailed on the official Node.js site - if advised.

At the time of authoring this primer Node.js Long Term Support (LTS) was version 18.14.0. installing this version and its associated NPM version is simple with NVM. If your system is not well supported by NVM, and are required to instal Node.js directly, make sure you also target this version.

Install Node.js with NVM:

nvm install 18.14.0
nvm use 18.14.0

Verify#

Once you’ve installed Node.js you can verify your installation like so:

node --version

Node.js ships with both the Node Package Manager (NPM) and Node Program Executor (NPX). Verify those have been installed too (note that the versions for both NPM and NPX wont be the same as your Node.js installation, for example: Node.js v18.14.0 ships with NPM v9.3.1).

Verify that NPM is installed:

npm --version

Finally, verify that NPX is installed:

npx --version

What are NPM and NPX?

NPM is primarily a package manager for Node.js dependencies (called modules), if we want to make use of external libraries - such as React - we can use NPM to fetch and manage those for us. NPM can also be used to run scripts, and is handy for automating tasks within your project - more on that later. NPX allows us to execute arbitrary node modules, normally you’ll do this if you want to run a module managed by NPM, but NPX is not restricted to modules you’ve installed explicitly, for example npx https://gist.github.com/Tynael/0861d31ea17796c9a5b4a0162eb3c1e8 will run a module located on GitHub.

Java and Tomcat#

The Set up for Java is identical to the set up detailed here and for Tomcat here. Just make sure you target Java version 17 and Tomcat 10.0.27.

PostgreSQL and pgAdmin#

For details on how to set up PostgreSQL and pgAdmin follow this guide.

Visual Studio Code#

Visual Studio Code (or simply - VS Code) is the IDE used in this guide for developing the UI codebase. Download the latest version of VS Code here.