@dwp/govuk-casa
Framework for creating basic GOVUK Collect-And-Submit-Applications
Last updated 15 days ago by lhokktyn .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @dwp/govuk-casa 
SYNC missed versions from official npm registry.

CASA

Build Status

A compact framework for building government services based on the GOV.UK Design System.

Support

CASA is maintained by the DWP Engineering Practice.

Contributing

If you'd like to contribute any changes, enhancements or report issues, please take a look at our contribution guide.

Features

  • Adopts the GOVUK Design System which provides well-researched, accessible markup out of the box
  • Handles complex, conditional journey routing logic so you easily tailor users' journeys on the fly
  • Provides basic protection against some OWASP Top Ten vulnerabilities such as XSS, CSRF
  • Choose your own session management extension for customised data storage (e.g. apply encryption as required)
  • Shallow learning curve

Getting started

CASA aims to maintain support for the latest CURRENT even version and the previous LTS version of NodeJS (currently 13 and 12 respectively as of Feb 2020), and requires at least version 6.4.0 of npm. See the NodeJS release schedule for more information.

Prepare your new project and install dependencies:

mkdir -p my-project
cd my-project
npm init -y
npm install --save-exact express express-session @dwp/govuk-casa

You can use any folder structure you're most comfortable with, but here's a suggested convention:

definitions/
  field-validators/
  plan.js
  pages.js
locales/
  en/
  cy/
routes/
static/
views/
  layouts/
  pages/
  partials/
app.js

If you just want to get a quick and dirty CASA application up and running, take a look at Deploying a CASA app first or browse through one of the example applications.

However, if you'd like to build an understanding of the core concepts involved in building a CASA app, a good place to start is to begin designing your Routes Plan. This will provide CASA with information about the high-level flows that a user takes through your service, including the various conditional forks that may appear in the journey. Visit Designing a Route Plan to get started.

Once your plan begins to take shape, you can start to create the HTML pages that will take your users through the various routes within it, capturing data from them along the way. All markup is generated through Nunjucks templates, and you can use the GOVUK Design System components to generate elements that match the GOVUK styling. Visit Creating Pages to get started.

Now you've got some pages ready to collect data from the user, you'll most likely want to add a bit of validation logic to those data fields to make sure you're capturing the right stuff, in the right format. Visit Defining Field Validation to get started.

Finally, we need to bring all of this together, by creating a bootstrap script for our service. Visit Deploying a CASA app to get started.

That's it! The basics have been covered here, but if you want to delve deeper under the hood then take a read through the developer API documentation too.

Testing your app

CASA provides a basic testTraversal() utility function that can help to test that the routes defined in your Plan are executed in the expected sequence when given a series of defined data inputs.

Current Tags

  • 6.5.0                                ...           latest (15 days ago)
  • 4.0.9                                ...           maintain/4.x (a month ago)
  • 2.5.4                                ...           maintain2x (3 months ago)
  • 3.0.4                                ...           maintain3x (7 months ago)
  • 4.0.7                                ...           maintain4x (7 months ago)
  • 4.0.8                                ...           next4.x (2 months ago)

54 Versions

  • 6.5.0                                ...           15 days ago
  • 6.4.1                                ...           22 days ago
  • 6.4.0                                ...           24 days ago
  • 6.3.2                                ...           a month ago
  • 6.3.1                                ...           a month ago
  • 6.3.0                                ...           a month ago
  • 6.2.0                                ...           a month ago
  • 6.1.0                                ...           a month ago
  • 4.0.9                                ...           a month ago
  • 4.0.8                                ...           2 months ago
  • 6.0.0                                ...           2 months ago
  • 5.2.2                                ...           2 months ago
  • 6.0.0-alpha.2                                ...           3 months ago
  • 2.5.4                                ...           3 months ago
  • 6.0.0-alpha.1                                ...           4 months ago
  • 5.2.1                                ...           4 months ago
  • 5.2.0                                ...           6 months ago
  • 5.1.0                                ...           7 months ago
  • 4.0.7                                ...           7 months ago
  • 3.0.4                                ...           7 months ago
  • 2.5.3                                ...           7 months ago
  • 5.1.0-beta.3                                ...           7 months ago
  • 5.1.0-beta.2                                ...           7 months ago
  • 5.1.0-beta.1                                ...           7 months ago
  • 5.0.1                                ...           9 months ago
  • 4.0.6                                ...           9 months ago
  • 3.0.3                                ...           9 months ago
  • 5.0.0                                ...           9 months ago
  • 5.0.0-alpha.4                                ...           9 months ago
  • 5.0.0-alpha.3                                ...           10 months ago
  • 4.0.5                                ...           10 months ago
  • 5.0.0-alpha.2                                ...           10 months ago
  • 5.0.0-alpha.1                                ...           10 months ago
  • 4.0.4                                ...           10 months ago
  • 4.0.3                                ...           a year ago
  • 3.0.2                                ...           a year ago
  • 2.5.2                                ...           a year ago
  • 4.0.2                                ...           a year ago
  • 2.5.1                                ...           a year ago
  • 4.0.1                                ...           a year ago
  • 2.5.0                                ...           a year ago
  • 4.0.0                                ...           a year ago
  • 3.0.1                                ...           a year ago
  • 2.4.3                                ...           a year ago
  • 3.0.0                                ...           a year ago
  • 2.4.2                                ...           a year ago
  • 2.4.1                                ...           a year ago
  • 2.4.0                                ...           a year ago
  • 2.3.1                                ...           a year ago
  • 2.3.0                                ...           a year ago
  • 2.2.2                                ...           a year ago
  • 2.2.1                                ...           a year ago
  • 2.1.1                                ...           2 years ago
  • 2.1.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 1
This Month 103
Last Day 0
Last Week 54
Last Month 100
Dependencies (17)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |