Skip to content
This repository was archived by the owner on Feb 28, 2023. It is now read-only.

mfranzke/cwa-website

 
 


Mozilla HTTP Observatory Grade

About this RepositoryDevelopmentDocumentationSupport and FeedbackHow to contributeLicensingWeb Site


Corona-Warn-App: Website

About this Repository

This repository contains the source files of the official website for the Corona-Warn-App as it is available at coronawarn.app. For information about the project, please see our documentation repository.

Development

Requirements

You need the Node.js 18 (Active LTS) version of Node.js (which includes npm) to build the website.

In case you use a Mac computer with Apple Silicon, make sure that Rosetta is installed.

Getting started

Clone the repository and ensure you have the requirements (from above) installed. To build and display the website in a web browser, switch to the cwa-website base directory and execute the commands:

npm install
npm start
  • npm install installs the necessary packages to build, display and test the website on your local system. You only need to run this once or if the packages defined in package.json are changed.

  • The command npm start triggers the commands npm run build followed by npm run start-server described below and which can be used individually if desired. If you want to debug you can build the web and start the local server using the command npm run dev as an alternative to npm start.

Build

The command:

npm run build

builds the website and creates a new folder public in the repository's base directory. It contains the generated files for the complete website.

Start-Server

To view the generated content after using npm run build, execute the command:

npm run start-server

This command starts a local web server and a browser window is also automatically opened at http://localhost:8000 so that the website can be viewed. The web server uses public as its base directory. It also watches for file changes and refreshes the browser contents if necessary.

Depending on your network setup, you may also be able to view the website on a connected mobile device using http://<ip_address_of_localhost>:8000, for example http://192.168.0.100:8000.

Start-Fast

The command npm run start-fast is similar to the command npm run start: it builds the web then starts a web server, displaying the web site in a browser. The difference is that start-fast disables image compression which can shorten the build time.

Check and compare the build log line Finished 'build' after xx showing the time taken to build if you are experiencing long build times to see if it is helpful in your own environment.

Changing Things

Manuals for the most common use cases of updating website content are available in the docs folder.

Testing

Cypress is used to run End-To-End tests. Tests are located in the cypress/e2e folder and can be run with:

npm test

Since the full test includes testing of external links which can take 10 to 15 minutes to execute, a shorter version of the test is available, which excludes testing external links. It can be run with:

npm run test:short

To interactively run individual tests through the Cypress console use:

npm run test:open

To minimize the occurrence of errors we would ask you to perform all tests when contributing to our repository.

The production web https://www.coronawarn.app runs under the Ubuntu operating system with a case-sensitive file-system. To ensure gaps in testing are minimized, perform local tests preferably under Ubuntu.

Other operating systems, such as Microsoft Windows, which access files in a case-insensitive mode, may hide problems in testing if there is a mismatch between the upper/lower-case file naming and the reference to the file. This applies to Cypress tests and testing by hand.

Cypress cache

Executing npm install, as described in the Getting started section, caches a separate copy of Cypress on the system. If the cwa-website later specifies a different Cypress version and npm install is executed again, then any previously cached Cypress versions remain on the system. Each cached version uses about 0.5 GB of storage. To free up storage space by manually cleaning up unneeded cached Cypress versions, carry out the following steps:

To check which version of Cypress you have installed, execute the following command in a terminal window in the cwa-website base directory:

npx cypress version

To show which versions are cached and how much storage space they take up, execute:

npx cypress cache list --size

Then to remove other versions, apart from the currently used version, execute:

npx cypress cache prune

Notes for test developers

Best practice is to use data-e2e="your_test_id" element attributes to select specific elements, e.g. cy.get('[data-e2e="cta-button-1"]').click() instead of cy.get('.container .infobox a.button').contains('DOWNLOAD').click().

Included in Cypress Test Production? What is it used for?
check_links.js Detect broken links throughout the website. Result is saved in logs folder.
app_to_web.js Check that all links to the website used by the Android and iOS apps are working and that content is correctly displayed.
applink_spec.js Detect broken links or missing OS badges to download mobile app in home page.
blog_spec.js Check if blog archive is accessible.
check_anchor_links.js Detect broken anchor links throughout the website. Result is saved in logs folder.
check_videos.js Detect broken videos throughout the website.
eventRegistration.js Checks that all fields in event-registration exist and fill them to create a QR code.
faq.js Simulate a FAQ search and the result for mobile and desktop view.
hotline_spec.js Verify that Hotline APP and TAN data is correctly displayed on the home page.
mime.js Check that CSS and JS files have the correct MIME type. See https://developer.mozilla.org/en-US/docs/Glossary/MIME_type

To run all tests included in Cypress Test Production execute:

npx cypress run -s 'cypress/e2e/*.js' -c baseUrl=https://www.coronawarn.app --headed => test results are printed in the console, also you can see browser's movements

npx cypress run -s 'cypress/e2e/*.js' -c baseUrl=https://www.coronawarn.app --headless --browser chrome => test results are printed in the console, the browser is not displayed

Checking Markdown documents

Markdown documents which are used for publication to the website, such as in the blog directory, are checked through Cypress in the HTML code which the build process generates.

Links in other Markdown documents, such as this README file and files in the docs directory, can be checked through:

npm run checklinks

The checklinks script uses Unix commands. On a Microsoft Windows operating system, the Unix commands can be provided by git for Windows with its embedded Git BASH emulation. If you are using Command Prompt or Windows PowerShell on Windows instead of the Git BASH shell, then you need to execute the following command:

npm config set script-shell "C:\\Program Files\\git\\bin\\bash.exe" --location user

otherwise you may see an error message similar to "'xargs' is not recognized as an internal or external command, operable program or batch file."

Updating coronawarn.app

Any direct commits and merged pull requests will automatically trigger follow-up actions to build and deploy the changes to coronawarn.app. The respective GitHub Actions are available in the .github/workflows directory of this repository.

Documentation

The full documentation for the Corona-Warn-App can be found in the cwa-documentation repository. The documentation repository contains technical documents, architecture information, and white papers related to this implementation.

Support and Feedback

The following channels are available for discussions, feedback, and support requests:

Type Channel
General discussion, issues, bugs
Other requests

How to contribute

The German government has asked SAP and Deutsche Telekom AG to develop the Corona-Warn-App for Germany as open source software. Deutsche Telekom is providing the network and mobile technology and will operate and run the backend for the app in a safe, scalable and stable manner. SAP is responsible for the app development, its framework and the underlying platform. Therefore, development teams of SAP and Deutsche Telekom are contributing to this project. At the same time our commitment to open source means that we are enabling -in fact encouraging- all interested parties to contribute and become part of its developer community.

For more information about how to contribute, the project structure, as well as additional contribution information, see our Contribution Guidelines. By participating in this project, you agree to abide by its Code of Conduct at all times.

Repositories

A list of all public repositories from the Corona-Warn-App can be found here.

Licensing

Copyright (c) 2020-2023 Deutsche Telekom AG and SAP SE or an SAP affiliate company.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.

You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the LICENSE for the specific language governing permissions and limitations under the License.

The "Corona-Warn-App" logo is a registered trademark of The Press and Information Office of the Federal Government. For more information please see bundesregierung.de.

About

Corona-Warn-App website

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 93.6%
  • SCSS 3.8%
  • HTML 2.6%