~/talk

Creating Full-stack Web Apps with Kotlin DSLs

Talkat KotlinConf 2019 · 2019-12-04..12-06· [web-platform, kotlin]
slides:none on file

Builds a working full‑stack app called Life Visualizer using Ktor backend, Ktor HTTP client to call Unsplash, Exposed with H2 for storage, and kotlinx.html plus the React wrapper with Axios on the frontend; demo playback fails but the app and routes run. Shows concrete DSL techniques: Ktor routing & locations, lambdas with receivers and suspending functions for async HTTP, a small DB transaction helper and Exposed DSL for SQL‑like queries, and kotlinx.html for component HTML builders.

AI-written summary · about

  1. 0:00Intro
  2. 0:54PROJECT INTRODUCTION
  3. 4:13THE PROJECT PHILOSOPHY
  4. 4:33YOU CAN CALL IT BEAUTIFUL CODE WHEN THE CODE MAKES IT LOOK LIKE THE LANGUAGE WAS MADE FOR THE PROBLEM.
  5. 6:29What makes Kotlin a great language for DSLS?
  6. 7:33Lambdas with receivers
  7. 9:09BUILDING THE BACKEND WITH KTOR
  8. 9:23ktor is a Kotlin framework for creating asynchronous servers and clients
  9. 10:46THE FLEXIBILITY TO INCORPORATE DIFFERENT TOOLS IN ADDITION TO ITS LIGHT-WEIGHT ARCHITECTURE-MAKES KTOR AN INTERESTING OPTION FOR CREATING RESTFUL SERVICES
  10. 14:08Creating the application
  11. 15:07Setting up the routes (2)
  12. 18:18Route refinement - Locations
  13. 19:56Route refinement - Splitting into files
  14. 20:41Unsplash API
  15. 21:16Setting up the Ktor client
  16. 23:32DATA WITH EXPOSED
  17. 23:42Exposed is a light-weight SQL library written for the Kotlin language • Created and maintained by JetBrains
  18. 25:17Creating a table
  19. 26:05A clever little piece of Kotlin code
  20. 26:40Inserting data dbtransaction
  21. 27:55Querying data
  22. 30:14FRONTEND WITH KOTLINX.HTML
  23. 31:56Project setup with npm
  24. 32:20Creating a component step-by-step 1. Define a properties interface (Optional)
  25. 33:06Defining the properties interface
  26. 34:03Defining the state interface
  27. 34:29Creating the component
  28. 34:50Implementing the render method
  29. 36:06Implementing the builder
  30. 36:52Using a JavaScript library directly
  31. 37:57Creating the external functions and interfaces
  32. 39:11Using the functions
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.