This repository contains web applications in the Digitalcheck context.
We aim to use the current active LTS version of nodejs, which is V20 at the time of writing.
There is a .node-version
file to simplify setup using nodenv.
Install the dependencies using npm.
npm install
For E2E and a11y testing with Playwright you will need to install the supported browsers:
npx playwright install
For the provided Git hooks you will need to install lefthook (git hook manager):
brew install lefthook
./run.sh init
The following hooks are specified in the lefthook.yml
:
commitlint
- write conventional commit messageslint
- avoid committing code violating linting rulesformat
- avoid committing wrongly formatted code
Before pushing, the following checks are additionally ran:
licenses-audit
- useslicense-checker
to verify dependency licenses
From your terminal:
npm run dev --workspace="packages/<app-name>"
This starts your app in development mode, rebuilding assets on file changes.
The applications have
- unit tests (using Jest)
- end-to-end tests (using Playwright)
- accessibility tests (using Playwright and Axe)
Test commands
- Run all tests:
npm run tests
- Run unit tests:
npm run test
- Run unit tests with watcher:
npm run test -- --watch
- Run E2E tests:
npm run test:e2e
- Run A11y tests:
npm run test:a11y
The project uses ESLint for linting and Prettier. for formatting.
Commands
- Check formatting:
npm run format:check
- Autofix formatting issues:
npm run format:fix
- Check lint:
npm run lint:check
- Autofix lint issues:
npm run lint:fix
- Check style (formatting & linting):
npm run style:check
- Autofix style issues (formatting & linting):
npm run style:fix
Build all apps for production:
npm run build
Preview the production build:
npm run start --workspace="packages/<app-name>"
Build and run an app locally to simulate the production environment.
npm run docker
You will br prompted to select which app to build and run.
After running this command, the website is then available under http://localhost:3000
Do the following steps to add a new application to this Monorepo.
- Create a new directory under
packages/
- Depending on the tech stack, make sure that:
- shared dependencies are configured in the top-level package.json
- the
tailwind.config.js
uses the top-level tailwind.preset.js - the
tsconfig.json
extends the top-level tsconfig-base.json
- The new project needs at least:
- a
package.json
which defines the project specific dependencies an implements the following scripts:build
: build the application for productiontest
: run unit teststest:e2e
: run e2e teststest:a11y
: run a11y teststests
: run all tests
- a
Dockerfile
which builds a Docker container from your application (and if needed aDockerfile.dockerignore
)
- a
- Add the application code. It should now be able to import shared components.
- Before proceeding with the next step, make sure the infrastructure of the application is in place. Follow the steps in the digitalcheck-apps-infra README.md.
- Update the pipeline.yml by copying an existing filter in the job
changes
and substituting the new application name. - You are done! The new application will be build and deployed on commit.
🇬🇧 Everyone is welcome to contribute the development of the Digitalcheck applications. You can contribute by opening a pull request, providing documentation or answering questions or giving feedback. Please always follow the guidelines and our Code of Conduct.
🇩🇪 Jede:r ist herzlich eingeladen, die Entwicklung der Digitalcheck Applikationen mitzugestalten. Du kannst einen Beitrag leisten, indem du Pull-Requests eröffnest, die Dokumentation erweiterst, Fragen beantwortest oder Feedback gibst. Bitte befolge immer die Richtlinien und unseren Verhaltenskodex.
🇬🇧 Open a pull request with your changes and it will be reviewed by someone from the team. When you submit a pull request, you declare that you have the right to license your contribution to the DigitalService and the community. By submitting the patch, you agree that your contributions are licensed under the MIT license.
Please make sure that your changes have been tested before submitting a pull request.
🇩🇪 Nach dem Erstellen eines Pull Requests wird dieser von einer Person aus dem Team überprüft. Wenn du einen Pull-Request einreichst, erklärst du dich damit einverstanden, deinen Beitrag an den DigitalService und die Community zu lizenzieren. Durch das Einreichen des Patches erklärst du dich damit einverstanden, dass deine Beiträge unter der MIT-Lizenz lizenziert sind.
Bitte stelle sicher, dass deine Änderungen getestet wurden, bevor du einen Pull-Request sendest.