A template for building government services using the GOV.UK Design System.
This starter creates a frontend for a fictional 'Apply for a juggling licence' service. It shows you how to:
- ask users questions
- help them recover from errors
- check their answers
- show a confirmation page
The starter includes common patterns you'll need:
- Form validation and error messages
- Check your answers page
- Confirmation page
- Cookie banner
- Cookie settings page
- Analytics opt-in
- Markdown pages for static content
- Separation of content and presentation
- 400, 500 and 503 error pages
- Content Security Policy (CSP)
- Cross-Site Request Forgery (CSRF) protection
- Automated testing with Playwright
- Accessibility testing
- GitHub Actions for continuous integration
- Dependabot for dependency updates
- Docker support
- ESLint and Prettier
The starter uses:
- JavaScript with Node.js
- Express.js for the web server
- Nunjucks for templates
- GOV.UK Frontend for components
You need to:
- Install dependencies
- Set up environment variables
- Install test browsers
npm install
Copy the example environment file:
cp .env.example .env
npx playwright install
Run all tests:
npm run test
Read our architecture decision records in docs/decisions.
We follow these principles:
- Building a robust frontend using progressive enhancement - GOV.UK Service Manual
- Using Node.js - GDS Way
- Hypermedia Systems
- Writing JavaScript without a build system
If you usually work with React or similar client-side libraries, you might find this resource helpful:
Released under the MIT Licence unless otherwise stated.
The code is open and reusable.
Based on ministryofjustice/govuk-frontend-express.