Read-only mirror of https://github.com/agridata-ch/backend — Bundesamt für Landwirtschaft. Issues & pull requests at the source. Catalog: https://www.opensource.admin.ch/en/softwares/3xfy5y https://www.opensource.admin.ch/en/softwares/3xfy5y
  • Java 94.2%
  • XSLT 5.7%
  • Shell 0.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
semantic-release-bot 913127eb9a chore(release): 1.16.0-rc.6 [skip ci]
## [1.16.0-rc.6](https://github.com/agridata-ch/backend/compare/v1.16.0-rc.5...v1.16.0-rc.6) (2026-08-26)

### Features

* **agreement:** introduce legally permitted consents ([ced0c0f](ced0c0ffe8)), closes [DIGIB2-1555](https://blw-ofag-ufag.atlassian.net/browse/DIGIB2-1555)
2026-08-26 13:17:22 +00:00
.github/workflows fix(deps): update dependencies 2026-08-26 13:16:43 +02:00
.idea feat(notifications): create web notification 2026-05-07 14:09:10 +02:00
.mvn/wrapper feat(init): Initial commit 2025-10-15 05:58:24 +02:00
.run feat(openapi-gernation): improves api generation at build time 2025-11-17 15:49:04 +01:00
.sonarlint feat(init): Initial commit 2025-10-15 05:58:24 +02:00
hooks feat(init): Initial commit 2025-10-15 05:58:24 +02:00
http feat(bit): remove deprecated bit seal api 2026-08-21 12:44:49 +02:00
scripts feat(api): add acontrol connection 2026-07-10 12:26:01 +02:00
src feat(agreement): introduce legally permitted consents 2026-08-26 15:09:14 +02:00
.dockerignore feat(init): Initial commit 2025-10-15 05:58:24 +02:00
.gitattributes feat(init): Initial commit 2025-10-15 05:58:24 +02:00
.gitignore feat(init): Initial commit 2025-10-15 05:58:24 +02:00
.owaspignore.xml fix(deps): update dependencies 2026-08-26 13:16:43 +02:00
.releaserc feat(init): Initial commit 2025-10-15 05:58:24 +02:00
.trivyignore fix(deps): update dependencies 2026-08-26 13:16:43 +02:00
CHANGELOG.md chore(release): 1.16.0-rc.6 [skip ci] 2026-08-26 13:17:22 +00:00
checkstyle.xml feat(data-request): add edit of redirect uri regex as admin 2026-03-18 14:58:13 +01:00
CLAUDE.md fix(ai): Cleanup CLAUDE.md context 2026-06-24 08:59:23 +02:00
Dockerfile fix(deps): update dependencies 2026-08-03 08:31:27 +02:00
LICENSE.md feat(init): Initial commit 2025-10-15 05:58:24 +02:00
mvnw feat(init): Initial commit 2025-10-15 05:58:24 +02:00
mvnw.cmd feat(init): Initial commit 2025-10-15 05:58:24 +02:00
pom.xml chore(release): 1.16.0-rc.6 [skip ci] 2026-08-26 13:17:22 +00:00
publiccode.yml feat(docs): add publiccode.yml 2026-02-02 08:47:12 +01:00
README.md fix(test-data): fix uid of BLW 2026-08-19 09:41:57 +02:00
renovate-config.js feat(deps): Require approval for renovate-bot PRs and update multiple dependencies: 2025-12-18 13:42:11 +01:00
renovate.json feat(init): Initial commit 2025-10-15 05:58:24 +02:00
THIRD_PARTY_LICENSES.md feat(init): Initial commit 2025-10-15 05:58:24 +02:00

agridata.ch Backend

This repository contains the backend services for the agridata.ch platform, built with Quarkus. It handles agricultural data exchange between producers, consumers, and data providers — including consent flows, data transfer pipelines, and integrations with external registries (AGIS, TVD, UID Register, BIT).


Prerequisites

  • Java 25
  • Maven 3.9.11 (or use the included ./mvnw wrapper)
  • Docker Desktop (required for DevServices — PostgreSQL, Keycloak, LocalStack, WireMock)

Getting Started

1. Register git hooks

git config --local core.hooksPath hooks && chmod +x hooks/*

2. Start the application

mvn quarkus:dev -Dquarkus.profile=local

Windows: Ensure Docker Desktop is running before executing this command.

Windows PowerShell: If you encounter unknown lifecycle phase ".profile=local", use:

mvn quarkus:dev --define quarkus.profile=local

DevServices automatically starts:

Service Port Purpose
PostgreSQL 5432 Primary database
Keycloak 6999 OIDC / authentication
LocalStack 4566 S3, SNS, SES (AWS emulation)
WireMock 8050 External API stubs

Useful local URLs

URL Description
http://localhost:8060/q/dev-ui Quarkus Developer UI
http://localhost:8060/q/swagger-ui Swagger UI (multi-subset)
http://localhost:6999 Keycloak admin console

Running Tests

# Unit tests only
mvn test

# Unit + integration tests
mvn verify

Integration tests require Docker Desktop — DevServices spins up a full Quarkus stack with DB and Keycloak. Unit tests have no infrastructure dependency.


Configuration

Database

  • Name: agridata
  • Username: admin
  • Password: secret
  • Data Persistence Path: .local-dev/postgres-volume

Keycloak

  • Realm: agate
  • Initial Import: agate_realm.json
  • Admin Credentials: admin / admin
  • Client: agridata-ui / secret

Updating the Keycloak realm config

User data cannot easily be exported from the Docker container, so manual steps are required:

  1. Backup the users section in agate_realm.json.
  2. Log into the Keycloak admin console at http://localhost:6999.
  3. Go to Realm Settings > Action > Partial Export.
  4. Replace agridata-ui.secret in the exported file with secret.
  5. Re-add the users section from your backup.
  6. Replace the original agate_realm.json with the updated version.

Local Users

These are predefined users in the local agate realm. All passwords are secret.

Data Producers

Role: agridata.ch.Agridata_Einwilliger

Username KT_ID_P loginid
producer-a FLXXA0001 3477580
producer-b FLXXB0001 3477581
producer-b-3 FLXXB0003 3477582
producer-c FLXXC0001 3477583
producer-d FLXXD0001 3477584
producer-e - (no farm registered) 3477585

Data Providers

Role: agridata.ch.Agridata_Datenanbieter

Username UID loginid
provider-1 CHE113614519 (BLW) 3477553
provider-2 CHE113614519 (BLW) 3477586

Data Consumers

Role: agridata.ch.Agridata_Datenbezueger

Username UID loginid
consumer CHE101708094 (Bio Suisse) 20154600
consumer-ip-suisse CHE110013660 (IP Suisse) 900000
consumer-blv-1 CHE403244345 (BLV) 3477588
consumer-blv-2 CHE403244345 (BLV) 3477589
consumer-blv-without-uid - 3477590

Other Users

Username Role loginid
admin agridata.ch.Agridata_Admin 3477554
support agridata.ch.Agridata_Support 3477555
guest - -

IDE Setup

The project targets Java 25 and uses Lombok for code generation. Configure your IDE before building.


Troubleshooting

unknown lifecycle phase ".profile=local" (Windows PowerShell)

PowerShell interprets the . in -Dquarkus.profile=local as a property accessor. Use --define instead:

mvn quarkus:dev --define quarkus.profile=local

Docker not running

All DevServices (PostgreSQL, Keycloak, LocalStack, WireMock) require Docker. Start Docker Desktop before running mvn quarkus:dev or mvn verify.