Skip to content

ita-social-projects/dokazovi-be

Repository files navigation

Dokazovo

Build Status Coverage Github Issues Pending Pull-Requests License

The "Dokazovo" project is a platform where proven experts will provide only verified information about COVID-19 disease in Ukraine and other scientific and medical topics. The main aim of the "Dokazovo" project is to prevent the spread of infodemic. А user will be able to learn and use only verified and reliable medical information, advice and recommendations.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites - Required software

  • Java 11
  • PostgreSQL (9.5.9 or higher)
  • Redis (optional; tested with 6.2.5) - see below

Installing

Clone this repository to your local machine using:

git clone https://github.com/ita-social-projects/dokazovi-be

Create a database and set values in environment variables:

environment

Run application and open Swagger

Running the tests

Run all tests for this system

./gradlew test

Check code coverage

Run:

./gradlew jacocoTestReport

Open the report file: /build/reports/jacoco/test/index.html

Coding style tests

Check code style for the application:

./gradlew checkstyleMain

Check code style for tests:

./gradlew checkstyleTest

Running Postgres and Redis using Docker (Desktop)

Please note that this config is designed for the default Spring Datasource configuration, so there is no need to set DATASOURCE environment variables explicitly if you use this.

...

Install Docker Desktop if you are on Windows or macOS.

On Linux feel free to choose between Docker Desktop or Docker Engine, but remember that the latter one will be lighter on your hardware, even though without a graphical user interface.

After installing Docker, navigate to the dokazovi-be root directory and run (works on all systems):

$ docker-compose up -d

This will start next environment services:

  • Postgres, localhost:5432
  • Adminer (a simple admin panel for databases), localhost:5433
  • Redis, localhost:6379

To shut the environment down, run in the same directory:

$ docker-compose down

You should also be able to use docker-compose from your IDE.

Installing Redis manually

The easiest way to install latest Redis on Windows 10+ is using WSL2 - to do that, install Ubuntu 20.04 from Microsoft Store and run next commands:

$ sudo add-apt-repository ppa:redislabs/redis
$ sudo apt update
$ sudo apt install redis

Now you can use Redis by running commands below:

# launch redis in the current shell, on port 6379
$ redis-server

# connect to a running redis instance 
$ redis-cli

On macOS, you can install it from Homebrew.

On Ubuntu refer to instructions above; on other GNU/Linux distributions refer to the docs available for them.

After starting Redis, set REDIS_HOST, REDIS_PORT environment variables to their corresponding values if they do not match defaults, and set SPRING_PROFILE=prod. Please note that this is not supported on the dev Spring profile.

Deployed Apps and Additional Links

RC Java - the latest version from the release branch is automatically deployed to Heroku

RC React - release candidate from react team

React team repository

Built With

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Copyright 2020 © SoftServe IT Academy