Spring boot kotlin codebase containing real world examples (CRUD, auth, DDD) that adheres to the RealWorld spec and API.
This codebase was created to demonstrate a fully fledged fullstack application built with Spring boot kotlin including CRUD operations, authentication, routing, pagination, and more.
For more information on how to this works with other frontends/backends, head over to the RealWorld repo.
$ ./gradlew bootRun
$ docker run --rm -it -p 8080:8080 ghcr.io/raeperd/realworld-springboot-kotlin:master
$ docker compose up
- Configure backend database with flyway
$ SPRING_PROFILES_ACTIVE=develop ./gradlew bootRun
- Change profile to develop
$ ./api/run-api-tests.sh
$ ./gradlew test
- Spring Boot for Web API implementations
- Spring Data JPA for persistent layer
- H2 and MySQL for actual database
- Spring's
HandlerInterceptor
for security
./src/main/kotlin/io/github/raeperd/realworldspringbootkotlin/
├── domain
│ └── article
├── infrastructure
│ ├── jpa
│ └── security
│ └── jwt
└── web
└── jwt
- domain contains only domain logic without explicit dependencies
- infrastructure contains implementation details with external dependencies
- web contains API endpoints and spring web configurations
- Maintain 90% of code coverages
- Domain logics without external dependencies
- Allow-list for endpoints rather than block-list for authentication
- Reasonable database performance
- Avoiding N + 1 query problems
- Explicitly save entity
- Result of ./api/run-api-tests.sh in M1 Mac with 16GM of ram
- Java version implementation of this project from my repository raeperd/realworld-springboot-java
- Another kotlin spring boot implementation project gothinkster/kotlin-spring-realworld-example-app