The project is an implementation of a RESTfull API, and it serves as a playground for me test new concepts. It's developed primarily with Spring framework and Kotlin and another bunch of technologies
- Start a bunch of containers
docker-compose up -d database keycloak
- Run the app
./gradlew bootRun
- Check app health
curl http://localhost:8080/actuator/health
docker-compose up -d
will start all containers behind a nginx container exposed on port 80
This is a non-exhaustive list of some useful links:
- Actuator: http://localhost:8080/actuator
- Open API spec: http://localhost:8080/swagger-ui/index.html
- Keycloak admin console: http://localhost:8081/admin
- Keycloak account console: http://localhost:8081/realms/springstarter/account
Keycloak container import a sample realm with a couple of users and clients; check local/realm.json for details.
Get access token:
curl 'http://0.0.0.0:8081/realms/springstarter/protocol/openid-connect/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'client_id=springstarter' \
--data-urlencode 'username=bob' \
--data-urlencode 'password=supersecurepassword' \
--data-urlencode 'grant_type=password'
OpenAPI Generator Gradle plugin is used to generate code from Open API specifications with Spring generator, and they are defined in src/main/resources/specs .
Generate code
./gradlew openApiGenerate
Jib Gradle plugin is used to generate docker image, it's already configured as a part of the build steps. And there is a GitHub action that pushes the image to ghrc
Generate image
./gradlew jibDockerBuild
kotlin-spring
generator from OpenAPI generator does not yet support
@Tag
annotation (check #17211).