A Microservice for URL shortening and sharing.
See: https://kf-strides-riff.kidsfirstdrc.org/swagger-ui.html for API documentation
The application can be run locally or in a docker container, the requirements for each setup are listed below.
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.
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 and versioning is managed by flyway.
- Download the flyway cli client here: flyway-commandline
- Unpack the client in a directory of your choosing
- 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.
$ mvn spring-boot:run
Application will run by default on port 1234
Configure the port by changing server.port
in application.yml
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.
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.
See https://kf-strides-riff.kidsfirstdrc.org/swagger-ui.html
TODO: Show folks some love.