Learning Ktor In 7 Days (server side Kotlin)

Опубликовано: 31 Октябрь 2024
на канале: Cody Engel
27,559
812

Join My Newsletter 👉 https://www.engel.dev/

Learning Ktor in 7 days was not something I thought was possible, but to my surprise I was able to do it. For those unaware, ktor is an asynchronous framework for creating microservices, web applications, and APIs. This backend framework for Kotlin is fun, free, and open source. Basically if you are using Kotlin spring boot, you are doing it wrong. If you want to check out the finished project go to https://engel.dev

🚶‍♂️ FOLLOW ME 🚶‍♂️
Website - https://engel.dev
Discord -   / discord  
Twitter -   / codyengeltweets  
Medium -   / codyengel  

📝 DESCRIPTION 📝
Ktor is a networking framework for Kotlin that allows you to build servers and clients. Ktor clients are multiplatform ready which allows sharing code between Android, iOS, and JavaScript, while we don't cover that in this video it is a really unique feature that is worth mentioning.

If you are looking at how to become an expert in Ktor this video won't have all of the answers, although it will help you with getting started with Ktor.

We start out by walking through the official tutorial for creating HTTP APIs with Ktor, followed by writing my first API to retrieve recent YouTube videos. I also take a detour to add Google Cloud Datastore as a light caching layer.

On the third day I wanted to focus on how to run Ktor inside of a Docker container and in the span of 30 minutes I was doing just that. With a lot of extra time I decided to deploy Ktor to Google Cloud Run and also had the chance to use Google Cloud Build.

The fourth day had me creating another API, this time it was for adding email addresses to my Mailchimp account. At this point I had to learn more about error handling with Ktor and also added some much needed instrumentation.

The fifth and final day was deployment day. I packaged everything up and pushed it up to Google Cloud Run. I also deployed my static website to Google Cloud Storage and set up a load balancer to direct traffic correctly.

📚 RESOURCES 📚
Website - https://engel.dev
Source Code - https://github.com/CodyEngel/EngelDev
Creating HTTP APIs with Ktor - https://ktor.io/docs/creating-http-ap...
Ktor with Docker - https://ktor.io/docs/docker.html
Hosting a static website with Google Cloud Storage - https://cloud.google.com/storage/docs...
Deploying container images to Google Cloud Run - https://cloud.google.com/run/docs/dep...

⏰ TIMESTAMPS ⏰
0:00 - Intro
0:45 - The Ktor HTTP APIs Tutorial
4:12 - Recent YouTube Videos with Ktor
7:32 - Running Ktor Inside of Docker
9:38 - Email Marking with Ktor
12:02 - Deploying Ktor to Google Cloud Run

🎥 CAMERA GEAR 🎥
Camera - https://amzn.to/2LM9Zt3
Lens - https://amzn.to/3g0HING
Microphone - https://amzn.to/37AAj2G
Recorder - https://amzn.to/3lwCNVE
Main Lights - https://amzn.to/3vUWRpw
External Monitor - https://amzn.to/2YoM2Kl
Note: the above links are affiliate links.

🖥 DESK GEAR 🖥
Monitor - https://amzn.to/2yjZPqR
Headphones - https://amzn.to/2YBuo68
MacBook Pro 2019 - https://amzn.to/30YyuXy
Note: the above links are affiliate links.

Try Epidemic Sound: https://www.epidemicsound.com/referra...

#softwareengineer #softwaredeveloper