What ?!! Okay, let me clarify. Let’s build a complete backend /web-app with Kotlin and your favourite text-editor only. No, no need to install IntellJ IDEA, No need to handle Gradle file stuff .. seriously, No! All you need is a simple text-editor and Kotlin.So… how to do that ? For this recipe, we need two ingredients (apart from text-editor and Kotlin).I assume that you’ve installed and you are set with Atom or Sublime or Vim. Kotlin Installing and Kscript KTor A made GIF ;-) What is ?Ktor is a framework for building asynchronous servers and clients in connected systems using the powerful Kotlin programming language. KTor KTor is a web-framework built with Kotlin to make powerful webapps. This is the framework we are going to use. Ktor is a framework to easily build connected applications — web applications, HTTP services, mobile and browser applications. Modern connected applications need to be asynchronous to provide the best experience to users, and Kotlin coroutines provide awesome facilities to do it in an easy and straightforward way.If you want to read a more about Ktor check the description here . What is ?Enhanced scripting support for on *nix-based systems. Kscript Kotlin This is the interesting part. It is a maintained by which provides enhanced and awesome scripting support for Kotlin. Even you can use this tool for data/text processing and also to run Kotlin.kt files. Watch for more details and what Kscript can do. library @ HolgerBrandl this talk To install Kscript follow this procedure:If you have the installed you can skip directly to step Install You can follow instructions . or Run: sdkman 2. 1. sdkman here $ curl -s “ " | bash https://get.sdkman.io Then follow the instructions on the terminal screen to run something like this $ source "$HOME/.sdkman/bin/sdkman-init.sh" Install **Kscript**Once you have installed you can run this to install Kscript. (But prerequisite to Kscript is Kotlin and Maven, so make sure you’ve Kotlin on your machine. Simply, run and ).Now run the following command: 2. sdkman, $ sdk install kotlin $ sdk install maven $ sdk install kscript It’ll download the Kscript and will add it to your path. Let me give you a quick overview of Kscript, so that you’ll get an idea about it. To get started with Kscript and for complete reference please visit **.**The extension of file is or you can use . Add this line at top of your file (point to it in the shebang line). Inside of the file you can write any kotlin code. Check below simple . this repo .kts .kt #!/usr/bin/env kscript hello_world.kts #!/usr/bin/env kscript import java.util.* println("Belllloooo!!")//Rest of the code below And you can Run this using the following command. It has some compilation overhead so it’ll take some time. $ kscript hello_world.kts Please go through the to get more details of how to include library dependency, another file, Kotlin-opts, JVM-args etc. kscript repo Running a KTor Server Now let’s look at KTor. To use KTor, we’ve this dependency to use it with gradle. But, as I said, we are not maintaining any gradle file stuff at all. Here comes one of the best features of Kscript, is that you can declare library dependencies in the same file that you are working on. Let me show you what I mean by modifying the same file. compile "io.ktor:ktor-server-netty:0.9.4" hello_world.kts Here the is same as specifying the in file in your IntellJ IDEA. The repositories required for KTor are maven repos. Also the the specifies the artifact required for basic usage with Netty. @file:MavenRepository(...) repositor{} build.gradle @file:DependsOnMaven(...) The dependencies will be downloaded and cached when you will try to run the above file for the first time. To clear the cache you can run . kscript --clear-cache By modifying further the above file let’s see how we can start the server. I am modifying the same hello_world.kts file again. And you’re done. Just run the command . It’ll download the dependencies for the first time (takes a some time for compilation and downloading dependencies). You can ignore the warnings(something like SL4J etc). Visit the url on your browser. Hope you’ll possibly see something there :p $ kscript hello_world.kts http://localhost:8080 We’ve just created a simple server with a text-editor and a kotlin. For further completion you can check the server-backed development of KTor in For client side HTML-templating and requests handling check this of KTor. the documentation . documentation KTor is asynchronous server framework. I’ll be covering those topics in the next part of this series. So, stay tuned for the next post. Part-II is coming. Stay tuned ! Clap for me if you liked the story and follow me to get awesome recipes like this. Visit for more stuff. http://nikhya.me