Skip to content

digitalservicebund/a2j-rechtsantragstelle

Repository files navigation

A2J - Digitale Rechtsantragstelle

First draft of implementing a platform to create requests to the Rechtsantragstelle.

interactive code map

Development

Requirements

  • Node.js >= 20.0.0
  • Docker (Redis dependency)
  • npm 7 or greater
  • A strapi instance and a configured .env file (see .env.example)

Run Server in Development Mode

npm install
docker compose up -d
npm run dev

This starts your app in development mode, rebuilding assets on file changes. Open the app in localhost:3000

Tests

Unit tests

  • run: npm run test
  • run with coverage: npm run test:coverage
  • run subset: npm run test -- -t "STRING_TO_MATCH"

E2E tests

  • run: npm run test:e2e
  • UI: npx playwright test --ui
  • debug (F10 to step over): npx playwright test --debug

Note

Remember to install playwright cli and set the environment variable GERICHTSFINDER_ENCRYPTION_KEY.

Write tests

Debug tests in CI

  1. download playwright-report.zip artifact from GitHub action summary page (only present on e2e failure for 30 days)
  2. unzip
  3. npx playwright show-trace <DOWNLOAD_PATH>/data/<HASH>.zip

Git Hooks

We use lefthook for running several pre-commit hooks,install them using npm run init.

The git hooks check formatting, linting, unit tests, typecheck (see lefthook.yaml for more details). You may execute them before commiting using lefthook run pre-commit.

How to add a new "Antrag" or form pdf to services/pdf/

  1. Create a new folder for example: prozesskostenhilfe
  2. Store the antrag or form pdf there: prozesskostenhilfe/Erklaerung_Verhaeltnisse_Prozess_oder_Verfahrenskostenhilfe.pdf
  3. Run npm run build:pdf

After running the command, a new file named prozesskostenhilfe.generated.ts will be generated in the specified directory. You can use this file to fill out the PDF based on the input fields defined within it.

Deployment

App and content are deployed seperately from each other. Refer to the following flow chart:

flowchart TD

    classDef e2eTest fill:#f56
    classDef deploy fill:#f96
    classDef artifact fill:#3f6

    subgraph registry
        latest_published_app([App image: a2j-rechtsantragstelle-app]):::artifact
        latest_published_content([Content image: a2j-rechtsantragstelle-content]):::artifact
        latest_published_prod([Production image: a2j-rechtsantragstelle]):::artifact
    end

    subgraph app-release
    commit_to_main[New commit to main] --> app_e2e
    app_e2e{{E2E test: new app and released content}}:::e2eTest --> build_app_container
    build_app_container -.push to registry.-> latest_published_app

    build_app_container[Build & publish app container] --> build_prod_container_with_new_app
    build_prod_container_with_new_app[Build & publish prod container] -.push to registry.-> latest_published_prod
    end

    subgraph content-release
    publish_content['Publish' button on strapi] --> content_e2e
    latest_published_app -.fetch image.-> content_e2e
    content_e2e{{E2E test: new content and released app}}:::e2eTest --> build_content_container
    build_content_container[Build & publish content container] -.push to registry.-> latest_published_content
    build_content_container --> build_prod_container_with_new_content
    build_prod_container_with_new_content[Build & publish prod container] -.push to registry.-> latest_published_prod
    end

    subgraph deployment
    latest_published_prod -.fetch image.-> deploy_to_staging:::deploy
    build_prod_container_with_new_app --> deploy_to_staging[Deploy to staging]
    build_prod_container_with_new_app --> deploy_to_preview:::deploy
    latest_published_content -.fetch image.-> app_e2e
    latest_published_prod -.fetch image.-> deploy_to_preview
    build_prod_container_with_new_content --> deploy_to_preview
    deploy_to_preview[Deploy to preview] --> e2e_against_preview
    e2e_against_preview{{E2E against preview}}:::e2eTest --> deploy_to_production
    latest_published_prod -.fetch image.-> deploy_to_production:::deploy
    deploy_to_production[Deploy to production] --> production_check[Verify production deploy]

    end

Storybook

We have a storybook instance running. On the Staging and preview environments it can be accessed via /storybook. In development mode, run the npm run start:storybook command.

Data update

License

npm run build:licenses

Airport

npm run build:airports-data

About

A2J project, work stream "Digitale Rechtsantragstelle" (aka RAST) - first iteration

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages 3