This is an example of a service built with Home Office Forms, A.K.A HOF. It intends to highlight many of the features available from HOF, but is not exhaustive.
This is not the only way to configure your HOF service. This service uses a typical Node.JS, Express architecture, with an entry point named app.js
, which is where the majority of the set up occurs.
The specifics of a form are configured in apps/
, this is where views, controllers, translations and the steps and fields are defined for each form journey (spoiler: there is only one at the moment).
For more info see the HOF documentation or join the discussion
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
- NodeJS - version 4 and up.
- npm version 3 (bundled with node 5 and up)
- Redis server running on the default port
- A basic understanding of Node.JS
Clone this repository: git clone [email protected]:UKHomeOffice/hof-example-form
Install the dependencies required to run the service and start the server in 'development' mode:
$ npm install
$ npm run dev
Visit: http://localhost:8080/my-awesome-form
If you are going to use this example form as a starting point for your own service, we encourage you to follow the next fews steps:
-
Delete the commit history:
rm -rf .git
-
Reconstruct the Git repo with only the current content:
git init
git add .
git commit -m "Initial commit"
- Set the remote origin:
git remote add origin <github-uri>
git push -u --force origin master
$ npm run test
$ npm run test:acceptance
It's worth glancing at the scripts
in package.json
to see what's happening
We welcome contributions, especially if you have a new "app" to add to apps/
, but we must insist you first read the our contribution docs for details on our code of conduct, and the process for submitting pull requests to us.
We use SemVer for versioning. For the versions available, see the tags on this repository.
This project is licensed under the GPLv2 License - see the LICENSE.md file for details