Giter VIP home page Giter VIP logo

koronavilkku-backend's Introduction

Finnish COVID-19 Application Backend

Contents

  • exposure-notification: The exposure notification service for receiving and distributing infection keys and parameters
  • publish-token: The publish token generation and verification service for ensuring that only verified infections get reported

Building

The project uses maven wrapper (mvnw).

This root package contains the others as modules, so you can build it all from here:

./mvnw clean package

... or on windows

mvnw.cmd clean package

Since the wrapper is in the root directory, you need to refer to it appropriately if going into the subprojects to build them individually:

cd exposure-notification
../mvnw clean package

Database Migrations

Each service handles its own schema (en for exposure-notification and pt for publish-token), migrating them via Flyway as needed. They don't cross-use each other's data so service update/startup order should not matter. If desired, the services can be configured not to even see each other's schemas.

In development environment, you may want to use the property -Dspring.flyway.clean-on-validation-error=true. This allows you to edit the schema definitions freely and have flyway simply reset the database when you make an incompatible change. Obviously, you never want to deploy that setting into production environments though, as you will lose all data.

Running Locally

Requirements

  • JDK 11
  • PostgreSQL 12 (either directly, or docker for running in a container)

Quick Startup

  • The easiest way to get postgresql for development is via docker, for instance (using the official image in docker hub):
    docker run \
    --name covid19-db \
    -p 127.0.0.1:5433:5432 \
    -e POSTGRES_DB=exposure-notification \
    -e POSTGRES_USER=devserver \
    -e POSTGRES_PASSWORD=devserver-password \
    postgres:12
    
    • You can set the database to store the files in a location of your choosing by adding the parameter
      -v my-local-db-dir:/var/lib/postgresql/data
      
    • If you vary the parameters (username/password/port), just update them for each service src/resources/application-dev.yml
  • Build both applications: ./mvnw clean package
  • Start exposure-notification service
    cd exposure-notification
    java \
      -Dspring.profiles.active=dev \
      -jar target/exposure-notification-1.0.0-SNAPSHOT.jar \
      fi.thl.covid19.exposurenotification.ExposureNotificationApplication
    
  • Start publish-token service
    cd publish-token
    java \
      -Dspring.profiles.active=dev \
      -jar target/publish-token-1.0.0-SNAPSHOT.jar \
      fi.thl.covid19.publishtoken.PublishTokenApplication
    

koronavilkku-backend's People

Contributors

jyrkija avatar ezzkoram avatar solita-alperttiti avatar todeveni avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.