kotlinweb-applicationsktorspring-kotlin

Can we build a full stack webapp with kotlin?


Kotlin official documentation tells that it supports web development. And its replacement for java. I am trying to build a web application using Kotlin. So far I read so many blogs, courses and videos in YouTube but I did not succeed coming up with a flow. I came across this link https://medium.com/bcgdv-engineering/building-a-full-stack-web-app-in-kotlin-af8e8fe1f5dc and I could not proceed with this alone. I only need a front end and connect to my server with normal http request. Is there any right way of doing a web app in kotlin. Please help me with this. Thanks in advance!


Solution

  • What I use for developing web apps in Ktor:

    Front-End:

    There is also Kotlinx.html and KotlinJS if you need to write them Kotlin Style and they are official toolset from JetBrains.

    Kotlinx.HTML Github

    KotlinJS

    You can add functionality to Ktor itself (they are called features):

    Features:

    Ktor website has detail documentation for all of these features and adding them in your project is so easy.

    For the IDE side:

    For webserver engine:

    You can easily develop API and Wen Apps using Ktor amazing DSL (Domain Specific Language)

    The only problem that I have is with Kotlin Coroutines which I hate, and prefer RxKotlin for developing asynchronous apps, it seems that's possible but there are not enough tutorials and samples out there to get started with it. + If you stuck on something new and challenging, you are on your own, as there are not enough samples and guides on the internet.

    But at the end of the day, I only recommend Ktor to those android developers who don't want to learn web development language e.g. PHP, Phyton, Javascript, like myself.