Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.
/ riff Public archive
forked from overture-stack/riff

🚧 A Microservice for URL Shortening and sharing.

License

Notifications You must be signed in to change notification settings

kids-first/riff

 
 

Repository files navigation

Riff


A Microservice for URL shortening and sharing.

Release Candidate

Table of Contents

Introduction

License: AGPL v3 Codacy Badge CircleCI Slack

Features

See: https://kf-strides-riff.kidsfirstdrc.org/swagger-ui.html for API documentation

Requirements

The application can be run locally or in a docker container, the requirements for each setup are listed below.

Keycloak

A running instance of Keycloak is required to generate the Authorization tokens and to verify the tokens.

Keycloak can be run locally in a docker container see here or you can use the QA instance.

Local

Docker

PostgreSQL

Easy to run in a docker container:

docker run --name Riff_PostgreSQL -e POSTGRES_PASSWORD=postgres -e POSTGRES_USERNAME=postgres -p 5432:5432 -d postgres

Make sure to create database and the schema (see flyway migration scripts).

Database Migrations with Flyway

Database migrations and versioning is managed by flyway.

  1. Download the flyway cli client here: flyway-commandline
  2. Unpack the client in a directory of your choosing
  3. Execute the flyway client pointing it to the configuration and migration directories in this repository.

Get current version information:

./flyway -configFiles=<path_to_riff>/riff/src/main/resources/flyway/conf/flyway.conf -locations=filesystem:<path_to_riff>/riff/src/main/resources/flyway/sql info

Run outstanding migrations:

./flyway -configFiles=<path_to_riff>/riff/src/main/resources/flyway/conf/flyway.conf -locations=filesystem:<path_to_riff>/riff/src/main/resources/flyway/sql migrate

To see the migration naming convention, click here.

Run Local

$ mvn spring-boot:run

Application will run by default on port 1234

Configure the port by changing server.port in application.yml

Run Docker

First build the image:

$ docker-compose build

When ready, run it:

$ docker-compose up

Application will run by default on port 1234

Configure the port by changing services.api.ports in docker-compose.yml. Port 1234 was used by default so the value is easy to identify and change in the configuration file.

Testing

The easiest way to test your dev is to run RiffIntregrationTest, it starts a DB postgres and a keycloak server.

It also starts a riff server and send some requests to it.

Feel free to add integration tests in it if needed.

API

See https://kf-strides-riff.kidsfirstdrc.org/swagger-ui.html

Acknowledgements

TODO: Show folks some love.

About

🚧 A Microservice for URL Shortening and sharing.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 93.5%
  • HTML 2.4%
  • Shell 2.1%
  • Dockerfile 2.0%