Hands-On Kotlin Web Development with Ktor: Take advantage of the widely-adopted Kotlin language to build connected applications

Hands-On Kotlin Web Development with Ktor: Take advantage of the widely-adopted Kotlin language to build connected applications

English | MP4 | AVC 1920×1080 | AAC 48KHz 2ch | 7h 03m | 0.98 GB

Build web apps quickly and with less effort using Kotlin and Ktor

Ktor is a Kotlin-specific framework for building asynchronous client- and server-side web applications. It is one of the most widely-adopted and supported alternatives to Java for Android app development. Ktor has gained massive popularity remarkably quickly, and you’ll rapidly create connected applications in Kotlin with minimal effort.

This course provides hands-on training in a practical and engaging way to get you started building an end-to-end web application using Kotlin’s popular framework, Ktor. You will begin by swiftly covering Kotlin and Ktor basics (for this, you’ll benefit from some basic knowledge of Kotlin before starting this course).

You’ll cover setting up your project—which will be full-stack (client and server)—and create your web application in the Ktor framework using Kotlin as your language. You’ll cover some important Ktor features and solutions, and will cover routing and HTML Builder. You’ll also run your configured application and test it.

By the end of the course, you will have learned how to build web applications with Kotlin using the Ktor framework.

Learn

  • Understand the Ktor lifecycle, and how to install and configure Ktor features
  • Implement a JSON typesafe backend based on Ktor features
  • Organize your code in routes and in multiple Kotlin files
  • How to use path variables and request variables in endpoint implementation
  • Create multiple versions of your endpoints (to return different formats)
  • Error handling in your Ktor application with the Status Pages feature
  • Master authentication and test Ktor routes with unit tests
  • Master basic HTML and CSS DSL and deploy backends with Docker
Table of Contents

Getting Started with Kotlin and Ktor
1 The Course Overview
2 What is a backend
3 Why choose Ktor as backend
4 Creating our first project with IntelliJ plugin and ktor.start.io
5 Creating our first route that returns a string
6 Bookstore-application – Create and set up dependencies

Understanding the Ktor Lifecycle
7 Kotlin coroutine explained and demonstrated
8 Kotlin Extension explained and demonstrated
9 Ktor architecture and lifecycle explained
10 Ktor installation and configuration of features
11 Ktor routes in general
12 Calling 3rd party REST services
13 Endpoints for our book store. Get and post books
14 The PUT,POST,GET and DELETE Routes
15 Let Us Test the Endpoints with cURL

Working with Ktor REST API
16 Creating a REST API
17 Feature Content Negotiation
18 Conversion from Kotlin object to JSON with Jackson
19 Auto-update web application on build
20 Routes with path variables
21 Routes with request parameters
22 Getting and setting headers
23 Bookstore-application – Convert json to objects. Add search endpoints with request parameters

Ktor REST API – Error handling and authentication
24 Feature Status Pages
25 Data posted to the route endpoint
26 Basic Authentication on chosen endpoints
27 Routing interceptors – Check admin rights
28 CallLogging log all incoming requests
29 Metrics statistics on the usage of the endpoints
30 Bookstore-application – Add error handling and basic authentication to our book store

Persisting data with MongoDB
31 Starting up a MongoDb with Docker-compose and adding the MongoDB dependency
32 Insert data to a MongoDB
33 Updating and deleting data
34 Extracting data with a query
35 Sorting and paging
36 Bookstore-application – Saving, deleting and extracting books

Testing the Ktor application
37 Test strategy – No server context needed
38 Setting up a Ktor test
39 What is a good unit test
40 Performance testing with K6
41 Bookstore-application – Setup K6 and unit tests

A web UI with Ktor – HTML and CSS DSL
42 HTML DSL – Installing the feature and writing basic HTML
43 HTML DSL importing css
44 HTML DSL importing static files
45 CSS DSL – Installing the feature and writing basic CSS
46 CSS DSL rules
47 HTML Templating and passing variables
48 Bookstore-application – Create a login page
49 Bookstore-application – Create a Book search page
50 Bookstore-application – Create a Cart checkout page
51 Bookstore-application – Create receipt page

Prepare for deployment
52 Create a .jar file With Gradle
53 Docker multi-stage build – Build image
54 Docker multi-stage build – Execution image
55 Bookstore-application – Create a docker image and spin it up