Many folks have told us that they lack guidance on...
# ktor
h
Many folks have told us that they lack guidance on real-world samples with Ktor. We’re going to work on fixing this. Do let us know (either here or replying to the tweet), what you’d like to see. https://twitter.com/JetBrainsKtor/status/1387406887315025924
K 17
ktor 2
❤️ 15
m
Client accessing multiple endpoints. Client using multiple authorisations.
v
cool! • api example with json serialization/deserialization • websocket server • full web-application example of ktor+react frontend that allows to edit/persist e.g. a todo list
c
I recently spent a significant amount of time configuring deployment to Heroku and Google App Engine, especially around building a fat JAR to upload. The ProGuard configuration to reduce the size of the JAR was also complex, as some additional keep rules were needed that aren’t well documented. Some better guidance on the Gradle scripting needed for this would really help go from prototype on a desktop to something that can be deployed. Some of this complexity also relates to using Exposed and Postgres for the database layer.
1
c
why do you use proguard to reduce the jar file size?
c
The size was cut by more than half, which is significant. I’ve historically found that ProGuard also helps significantly with performance.
c
on a server side app?
h
Same question as Christoph. Is there a reason for using it on the server? Cause from my understanding, even Android no longer really requires it.
1
(talking about size)
c
For size, some kind of optimizer is really important on Android. The DEX limit isn’t really a concern anymore (the DEX limit was a maximum number of method references that could be bundled in an app which was fixed by adding multiple dex files), but there is a performance hit for each dex file that gets loaded. Also the larger the code size, the more memory is required at runtime.
The recommendations I’ve continued to hear from the Android team is that R8 for release builds is still important, especially with Compose.
2
m
One big issue for me is the differences running local server (for test purposes) vs deployed server (google cloud in my case), The thread policies are totally different so I've found that what works locally does not in deployed server. Unfortunately I guess that each deployment environment would have it's odds and nuts ....
1
c
I'd love to see samples that were a little larger (couldn't reasonably fit in one or two files) - to give hints on how to structure medium size projects that might not necessarily have tiny router blocks Also, examples of unit testing endpoints - I've previously gotten a lot of help from Ktor's own unit tests though
👍 5
n
Deployment of Ktor Server apps on Linux environments, and monitoring the health of a server via a visual dashboard (including alert notifications via email).
c
Batch request processing with coroutine flow and mongodb asynchronous java driver
f
Multi-ktor-modules backend service
c
Multipart requests in a Multiplattorm client (to upload files)
a
I have been spending time deploying a server-less micro-service using kotless + ktor. Having tough time to finding configuration stuff and parameters there. I would like to have samples with different deployment configurations.
m
@carrot a nice example of structuring a project can be found here https://github.com/dragneelfps/realworld-kotlin-ktor
f
We need a real world example without
Exposed
framework 😃