Skip to content

Latest commit

 

History

History
139 lines (92 loc) · 3.63 KB

DEVELOPING.md

File metadata and controls

139 lines (92 loc) · 3.63 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: All the following wipes your local database.

This is executing e2e tests for all browsers:

chmod u+x e2e.sh
./e2e.sh

If you want to run only chromium:

docker compose stop

docker container prune -f

docker volume rm ris-norms_postgres14-data

docker compose build

docker compose up -d

cd frontend

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

docker run --name ris-norms-playwright-chromium -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--chromium

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