Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump next from 14.2.18 to 14.2.21 in /web #2

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions web/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Dockerfile
.dockerignore
node_modules
npm-debug.log
README.md
.next
docker
.git
12 changes: 12 additions & 0 deletions web/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[{Dockerfile,Dockerfile.}*]
indent_size = 4
4 changes: 4 additions & 0 deletions web/.env.development.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Default
NEXT_PUBLIC_BASE_URL=http://localhost:3000
NODE_ENV=development
SERVICE_NAME="Participant Manager"
3 changes: 3 additions & 0 deletions web/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["next/core-web-vitals", "next/typescript"]
}
36 changes: 36 additions & 0 deletions web/.github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!-- markdownlint-disable-next-line first-line-heading -->

## Description

<!-- Describe your changes in detail. -->

## Context

<!-- Why is this change required? What problem does it solve? -->

## Type of changes

<!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply. -->

- [ ] Refactoring (non-breaking change)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would change existing functionality)
- [ ] Bug fix (non-breaking change which fixes an issue)

## Checklist

<!-- Go over all the following points, and put an `x` in all the boxes that apply. -->

- [ ] I am familiar with the [contributing guidelines](../docs/CONTRIBUTING.md)
- [ ] I have followed the code style of the project
- [ ] I have added tests to cover my changes
- [ ] I have updated the documentation accordingly
- [ ] This PR is a result of pair or mob programming

---

## Sensitive Information Declaration

To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including [PII (Personal Identifiable Information) / PID (Personal Identifiable Data)](https://digital.nhs.uk/data-and-information/keeping-data-safe-and-benefitting-the-public) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter.

- [ ] I confirm that neither PII/PID nor sensitive data are included in this PR and the codebase changes.
34 changes: 34 additions & 0 deletions web/.github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Security

NHS England takes security and the protection of private data extremely seriously. If you believe you have found a vulnerability or other issue which has compromised or could compromise the security of any of our systems and/or private data managed by our systems, please do not hesitate to contact us using the methods outlined below.

## Table of Contents

- [Security](#security)
- [Table of Contents](#table-of-contents)
- [Reporting a vulnerability](#reporting-a-vulnerability)
- [Email](#email)
- [NCSC](#ncsc)
- [General Security Enquiries](#general-security-enquiries)

## Reporting a vulnerability

Please note, email is our preferred method of receiving reports.

### Email

If you wish to notify us of a vulnerability via email, please include detailed information on the nature of the vulnerability and any steps required to reproduce it.

You can reach us at:

- [email protected]

### NCSC

You can send your report to the National Cyber Security Centre, who will assess your report and pass it on to NHS England if necessary.

You can report vulnerabilities here: [https://www.ncsc.gov.uk/information/vulnerability-reporting](https://www.ncsc.gov.uk/information/vulnerability-reporting)

## General Security Enquiries

If you have general enquiries regarding our cyber security, please reach out to us at [email protected]
51 changes: 51 additions & 0 deletions web/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local
.env

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts

# Playwright
/test-results/
/tests-examples/
/playwright-report/
/blob-report/
/playwright/.cache/

# Env
.env
.env.staging

# SSL
certificates
9 changes: 9 additions & 0 deletions web/LICENCE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# MIT Licence

Copyright (c) 2024 Crown Copyright NHS England.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 changes: 27 additions & 0 deletions web/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.PHONY: build-development
build-development: ## Build the development docker image.
docker compose -f docker/development/docker-compose.yml build
.PHONY: start-development
start-development: ## Start the development docker container.
docker compose -f docker/development/docker-compose.yml up -d
.PHONY: stop-development
stop-development: ## Stop the development docker container.
docker compose -f docker/development/docker-compose.yml down
.PHONY: build-staging
build-staging: ## Build the staging docker image.
docker compose -f docker/staging/docker-compose.yml build
.PHONY: start-staging
start-staging: ## Start the staging docker container.
docker compose -f docker/staging/docker-compose.yml up -d
.PHONY: stop-staging
stop-staging: ## Stop the staging docker container.
docker compose -f docker/staging/docker-compose.yml down
.PHONY: build-production
build-production: ## Build the production docker image.
docker compose -f docker/production/docker-compose.yml build
.PHONY: start-production
start-production: ## Start the production docker container.
docker compose -f docker/production/docker-compose.yml up -d
.PHONY: stop-production
stop-production: ## Stop the production docker container.
docker compose -f docker/production/docker-compose.yml down
125 changes: 125 additions & 0 deletions web/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# Participant Manager UI

User interface template for Screening services.

Built with [Next.js](https://nextjs.org/).

## Using Docker and Makefile

Development environment

```
make build-development
make start-development
```

Open [http://localhost:3001](http://localhost:3001).
Stop the development environment

```
make stop-development
```

## Running locally

Install the required dependencies using

```bash
pnpm install
# or
npm install
```

Then, run the development server:

```bash
pnpm dev
# or
npm dev
```

Open [http://localhost:3000](http://localhost:3000).

### Prerequisites

- [pnpm](https://pnpm.io/) package manager
- or [npm](https://nodejs.org/en) package manager

## Environment variables

Create a `.env` file which should override environment variables required to run locally:

```
# Default
NEXT_PUBLIC_BASE_URL=http://localhost:3000
NODE_ENV=development
SERVICE_NAME="UI template"
```

## Testing

### Unit tests

Unit tests are written using [Jest](https://jestjs.io/) and [React Testing Library](https://testing-library.com/docs/react-testing-library/intro/).

#### Running unit tests

To run unit tests, use the following command:

```
pnpm run test:unit
```

This will execute all unit tests and provide a summary of the tests results.

#### Running unit tests in watch mode

To run the unit tests in watch mode, use the following command:

```
pnpm run test:unit:watch
```

This will run the tests and re-run them whenever a file changes.

#### Coverage report

To generate a code coverage report, use the following command:

```
npm run test:unit:coverage
```

This will generate a coverage report in the `coverage` directory.

### End-to-end tests

End-to-end tests are written using [Playwright](https://playwright.dev/).

Before running end-to-end tests make sure your development server is running locally on `http://localhost:3000`. Using the command `pnpm run dev`.

#### Running end-to-end tests

To run the end-to-end tests, use the following command:

```
pnpm run test:e2e:ui
```

This will open the Playwright test runner, where you can run the tests interactively.

### Running end-to-end tests in headless mode

To run the end-to-end tests in headless mode, use the following command:

```
pnpm run test:e2e
```

This will run the tests in headless mode and output the results to the terminal.

## Licence

Unless stated otherwise, the codebase is released under the MIT License. This covers both the codebase and any sample code in the documentation.

Any HTML or Markdown documentation is [© Crown Copyright](https://www.nationalarchives.gov.uk/information-management/re-using-public-sector-information/uk-government-licensing-framework/crown-copyright/) and available under the terms of the [Open Government Licence v3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).
Loading
Loading