g8 bootstrap template for akka microservices with an graphql endpoint
This is a boilerplate template for a akka graphql microservice with slick and flyway database migration. You can use it to create your own GraphQL Services on top of the lightbend stack.
localhost:8080
src/main/resources/
) (application.conf in test has to stay as it is, for running in a in-memory postgresql instance)SQL_URL
- database url by scheme jdbc:postgresql://host:port/database-name
SQL_USER
- database userSQL_PASSWORD
- database passwordNIC_IP
- IP Address bounded to the http service default is 0.0.0.0NIC_PORT
- TCP Port used for the http service default is 8080USER_POOL
- Define an other cognito user pool than the preconfigured userpoolTo run application, call:
sbt run
If you wanna restart your application without reloading of sbt, use (revolver sbt plugin):
sbt re-start
For launching application in Docker, you must configure database docker instance and run docker image, generated by sbt.
Generating application docker image and publishing on localhost:
sbt docker:publishLocal
Example of running, generated docker image:
docker run --name akkaHttp -e SQL_USER=dbuser -e SQL_PASSWORD=dbpass -e SQL_URL=jdbcURL -d -p 9090:9000 APPLICATION_IMAGE
APPLICATION_IMAGE
- id or name of application docker imagelook at --link
parameter if the database is also a docker container
To run tests, call:
sbt test
To run all tests, with codecoverage, call:
sbt clean coverage test
To generate a coverage report afterwars the testrun, call:
sbt coverageReport
We will write a blog post soon on innFactory about microservice development.
Tobias Jonas
Copyright (C) 2017 innFactory Cloud- & DataEngineering
Published under the Apache 2 License.