This repository is a hands-on workshop. It shows how to build maintainable backend services with Kotlin and Spring Boot.
The training is split into progressive modules. You can start from Kotlin syntax only, then move to Spring, coroutines, and advanced error modeling.
- A Kotlin Spring Boot REST API for a pet shop
- HTTP service-to-service communication
- Database access
- Local development with Docker Compose
- API exploration with Bruno collections
Recommended order for beginners:
exo0-kotlin- Kotlin language fundamentalsexo1-spring- Kotlin + Spring + JPAexo2-reactive- Coroutines and non-blocking I/Oexo3-advanced- Typed errors with ArrowEither
master-one-pet-data/: supporting HTTP service used by the exercises, see Start dependencies sectionbruno/: Bruno collections for manual API testing, see API Testing with Bruno sectionexo0-kotlin/,exo1-spring/,exo2-reactive/&exo3-advanced/: workshop exercises (one module per exercise). Start here: Exercise #0: Kotlin syntax
You need the following tools installed to run the exercises:
- Java 21 LTS
We recommend SDKMAN to manage Java versions. Example installation:
sdk install java 21.0.11-tem - Docker & Docker Compose
For instance, we have tested with Rancher Desktop
Optional but recommended:
- IntelliJ IDEA (Community is enough)
- Bruno (for manual API calls)
Run these commands before starting the workshop:
java -version
./mvnw -version
docker --version
docker compose versionExpected outcome:
- Java version starts with
21 - Maven wrapper runs without downloading errors
- Docker engine is running and
docker composecommand is available
-
Build image for
master-one-pet-dataservice:docker compose build
-
Start
master-one-pet-data(on 8081 port) andpostgresql(on 5432 port) services:docker compose up
-
Validate they are reachable:
master-one-pet-data: http://localhost:8081/actuator/health- PostgreSQL: exposed on
localhost:5432(user/password/db:devsummit)
-
Build and run the exercise you want to work on (e.g.
exo1-spring):./mvnw -pl exo1-spring spring-boot:run
-
The service will be available at
http://localhost:8080/(for usage with Bruno). -
You can also run integration tests (will use an ephemeral PostgreSQL database via TestContainer) with:
./mvnw -pl exo1-spring verify
For each exercise:
- Read the module README
- Run tests once before changing anything
- Implement one step
- Re-run tests
- Validate behavior in Bruno
Bruno collections are available in bruno/.
- Install Bruno
- Import the
bruno/directory - Run the provided requests against your local services
- Port already used (
8080,8081,5432): stop conflicting apps or change local port mapping. - Docker dependency startup fails: re-run
docker compose upand check container health. - Tests fail with "Could not find a valid Docker environment" error. Check that you have followed Testcontainer configuration for Rancher Desktop because Testcontainers needs three environment variables to locate the Docker socket and connect to container ports inside the VM