While most "todo" demos provide an excellent cursory glance at a framework's capabilities, they typically don't convey the knowledge & perspective required to actually build real applications with it.
Read the full blog post announcing RealWorld on Medium.
Over 100 implementations have been created using various languages, libraries, and frameworks.
Explore them on CodebaseShow.
In order for Real World back-end and front-end examples to be able to work together we need to follow a predefined openapi.yml.
If you're looking to contribute check-out CONTRIBUTING.MD. Also, this project participates in hacktoberfest!
I will provide personal guidance, and support to everyone that is interested in learning about Ktor, Arrow and Kotlin by contributing to this repository!
This example uses Kotlin with Ktor and Arrow as the main building blocks. Other technologies used:
- SqlDelight for the persistence layer
- Kotest for testing
- GraalVM to build an optional native binary
To run the project, you first need to start the environment.
This can be done with docker-compose up
,
and then you can start the Ktor server with ./gradlew run
.
docker-compose up
./gradlew run
curl -i 0.0.0.0:8080/readiness
Beware that ./gradlew run
doesn't properly run JVM Shutdown hooks, and the port remains bound.
The project can be built into a native image with GraalVM.
- Ensure a suitable GraalVM is installed
- Tested versions include:
- Oracle GraalVM 21+35.1 (project default)
- Oracle GraalVM 17.0.8
- Tested versions include:
- Build using
./gradlew nativeCompile
- An image will be built at
/build/nativeCompile/ktor-arrow-sample
- An image will be built at
- Start
./gradlew nativeRun
(remember todocker-compose up
)- Verify with
curl -i 0.0.0.0:8080/readiness
- Verify with
- Ktor uses reflection internally when calling either
call.receive()
orcall.respond()
- As a workaround, use
call.receiveText()
/call.respondText()
and (de)serialize manually
- As a workaround, use
nativeTestCompile
andnativeTestRun
are not supported currently