Skip to content

Matt-Guest/animals-ui

 
 

Repository files navigation

GOV.UK express

This is a working NodeJS (express) web application that uses the GOV.UK frontend and adheres to the GOV.UK Design System.

It also acts as the standard for how an express project should be structured, and what files are expected.

It can be copied and used at the starting point for any new web app.

Project structure

NodeJS services in the MCA follow the express routes/controllers pattern, along with with service classes that CRUD data.

src
+-- bin
|   -- www
|   controllers    
|   routes    
|   views
|   services
|   ...    
test
--- web
--- services
--- ...
Expected project files

Each project should have the following files:

Name Purpose
README.md Explanation of the module and how to use it
package.json For building with npm
Dockerfile To build a Docker image
docker-compose.yml To run the Docker image and all dependencies
www To start the service
.gitignore Files to be ignored from SCM

Prerequisites and setup

Developers should install the following on their machines:

Environment variables are defined in the .env.example file. This should be copied locally into .env but NOT commited.

View templating

This project uses nunjucks for its view templating.

Commands

Development

Install the dependencies

npm install grunt -g
npm install nyc -g
npm install

Test (first start animals-api service)

npm test

Run locally

npm start
Docker

Run locally

docker-compose up

Accessing locally

The service will be available at http://localhost:2997/

About

GOV.UK styled express app

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 49.4%
  • HTML 25.4%
  • CSS 24.8%
  • Dockerfile 0.4%