Giter Club home page Giter Club logo

civil-citizen-ui's Introduction

Civil Citizen UI

Greenkeeper badge

Standard - JavaScript Style Guide

codecov

Getting Started

Prerequisites

Running the application requires the following tools to be installed in your environment:

Running the application

Install dependencies by executing the following command:

$ yarn install

Bundle:

$ yarn webpack

Run:

$ yarn start

The application's home page will be available at https://localhost:3001

Running with Docker

Create docker image:

  docker-compose build

Run the application by executing the following command:

  docker-compose up

This will start the frontend container exposing the application's port

In order to test if the application is up, you can visit https://localhost:3001 in your browser.

Developing

Code style

We use ESLint alongside sass-lint

Running the linting with auto fix:

$ yarn lint --fix

Running the tests

This template app uses Jest as the test engine. You can run unit tests by executing the following command:

$ yarn test

Here's how to run functional tests (the template contains just one sample test):

$ yarn test:routes

Running accessibility tests:

$ yarn test:a11y

Running functional tests:

Update required secrets on your machine then run below command

$ yarn test:functional

Running E2E tests:

For that we need to follow three steps:

  1. Start wiremock server
$ yarn wiremock:start
  1. Start the application as E2E
$ yarn start:e2e
  1. Execute E2E test
$ yarn test:e2e

Running Preview pipeline :

Raise a PR and add below labels to run the pipeline without any issues

fullDeploy, pr-values:elasticsearch

Add "enable_keep_helm" label to retain helm release on preview Add "pr-values:enableNotifyEmails" label to be able to send live notifications on the PR

Running Crossbrowser tests:

Install saucelabs on local machine

$ yarn test:crossbrowser

Make sure all the paths in your application are covered by accessibility tests (see a11y.test.ts).

Security

CSRF prevention

Cross-Site Request Forgery prevention has already been set up in this template, at the application level. However, you need to make sure that CSRF token is present in every HTML form that requires it. For that purpose you can use the csrfProtection macro, included in this template app. Your njk file would look like this:

{% from "macros/csrf.njk" import csrfProtection %}
...
<form ...>
  ...
    {{ csrfProtection(csrfToken) }}
  ...
</form>
...

Helmet

This application uses Helmet, which adds various security-related HTTP headers to the responses. Apart from default Helmet functions, following headers are set:

There is a configuration section related with those headers, where you can specify:

  • referrerPolicy - value of the Referrer-Policy header

Here's an example setup:

    "security": {
      "referrerPolicy": "origin",
    }

Make sure you have those values set correctly for your application.

Healthcheck

