— Getting Started —

Preamble

It is expected when following these guides that you have a basic knowledge of unix terminals and are running OSX or a Linux operating system.

It is also expected that you have a working knowledge of javascript and node.js and are comfortable installing packages from npm. You should also be comfortable working with git.

This documentation is written with the assumption that you are using the latest versions of hof modules. Not all of this documentation will be relevant if you are not using the latest versions.

Requirements

hof is built in node.js, and so you'll need that installed first. At present all versions 4 and above are supported, although it is recommended that you use the latest LTS version.

HOF requires Node.js version 10.22.1 or greater and npm version 6.14.0 or greater. While you can use either npm or yarn for package management, the test scripts for hof expect yarn to be available.

You can check your installed versions by running node -v, npm -v, and yarn -v and update to the latest versions by running npm install -g npm@latest and npm install -g yarn.

To run hof apps locally for development you will either need a local instance of redis running, or docker installed.

Creating your first form

The fastest way to create a new hof app is to use the hof skeleton app. This will provide you with a bare-bones hof form that you can build on top of.

Clone the repo into a destination folder of your chosing:

git clone git@github.com:UKHomeOfficeForms/hof-skeleton.git

(full setup instructions can be found in the hof-skeleton readme)

Install the initial dependencies yarn install

You can then start your app by running docker-compose up or yarn start:dev (needs local redis instance).

If you open http://localhost:8080 in a browser then you should see your app.