EFGS Service in terms of the Radar COVID project enables the connectivity with EU Federation Gateway Service (EFGS).
These are the frameworks and tools used to develop the solution:
- Java 11.
- Maven 3.6.
- Spring Boot version 2.3.
- Lombok, to help programmer. Developers have to include the IDE plugin to support Lombok features (ie, for Eclipse based IDE, go here).
- ArchUnit is used to check Java architecture.
- PostgreSQL.
- Testing:
- Spock Framework.
- Docker, because of using Testcontainers.
- Testcontainers.
- Monitoring:
To build the project, you need to run this command:
mvn clean package -P<environment>
Where <environment>
has these possible values:
local-env
. To run the application from local (eg, from IDE o from Maven usingmvn spring-boot:run
). It is the default profile, usingapplication-local.yml
configuration file.docker-env
. To run the application in a Docker container withdocker-compose
, usingapplication-docker.yml
configuration file.pre-env
. To run the application in the Preproduction environment, usingapplication-pre.yml
configuration file.pro-env
. To run the application in the Production environment, usingapplication-pro.yml
configuration file.
The project also uses Maven profile aws-env
to include dependencies when it is running on AWS environment, so the compilation command for Preproduction and Production environments would be:
mvn clean package -P pre-env,aws-env
mvn clean package -P pro-env,aws-env
All profiles will load the default configuration file.
Depends on the environment you selected when you built the project, you can run the project:
- From the IDE, if you selected
local
environment (or you didn't select any Maven profile). - From Docker. Once you build the project, you will have in
efgs-server-boot/target/docker
the files you would need to run the application from a container (Dockerfile
and the Spring Boot fat-jar).
If you want to run the application inside a docker in local, once you built it, you should run:
docker-compose up -d postgres
docker-compose run backend <job>
Where <job>
has these possible values:
uploadDiagnosisKeys
. To upload diagnosis keys to EFGS Gateway.downloadDiagnosisKeys
. To download diagnosis keys from EFGS Gateway.cleanBatchJobExecution
. To clean old information in database.
There are two ways to connect with EFGS Federation Gateway service:
- Normal. This option provides a connection with the third party service EFGS Gateway. It's necessary to provides gateway urls, so if you up gateway service in local you must change urls on
application.yml
.
application.efgs.upload-diagnosis-keys.url: localhost:<port>/diagnosiskeys/upload
application.efgs.download-diagnosis-keys.download.url: localhost:<port>/diagnosiskeys/download
application.efgs.download-diagnosis-keys.audit.url: localhost:<port>/diagnosiskeys/audit/download
- Simulate. This option returns mocks values and actually doesn't connect with third party services. To enable this option it's necessary to add the following properties on
application.yml
.
application.efgs.upload-diagnosis-keys.simulate: true
application.efgs.download-diagnosis-keys.simulate: true
This project doesn't use either Liquibase or Flyway because:
- DB-Admins should only have database privileges to maintain the database model (DDL).
- Applications should only have privileges to maintain the data (DML).
We use the same data model as DP3T but include some changes to support EFGS integration. To be able to launch EFGS integration on local environment we copied the SQL files from D3PT and add these 2 files:
V0_8__gaen_efgs.sql
. Script to add columns tot_gaen_exposed
table.V0_9__ddl_batch.sql
. Script to add tables needed to support batch processes (upload and download batches).
EFGS Service has four modules:
efgs-server-parent
. Parent Maven project to define dependencies and plugins.efgs-server-api
. DTOs exposed.efgs-server-boot
. Main application, global configurations and properties. This module also has integration tests and Java architecture tests with ArchUnit:efgs-server-service
. Business and data layers.
The following channels are available for discussions, feedback, and support requests:
Type | Channel |
---|---|
Issues |
If you want to contribute with this exciting project follow the steps in How to create a Pull Request in GitHub.
More details in CONTRIBUTING.md.
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.