The application exposes a health endpoint (https://localhost:3001/health), created with the use of Nodejs Healthcheck library. This endpoint is defined in health.ts file. Make sure you adjust it correctly in your application. In particular, remember to replace the sample check with checks specific to your frontend app, e.g. the ones verifying the state of each service it depends on.

Adding Git Conventions

Include the git conventions.

  • Make sure your git version is at least 2.9 using the git --version command
  • Run the following command:
git config --local core.hooksPath .git-config/hooks

Once the above is done, you will be required to follow specific conventions for your commit messages and branch names.

If you violate a convention, the git error message will report clearly the convention you should follow and provide additional information where necessary.

Optional:

  • Install this plugin in Chrome: https://github.com/refined-github/refined-github

    It will automatically set the title for new PRs according to the first commit message, so you won't have to change it manually.

    Note that it will also alter other behaviours in GitHub. Hopefully these will also be improvements to you.

In case of problems

  1. Get in touch with your Technical Lead so that they can get you unblocked

  2. If the rare eventuality that the above is not possible, you can disable enforcement of conventions using the following command

    git config --local --unset core.hooksPath

    Still, you shouldn't be doing it so make sure you get in touch with a Technical Lead soon afterwards.

License

This project is licensed under the MIT License - see the LICENSE file for details.

civil-citizen-ui's People

Contributors

annika-moorthy avatar bhagyashreesharma90 avatar commitblob avatar dependabot[bot] avatar elifdenizesea avatar gorilanaranja avatar hmcts-version1-domini avatar hmcts-version1-ignacio avatar jakiurmalik avatar jeswanth-hmcts avatar kalachandrasekar1 avatar kamilewandowski avatar kenneth-hmcts avatar laarmada avatar laperla11 avatar leonardopalmeiro avatar m-meulendijks-v1 avatar marianadpereira avatar miguelmolina3691 avatar neeta-hmcts avatar nishm avatar pats-john avatar portizdev avatar rajakm avatar renovate[bot] avatar rhysbeazleyy avatar rosdiaf avatar sampankumar avatar sankhajuria avatar tatsymaslova avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

civil-citizen-ui's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Warning

These dependencies are deprecated:

Datasource Name Replacement PR?
npm @types/copy-webpack-plugin Unavailable
npm @types/helmet Unavailable
npm csurf Unavailable
npm tslint Unavailable

Awaiting Schedule

These updates are awaiting their schedule. Click on a checkbox to get an update now.

  • Update Helm release civil-service to v0.0.68
  • Update Helm release nodejs to v3.1.1
  • Update babel monorepo (@babel/core, @babel/eslint-parser, @babel/preset-env)
  • Update dependency @ministryofjustice/frontend to v1.8.1
  • Update dependency @types/es6-promisify to v6.0.4
  • Update dependency @types/multer to v1.4.11
  • Update dependency @types/nunjucks to v3.2.6
  • Update dependency @types/require-directory to v2.1.6
  • Update dependency @types/serve-favicon to v2.5.7
  • Update dependency @types/supertest to v2.0.16
  • Update dependency class-validator to v0.14.1
  • Update dependency config to v3.3.12 (config, @types/config)
  • Update dependency connect-redis to v7.1.1
  • Update dependency dayjs to v1.11.12
  • Update dependency debug to v4.3.6
  • Update dependency launchdarkly-node-server-sdk to v7.0.4
  • Update dependency style-loader to v3.3.4
  • Update dependency supertest to v6.3.4
  • Update dependency tough-cookie to v4.1.4
  • Update dependency ts-node to v10.9.2
  • Update dependency uuid to v9.0.1
  • Update jest monorepo (@types/jest, jest)
  • Update Helm release ccd to v9.2.0
  • Update Terraform azurerm to 3.113
  • Update Yarn to v3.8.3
  • Update dependency @playwright/test to v1.45.3
  • Update dependency @types/lodash to v4.17.7
  • Update dependency @types/node to v18.19.42
  • Update dependency axios to v1.7.2
  • Update dependency codeceptjs to v3.6.4
  • Update dependency cookie-session to v2.1.0 (cookie-session, @types/cookie-session)
  • Update dependency css-loader to v6.11.0
  • Update dependency eslint to v8.57.0
  • Update dependency express-session to v1.18.0 (express-session, @types/express-session)
  • Update dependency glob to v10.4.5
  • Update dependency govuk-frontend to v5.4.1
  • Update dependency hashicorp/terraform to v1.9.3
  • Update dependency helmet to v7.1.0
  • Update dependency html-webpack-plugin to v5.6.0
  • Update dependency i18next-fs-backend to v2.3.1
  • Update dependency i18next-http-middleware to v3.6.0
  • Update dependency ioredis to v5.4.1
  • Update dependency ioredis-mock to v8.9.0
  • Update dependency launchdarkly-node-client-sdk to v3.2.1
  • Update dependency luxon to v3.4.4 (luxon, @types/luxon)
  • Update dependency mini-css-extract-plugin to v2.9.0
  • Update dependency mocha to v10.7.0
  • Update dependency nock to v13.5.4
  • Update dependency node to v21.7.3
  • Update dependency node-fetch to v2.7.0
  • Update dependency qs to v6.12.3
  • Update dependency sass to v1.77.8
  • Update dependency sass-loader to v13.3.3
  • Update dependency semver to v7.6.3
  • Update dependency sinon to v15.2.0
  • Update dependency ts-jest to v29.2.3
  • Update dependency ts-loader to v9.5.1
  • Update dependency validator to v13.12.0
  • Update dependency webdriverio to v8.39.1
  • Update dependency webpack to v5.93.0
  • Update typescript-eslint monorepo to v5.62.0 (@typescript-eslint/eslint-plugin, @typescript-eslint/eslint-plugin-tslint, @typescript-eslint/parser)
  • Update Node.js to v20
  • Update Yarn to v4
  • Update actions/stale action to v9
  • Update crs-k/stale-branches action to v5
  • Update dependency @codeceptjs/configure to v1
  • Update dependency @hmcts/properties-volume to v1
  • Update dependency @ministryofjustice/frontend to v2
  • Update dependency @types/node to v20
  • Update dependency @types/supertest to v6
  • Update dependency applicationinsights to v3
  • Update dependency copy-webpack-plugin to v12
  • Update dependency css-loader to v7
  • Update dependency eslint to v9
  • Update dependency flat to v6
  • Update dependency glob to v11
  • Update dependency i18next to v23
  • Update dependency jest-junit to v16
  • Update dependency jsdom to v24
  • Update dependency jwt-decode to v4
  • Update dependency minimatch to v10
  • Update dependency node-fetch to v3
  • Update dependency nodemon to v3
  • Update dependency pa11y to v8
  • Update dependency sass-loader to v16
  • Update dependency sinon to v18
  • Update dependency style-loader to v4
  • Update dependency supertest to v7
  • Update dependency supertest-session to v5
  • Update dependency tar to v7
  • Update dependency totp-generator to v1
  • Update dependency typescript to v5
  • Update dependency uuid to v10
  • Update typescript-eslint monorepo to v7 (major) (@typescript-eslint/eslint-plugin, @typescript-eslint/eslint-plugin-tslint, @typescript-eslint/parser)

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

docker-compose
docker-compose.yml
dockerfile
Dockerfile
  • hmctspublic.azurecr.io/base/node 18-alpine
github-actions
.github/workflows/ci.yml
  • actions/checkout v4
  • actions/setup-node v4
  • actions/upload-artifact v4
.github/workflows/main.yml
.github/workflows/stale-branches.yml
  • crs-k/stale-branches v2.0.21
.github/workflows/stale.yml
  • actions/stale v8
helm-values
charts/civil-citizen-ui/values.yaml
helmv3
charts/civil-citizen-ui/Chart.yaml
  • nodejs 3.1.0
  • civil-service 0.0.67
  • ccd 9.0.21
  • xui-webapp ~1.0.16
  • idam-pr 2.3.0
  • camunda-bpm 0.0.44
  • servicebus 1.0.7
  • civil-general-applications 0.0.64
  • wa 1.0.6
  • ccd-message-publisher ~0.1.7
  • aac-manage-case-assignment ~0.2.13
npm
package.json
  • @codeceptjs/configure ^0.10.0
  • @hmcts/cookie-manager ^1.0.0
  • @hmcts/info-provider ^1.2.1
  • @hmcts/nodejs-healthcheck ^1.8.0
  • @hmcts/nodejs-logging ^4.0.4
  • @hmcts/os-places-client ^1.1.7
  • @hmcts/properties-volume ^0.0.14
  • @ministryofjustice/frontend ^1.6.3
  • @playwright/test ^1.41.2
  • @types/config ^3.3.0
  • @types/cookie-parser ^1.4.3
  • @types/cookie-session ^2.0.44
  • @types/csurf ^1.9.36
  • @types/es6-promisify ^6.0.1
  • @types/express ^4.17.21
  • @types/express-session ^1.17.5
  • @types/glob ^8.0.0
  • @types/helmet ^4.0.0
  • @types/lodash ^4.14.191
  • @types/luxon ^3.2.0
  • @types/multer ^1.4.7
  • @types/node ^18.11.10
  • @types/nunjucks ^3.2.1
  • @types/require-directory ^2.1.1
  • @types/serve-favicon ^2.5.1
  • applicationinsights ^2.9.5
  • axios ^1.3.0
  • boolean ^3.2.0
  • class-transformer ^0.5.1
  • class-validator ^0.14.0
  • codeceptjs ^3.3.7
  • config ^3.3.8
  • connect-redis ^7.1.0
  • cookie-parser ^1.4.6
  • cookie-session ^2.0.0
  • crypto-js ^4.2.0
  • csurf ^1.11.0
  • dayjs ^1.11.7
  • express ^4.19.2
  • express-async-errors ^3.1.1
  • express-nunjucks ^3.1.0
  • express-session ^1.17.3
  • follow-redirects 1.15.6
  • glob ^10.0.0
  • govuk-frontend 5.3.1
  • helmet ^7.0.0
  • i18next ^22.4.6
  • i18next-fs-backend ^2.1.1
  • i18next-http-middleware ^3.2.1
  • ioredis ^5.3.2
  • ioredis-mock ^8.2.6
  • jquery ^3.6.3
  • jsdom ^22.1.0
  • jwt-decode ^3.1.2
  • launchdarkly-node-client-sdk ^3.0.0
  • launchdarkly-node-server-sdk ^7.0.1
  • lodash ^4.17.21
  • luxon ^3.2.1
  • mocha ^10.2.0
  • mocha-multi 1.1.7
  • mochawesome 7.1.3
  • multer ^1.4.5-lts.1
  • nunjucks ^3.2.4
  • otplib ^12.0.1
  • reflect-metadata ^0.1.13
  • require-directory ^2.1.1
  • serve-favicon ^2.5.0
  • ts-node ^10.9.1
  • tsconfig-paths ^4.1.1
  • typescript ^4.9.5
  • validator ^13.7.0
  • @babel/core ^7.19.6
  • @babel/eslint-parser ^7.19.1
  • @babel/preset-env ^7.20.2
  • @types/copy-webpack-plugin ^10.1.0
  • @types/jest ^29.4.0
  • @types/supertest ^2.0.12
  • @typescript-eslint/eslint-plugin ^5.50.0
  • @typescript-eslint/eslint-plugin-tslint ^5.50.0
  • @typescript-eslint/parser ^5.50.0
  • babel-loader ^9.1.0
  • copy-webpack-plugin ^11.0.0
  • css-loader ^6.7.2
  • debug ^4.3.4
  • deep-equal-in-any-order ^2.0.2
  • eslint 8.33.0
  • eslint-plugin-codeceptjs ^1.3.0
  • html-webpack-plugin ^5.5.0
  • html_codesniffer ^2.5.1
  • jest ^29.4.1
  • jest-junit ^15.0.0
  • jest-launchdarkly-mock ^2.0.3
  • mini-css-extract-plugin ^2.7.2
  • nock ^13.2.9
  • node-cache ^5.1.2
  • nodemon ^2.0.22
  • pa11y ^6.2.3
  • sass ^1.57.1
  • sass-lint ^1.13.1
  • sass-loader ^13.2.0
  • sinon ^15.0.0
  • sonar-scanner ^3.1.0
  • style-loader ^3.3.1
  • supertest ^6.3.1
  • supertest-session ^4.1.0
  • totp-generator ^0.0.14
  • ts-jest ^29.0.3
  • ts-loader ^9.4.2
  • tslint ^6.1.3
  • uglifyjs-webpack-plugin ^2.2.0
  • uuid ^9.0.0
  • webdriverio ^8.3.2
  • webpack ^5.75.0
  • webpack-cli ^5.0.1
  • webpack-dev-middleware ^6.0.1
  • webpack-node-externals ^3.0.0
  • wiremock-standalone ^3.2.1
  • node >=14.0.0
  • minimatch ^3.0.5
  • node-fetch ^2.6.7
  • shelljs ^0.8.5
  • glob-parent ^6.0.1
  • qs ^6.9.3
  • flat ^5.0.1
  • debug ^4.3.4
  • semver ^7.5.2
  • minimist ^1.2.8
  • tough-cookie ^4.1.3
  • ip >=2.0.1
  • tar 6.2.1
  • braces ^3.0.3
  • yarn 3.5.0
nvm
.nvmrc
  • node v21.6.1
terraform
infrastructure/_state.tf
  • azurerm 3.75
infrastructure/app-insights.tf
infrastructure/key-vault.tf
infrastructure/redis.tf
terraform-version
infrastructure/.terraform-version
  • hashicorp/terraform 1.7.3

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.