Skip to content

Latest commit

 

History

History
127 lines (84 loc) · 3.38 KB

DEVELOPING.md

File metadata and controls

127 lines (84 loc) · 3.38 KB

Development / Tech Notes

Here's what to know from a tech perspective.

Security note: Do not forget to run the lefthook setup below, including the setup of talisman. This ensures that secrets are caught before reaching the remote repository.

The Modules

Information on the modules can be found in their respective folder's README files:

The Main Repository

Architecture Decision Records

Architecture decisions are kept in the docs/adr directory.

For adding new records install the

See https://github.com/npryce/adr-tools for information on how to use adr-tools usage.

Git Hooks

The repository contains Git hooks which support

  • committing only properly formatted source code, not breaking the build
  • writing commit messages that follow some convention (wrt. the merits of having a convention , cf. this article)
  • preventing accidentally pushing secrets and sensitive information

Git Hooks Setup

In order to make use of the repository's Git hooks,

needs to be installed, which, in turn, makes use of the following CLI tools:

  • talisman - scans for secrets
  • gh - check CI status (optional)

Once these tools are available, install the hooks via

lefthook install

Slack notifications

Opt in to CI posting notifications for failing jobs to a particular Slack channel by setting a repository secret with the name SLACK_WEBHOOK_URL, containing a url for Incoming Webhooks.

How to run locally

Run dependencies from the root of the project:

docker compose up -d postgres14 redis

Run from ./backend:

./gradlew bootRun

More info on the backend part here.

Run from ./frontend:

npm i
npm run dev

More info on the frontend part here.

Visit: http://localhost:5173

Run using Docker

With Docker being installed (Compose Plugin needed) run following to start all containers:

docker compose up -d

Visit: http://localhost:8080

Watch the state by either of:

docker container ls
docker compose ls

To stop them:

docker compose down

Testing

Unit and Integration tests

Checkout the Frontend section here and for backend here.

Run E2E Tests with Playwright inside Docker

Be aware: This wipes your local database:

docker volume rm ris-norms_postgres14-data

docker compose build

docker compose up -d

cd frontend

docker build -t ris-norms-playwright -f DockerfilePlaywright .

docker run --name ris-norms-playwright -it --rm \
-e E2E_BASE_URL="http://nginx:8080" \
-e TZ="Europe/Berlin" \
--network ris-norms_default \
-v $(pwd)/test-results:/usr/src/app/test-results \
ris-norms-playwright

Screenshots for failed tests are stored in ./frontend/test-results/.