https://kotlinlang.org logo
Title
h

hhariri

04/28/2021, 2:03 PM
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
❤️ 15
:ktor: 2
:kotlin-intensifies: 17
m

MarkRS

04/28/2021, 2:16 PM
Client accessing multiple endpoints. Client using multiple authorisations.
v

vonox7

04/28/2021, 2:32 PM
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

Carter

04/28/2021, 2:34 PM
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

christophsturm

04/28/2021, 2:35 PM
why do you use proguard to reduce the jar file size?
c

Carter

04/28/2021, 2:40 PM
The size was cut by more than half, which is significant. I’ve historically found that ProGuard also helps significantly with performance.
c

christophsturm

04/28/2021, 2:40 PM
on a server side app?
h

hhariri

04/28/2021, 2:41 PM
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

Carter

04/28/2021, 2:45 PM
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

MBegemot

04/28/2021, 2:50 PM
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

carrot

04/28/2021, 5:27 PM
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

napperley

04/28/2021, 9:14 PM
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

csieflyman

04/29/2021, 1:20 AM
Batch request processing with coroutine flow and mongodb asynchronous java driver
f

Fi5t

04/29/2021, 6:50 AM
Multi-ktor-modules backend service
c

CLOVIS

04/29/2021, 7:28 AM
Multipart requests in a Multiplattorm client (to upload files)
a

Abhishek Bansal

04/29/2021, 9:18 AM
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

Matteo Mirk

04/29/2021, 9:26 AM
@carrot a nice example of structuring a project can be found here https://github.com/dragneelfps/realworld-kotlin-ktor
f

Fi5t

04/29/2021, 6:48 PM
We need a real world example without
Exposed
framework 😃