Skip to content

Radar COVID European Federation Gateway Service (EFGS) Service

License

Notifications You must be signed in to change notification settings

RadarCOVID/radar-covid-backend-efgs-server

Repository files navigation

RadarCOVID EFGS Service

Introduction

EFGS Service in terms of the Radar COVID project enables the connectivity with EU Federation Gateway Service (EFGS).

Prerequisites

These are the frameworks and tools used to develop the solution:

Installation and Getting Started

Building from Source

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 using mvn spring-boot:run). It is the default profile, using application-local.yml configuration file.
  • docker-env. To run the application in a Docker container with docker-compose, using application-docker.yml configuration file.
  • pre-env. To run the application in the Preproduction environment, using application-pre.yml configuration file.
  • pro-env. To run the application in the Production environment, using application-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.

Running the Project

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.

EFGS Federation Gateway service

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

Database

This project doesn't use either Liquibase or Flyway because:

  1. DB-Admins should only have database privileges to maintain the database model (DDL).
  2. 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:

Modules

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.

Support and Feedback

The following channels are available for discussions, feedback, and support requests:

Type Channel
Issues

Contribute

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.

License

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.