<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ilia Shevtsov on Medium]]></title>
        <description><![CDATA[Stories by Ilia Shevtsov on Medium]]></description>
        <link>https://medium.com/@iliashevtsov?source=rss-769079413da1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*jVwZDGfuh-QYc9Spzlp51Q.jpeg</url>
            <title>Stories by Ilia Shevtsov on Medium</title>
            <link>https://medium.com/@iliashevtsov?source=rss-769079413da1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 01:26:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@iliashevtsov/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Class Constructors in Kotlin: A Beginner’s Guide]]></title>
            <link>https://medium.com/@iliashevtsov/kotlin-constructors-a-beginners-guide-20210155c5b8?source=rss-769079413da1------2</link>
            <guid isPermaLink="false">https://medium.com/p/20210155c5b8</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[interview-tips]]></category>
            <category><![CDATA[interview-preparation]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[guides-and-tutorials]]></category>
            <dc:creator><![CDATA[Ilia Shevtsov]]></dc:creator>
            <pubDate>Tue, 24 Jan 2023 23:37:54 GMT</pubDate>
            <atom:updated>2023-05-12T13:56:25.401Z</atom:updated>
            <content:encoded><![CDATA[<p>If you have spent even a day coding, you have probably worked with constructors, maybe even without knowing about it. I never knew that the brackets that follow the class name are called a “primary” constructor or that your can have additional ones.</p><p>In this post I will tell you all about them, how you can use them and how they work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/831/1*zH9JpyWi-pYP3cjpdx0-sQ.png" /><figcaption>A class with a primary constructor and two additional ones.</figcaption></figure><p>Constructors are an essential part of creating objects in Kotlin. They are special functions that are called when an object of a class is created, and are used to initialize the state of the object and perform other tasks such as setting up resources or validating arguments.</p><p>In Kotlin, the compiler automatically generates a default constructor for a class without any parameters. However, in certain situations, it may be necessary to define custom constructors with additional functionality. To do this, the “constructor” keyword is used after the class name.</p><p>Classes in Kotlin can have a <strong>Primary Constructor</strong> and one or more <strong>Secondary Constructors</strong>.</p><h3>Primary constructor</h3><p>The primary constructor is defined immediately after the class name and can have parameters, like regular functions. For example, in the following code, the parameter is “name” of type String:</p><pre>class Person constructor(val name: String) {<br>    // class body<br>}</pre><p>If the class does not have any annotations or access modifiers, the constructor keyword can be omitted:</p><pre>class Person(val name: String) {<br>    // class body<br>}</pre><p>You should remember that the primary constructor cannot contain executable code.</p><h4>Declaring and initializing properties</h4><p>In Kotlin, there is a simple way to create and initialize properties when using the primary constructor. Instead of declaring a property and then initializing it separately, you can do it all in the constructor using a concise syntax. It looks like this:</p><pre>class Person(<br>  val fristName: String,<br>  val lastName: String,<br>  var age: Int<br>)</pre><h4>Default Values</h4><p>One of the benefits of using the primary constructor is the ability to assign default values to the constructor’s parameters. This can be particularly useful when creating objects where certain properties are optional or have a common value across instances.</p><pre>class Person(<br>  val firstName: String, <br>  val lastName: String, <br>  var isEmployed: Boolean = true<br>)</pre><p>Here the parameter isEmployed is set to true by default.</p><h4>Annotations and visibility modifiers</h4><p>In case the constructor has annotations or visibility modifiers, the constructor keyword is required, and the modifiers are placed <strong>BEFORE</strong> it:</p><pre>class MyClass @Inject constructor(val name: String) {<br>    // class body<br>}</pre><p>The constructor is annotated with @Inject which can be used for dependency injection, and the constructor keyword is required to indicate that this is a constructor.</p><p>The constructor keyword can also be used with visibility modifiers such as public, private, protected like this:</p><pre>class MyClass private constructor(val name: String) {<br>    // class body<br>}</pre><p>In this example, the class MyClass has visibility modifier private which means this constructor can be accessed only within the class.</p><h3>Secondary constructors</h3><p>The class may also contain one or more additional constructors. It looks like this:</p><pre>// Primary constructor <br>class User(<br>   var firstName: String, <br>   var lastName: String, <br>   var isPlatinum: Boolean = false<br>) {<br><br> // First additional constructors<br>    constructor(firstName: String, lastName: String<br>    ): this(firstName, lastName, false) {<br>        println(&quot;isPlatinum is False by default.&quot;)<br>    }<br>// Second additional constructors<br>    constructor(firstName: String): this(firstName, &quot;Unknown&quot;){<br>        println(&quot;I&#39;m in the 3rd constructor.&quot;)<br>    }<br>}<br><br>// main function<br>fun main() {<br>    var user = User(&quot;Donn&quot;, &quot;Felker&quot;, true)<br>    var friend = User(&quot;Jane&quot;, &quot;Doe&quot;)<br>    var cousin = User(&quot;Nick&quot;)<br>}</pre><p>As you can see, the class User has a <strong>primary constructor</strong> that takes three parameters firstName, lastName and isPlatinum (notice that the last parameter is set to false by default) and also <strong>two additional constructors.</strong> The <strong>first one</strong> takes two parameters firstName and lastName and the <strong>second one</strong> takes only one parameter firstName.</p><h4>Importance of “this” keyword</h4><p>The this keyword is used in <strong>secondary constructors</strong> to refer and call the primary constructor, passing required parameters to it. In cases where a class has multiple additional constructors, the this keyword is used to call the previous constructor in the chain.</p><p>This helps in initializing properties defined in the primary constructor before initializing properties defined in the secondary constructors. By delegating the initialization of properties to the primary constructor, it ensures that the class’s properties are always in a consistent state.</p><h4>Why use additional constructors?</h4><p>Additional constructors can be used to create an instance of a class using any number of parameters available to you.</p><p>In our example you can create an instance of the class using the primary constructor by passing all of the three parameters, using the first additional constructor by passing two parameters or the last one by passing only one parameter.</p><p>Depending on the number of parameters passed, the corresponding constructor will be called and the properties will be initialized.</p><h4>Main function code Sequence</h4><p>It is easier to understand how this works if we look at it as a sequence of code execution. Let’s break down what happens when we call the main function in our code example:</p><ol><li>When creating the user object, the primary constructor is called with all three parameters firstName, lastName and isPlatinum. All good the object is created.</li><li>When creating the friend object, we are passing only two parameters: firstName and lastName. Here the first additional constructor is called. It than calls the primary constructor passing those two parameters and prints the massage &quot;isPlatinum is False by default” since the third parameter is set to “False” in the primary constructor. After this the object is created.</li><li>When creating the cousin object, we are only passing one parameter – firstName. Here the second additional constructor is called. It than calls the first additional constructor passing “Nick” as the firstName and default value “Unknown” as lastName. Finally, the primary constructor is called who sets isPlatinum to “False” since it’s the default value. The massage “I&#39;m in the 3rd constructor.” Is printed after which the object is created.</li></ol><h3>Conclusion</h3><p>In conclusion, constructors play a vital role in creating objects in Kotlin. They initialize the state of an object, set up resources, and validate arguments. You might not need this information in the begging of your coding journey, but believe me, you will at some point and I hope you could use this post to freshen up your knowledge on the nature of constructors in Kotlin.</p><h3>If you enjoyed the post</h3><p>If you enjoyed this post, please, consider following my page, as I will be posting more <a href="https://medium.com/@iliashevtsov/list/software-development-7fb179e2c297"><strong>Software Development</strong> <strong>content</strong></a> in the future.</p><p>I also plan on posting other interesting things, such as <a href="https://medium.com/@iliashevtsov/list/quality-youtube-channels-16db077ed248"><strong>Quality YouTube Channels</strong></a> I have found in my years on the internet and also some other <a href="https://medium.com/@iliashevtsov/list/music-and-art-09061c68851a"><strong>more personal things</strong></a><strong>.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*kH1DmZQVQiTU_j3SUvSH6w.png" /><figcaption>Don’t mind this, its here for the thumbnail :)</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=20210155c5b8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kotlin Data Classes: Understanding the Basics for Android Interviews]]></title>
            <link>https://medium.com/@iliashevtsov/kotlin-data-classes-understanding-the-basics-for-android-interviews-534dc993c589?source=rss-769079413da1------2</link>
            <guid isPermaLink="false">https://medium.com/p/534dc993c589</guid>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[guides-and-tutorials]]></category>
            <category><![CDATA[data-class]]></category>
            <category><![CDATA[interview-questions]]></category>
            <dc:creator><![CDATA[Ilia Shevtsov]]></dc:creator>
            <pubDate>Sun, 22 Jan 2023 18:22:46 GMT</pubDate>
            <atom:updated>2024-08-20T04:23:50.853Z</atom:updated>
            <content:encoded><![CDATA[<p>Here are some common questions about Kotlin Data Classes that are asked when doing an Android Developer Interview. This is not a comprehensive guide to Data Classes, but simple or even basic things and answers you should know about.</p><p>If you enjoyed this post, please, consider following my page, as I will be posting more <a href="https://medium.com/@iliashevtsov/list/software-development-7fb179e2c297"><strong>Software Development</strong> <strong>content</strong></a> in the future.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V5CGiuHFJ8kzKgMYtp9uBA.jpeg" /></figure><h3>“What is a Data Class?”</h3><p>Firstly, let’s define what a Data Class is. Simply put, a <strong>Data Class — is a class whose primary purpose is to store data.</strong></p><p>The definition may be simple, but the implications of using a Data Class in your code can be significant.</p><h3>“What are the requirements for creating a data class?”</h3><p>When creating a Data Class, there are a few important requirements to keep in mind:</p><ul><li>A Data Class must have at least one parameter</li><li>These parameters must be either a val or a var.</li><li>Data Classes cannot be Abstract, Open, Sealed, or Inner.</li></ul><h3>“What do you know about Data Classes and inheritance?”</h3><p>One common question that may be asked during an interview is “What do you know about Data Classes and inheritance?”</p><p>This question can be tricky, as <strong>Data Classes can inherit from other classes</strong>, but are <strong>not intended to be</strong> used as a base class for inheritance. Instead, they are meant to be used as simple data holders.</p><h3>“What methods are auto-generated when you create a Kotlin Data Class?”</h3><p>When you create a Data Class Kotlin automatically generates these methods:</p><ul><li>equals()</li><li>hashCode()</li><li>toString()</li><li>componentN() (For every parameter)</li><li>copy()</li></ul><p>These methods provide functionality that would otherwise need to be manually implemented.</p><p>In order for you to understand why this is important and why this is such a drastic change in Kotlin compared to Java, I will talk about and show how these methods were manually implemented before Java. Also, I should note that if you interested you can check this code for your self if you click on “Data Class” in Kotlin.</p><h4>toString()</h4><p>Often there is a need to log information about an instance of a class. If the toString() method is not overridden, then when accessing a class instance, a reference to it will be displayed in the log, and not the class itself. It will look something like this:</p><pre>class Person(val name: String, val age: Int){<br>  ...<br>}<br><br>val person = Person(&quot;Adam, 27&quot;)<br>println(person)<br><br>// Log response <br>Person@Se9f23b4</pre><p>To fix this, you usually need to override the toString() method and specify what exactly you want to output in it.</p><pre>class Person(val name: String, val age: Int) {<br>  override fun toString() = &quot;Rerson(name = $name, age = $age)&quot;<br>}<br><br>val person = Person(&quot;Adam, 27&quot;)<br>println(person)<br><br>// Log response<br>Person(name=Adam, age=27)</pre><p>If we mark the class as data, then this will be done automatically.</p><h4>equals()</h4><p>The equals() method is used to compare two objects, and by default it compares the references of the objects, not the data they contain:</p><pre>val person1 = Person(&quot;Adam&quot;, 27)<br><br>val person2 = Person(&quot;Adam&quot;, 27)<br><br>println(person1 == person2)<br><br>// Log response<br>false</pre><p>The objects are not equal because the references to them are different. In order to compare exactly the data of the objects, we need to override the equals() method as such:</p><pre>class Person(val name: String , val age: Int) {<br>  override fun toString() = &quot;Person(name = $name , age = $age )&quot;<br><br>  override fun equals(other: Any?): Вооlean {<br>    if (other == null || other !is Person)<br>      return false<br>    return name == other.name &amp;&amp; age == other.age<br>  }<br>}<br><br>val person1 = Person(&quot;Adam&quot;, 27)<br><br>val person2 = Person(&quot;Adam&quot;, 27)<br><br>println(person1 == person2)<br><br>// Log response<br>true</pre><p>If we mark the class with the word data, the method will be overridden automatically. You need to remember that “behind the scenes” the = = operator calls the equals() method, for reference comparison, the = = = operator is used.</p><h4>hashCode()</h4><p>An instance of a class can be used as a key in a hash-based data structure. This is possible because each object is assigned a unique hash code, even if the values of these objects are identical.</p><pre>val hashSet = hashSetOf(Person(&quot;Adam&quot;, 27))<br>println(hashSet.contains(Person(&quot;Adam&quot;, 27)))<br><br>// Log response<br>false</pre><p>But logically, if two objects contain the same values, then their hash code must be the same. This is why the hashCode() method must be overridden.</p><pre>class Person(val name: String , val age: Int) {<br>  override fun toString() = &quot;Person(name = $name , age = $age )&quot;<br><br>  override fun equals(other: Any?): Вооlean {<br>    if (other == null || other !is Person)<br>      return false<br>    return name == other.name &amp;&amp; age == other.age<br>  }<br><br>  override fun hashCode(): Int = name.hashCode() * 31 + age<br>}<br><br>...<br><br>val hashSet = hashSetOf(Person(&quot;Adam&quot;, 27))<br>println(hashSet.contains(Person(&quot;Adam&quot;, 27)))<br><br>// Log response<br>true</pre><p>The hashCode() method works in conjunction with the equals() method. This means that if you override the hashCode() method without overriding the equals() method, each object will be assigned a unique hash code, even if their values are equal.</p><p>This is due to the fact that objects are compared before the hash code is assigned, and therefore, if the equals() method is not overridden, objects will be compared by their references, and not by values.</p><h4>copy()</h4><p>The copy() method allows you to create a new instance of a class by changing the values of some properties, this is a method that was added to Kotlin to encourage immutability in the objects. “Instead of modifying an object, it’s better to create a new object”.</p><p>It looks like this:</p><pre>data class Person(val name: String , val age: Int)<br><br>...<br><br>val person = Person(&quot;Adam&quot;, 27)<br>println(person.copy(age = 28))<br><br>// Log response<br>Person(name=Adam, age=28)</pre><p>“Under the hood”, the implementation of this method is as follows:</p><pre>class Person(val name: String , val age: Int) {<br><br>  override fun toString() = &quot;Person(name = $name , age = $age)&quot;<br><br>  fun copy(name: String = this.name, age: Int = this.age) = Person(name, age)<br><br>}<br><br>...<br><br>val person = Person(&quot;Adam&quot;, 27)<br>println(person.copy(age = 28))<br><br>// Log response<br>Person(name=Adam, age=28)</pre><p>Again, when putting down the word data, this method is generated automatically.</p><h4>ComponentN() (destructuring declarations)</h4><p>Component methods in Data Classes allow their use in <a href="https://kotlinlang.org/docs/destructuring-declarations.html#example-destructuring-declarations-and-maps">destructuring declarations</a></p><p>Multi-declaration (destructuring declarations) is a feature specific to data classes that allows you to unpack an object and use its values to initialize several variables at once:</p><pre>val person = Person(&quot;Adam&quot;, 27)<br>val(name, age) = person<br><br>println(name)<br><br>// Log response<br>Adam</pre><p>All this is achieved due to the fact that for each variable declared in the main constructor, the componentN () method is automatically generated, where N is the position number of the variable in the constructor. This method returns the value of a variable.</p><p>The implementation of the method looks like this:</p><pre>class Person(val name : String , val age : Int) {<br>  operator fun component1() = name<br>  operator fun component2() = age<br>}<br><br>...<br>val person = Person(&quot;Adam&quot;, 27)<br>val name = person.component1()<br>val age = person.component2()</pre><p>This is a feature specific to data classes.</p><h3>Conclusion</h3><p>In conclusion, understanding the basics of Kotlin Data Classes is an essential part of being an Android developer. By understanding the requirements for creating a Data Class, the methods that are automatically generated, and the implications of using Data Classes in your code, you will be well-prepared for any interview and equipped to use Data Classes effectively in your Android development projects.</p><h3>If you enjoyed the post</h3><p>If you enjoyed this post, please, consider following my page, as I will be posting more <a href="https://medium.com/@iliashevtsov/list/software-development-7fb179e2c297"><strong>Software Development</strong> <strong>content</strong></a> in the future.</p><p>I also plan on posting other interesting things, such as <a href="https://medium.com/@iliashevtsov/list/quality-youtube-channels-16db077ed248"><strong>Quality YouTube Channels</strong></a> I have found in my years on the internet and also some other <a href="https://medium.com/@iliashevtsov/list/music-and-art-09061c68851a"><strong>more personal things</strong></a><strong>.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*T_JWoFXRCT5JMhuHiJXNWQ.jpeg" /><figcaption>Don’t mind this, its here for the thumbnail :)</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=534dc993c589" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Best “History Visualized” channel on YouTube]]></title>
            <link>https://medium.com/@iliashevtsov/best-history-visualized-channel-on-youtube-4d5aba070264?source=rss-769079413da1------2</link>
            <guid isPermaLink="false">https://medium.com/p/4d5aba070264</guid>
            <category><![CDATA[review]]></category>
            <category><![CDATA[youtube-channel]]></category>
            <category><![CDATA[quality]]></category>
            <category><![CDATA[the-operations-room]]></category>
            <category><![CDATA[history]]></category>
            <dc:creator><![CDATA[Ilia Shevtsov]]></dc:creator>
            <pubDate>Sat, 21 Jan 2023 17:02:27 GMT</pubDate>
            <atom:updated>2023-01-21T17:45:44.098Z</atom:updated>
            <content:encoded><![CDATA[<p>This is my first post in a series of posts I am calling “Quality YouTube Channels”.</p><p>In these posts I will share some of the best YouTube Channels that I have come across in years of being on YouTube. These are those kinds of channels where almost every upload — is a “must watch” one.</p><h3>The Operations Room</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/833/1*hckoqPy4Q66t_pqy3Wd5yg.png" /></figure><p>I will start with a channel by the name of <a href="https://www.youtube.com/@TheOperationsRoom/videos">“The Operations Room”.</a></p><p>I’ve been a follower of the channel for about 3 years, and I can say that it’s the best “History Visualized” type of content I have ever came across. If you ever found yourself in that part of YouTube at 3 am, where videos are about naval battels, submarine warfare and World War II Pacific islands takeovers and you enjoy your time there, this is a channel for you.</p><p>For example they have a video about how ones the <a href="https://www.youtube.com/watch?v=qYodJ69iXnc">British SAS Unit raided an Nazi Airfield in North Africa</a> with nothing but a couple of jeeps and machineguns. MAD LADS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/890/1*re69GcWBzT2MIVBxVqC7aA.png" /><figcaption>The SAS Behind Enemy Lines in North Africa, 1942 — Animated (Screenshot from a <a href="https://www.youtube.com/watch?v=qYodJ69iXnc">video</a>)</figcaption></figure><p>The Operations Room is a YouTube channel that specializes in creating animated maps and visualizations of historical battles and conflicts. The channel uses a combination of text, graphics, and animation to explain the strategies, tactics, and key events of battles from ancient history to modern times. The channel covers a wide range of conflicts from various time periods and locations but mainly from World War II. The channel is known for its detailed and accurate representation of historical events, and is popular among history enthusiasts and students of military history. The channel also provides a great way to learn about the battles and the strategy of warfare throughout history.</p><p>In his own words, the channel creator describes it as “Creating battle map animations of the most important battles and events in history”. Beautiful animations, calming yet entertaining voiceovers and in-depth research, this channel has it all. The channel doesn’t only focus on famous and well-known battles, but also on unique, niche, and interesting battles, which makes it quite different from other channels in this space.</p><p>I am always amazed how accurate the visualizations are. I can only imagen how long it takes to collect and analyze all the data bout the battles, create the animations, check everything and then write a script for the voice over that keeps you on the edge of your sit for the whole video.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/991/1*CXC1Ljgz06PTshjqfpKGkA.png" /><figcaption>Desert Storm — The Air War, Day 1 (Screenshot from a <a href="https://www.youtube.com/watch?v=zxRgfBXn6Mg&amp;t=922s">video</a>)</figcaption></figure><p>As I understand, at first it was just one person, but now its full-on team of likeminded people that strive for accurate, entertaining, and most important high-quality content. I should also mention that not long ago, the team also created second “sister” channel <a href="https://www.youtube.com/channel/UC7Ay_bxnYWSS9ZDPpqAE1RQ">“The Intel Report”</a>, where they go even more in-depth on the matter of the videos they upload and give some more context for them. They usually upload a video on the main channel and one on the second channel at the same time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*Apy2W1BGhwD9GwibjlaBrA.png" /><figcaption>The Battle of the Bulge (Screenshot from a <a href="https://www.youtube.com/watch?v=i5K_iPpqw5E&amp;t=661s">video</a>)</figcaption></figure><p>Anyways, if you like history and you enjoy detail-oriented content, you strongly suggest checking out <a href="https://www.youtube.com/@TheOperationsRoom/videos">“The Operations Room”.</a></p><p>And if you do enjoy their content, make sure to support them by subscribing to the channel and maybe even <a href="https://www.patreon.com/TheOperationsRoom">donating on their patreon</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4d5aba070264" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A collection of painters I love]]></title>
            <link>https://medium.com/@iliashevtsov/a-collection-of-painters-i-love-ab65e012e63a?source=rss-769079413da1------2</link>
            <guid isPermaLink="false">https://medium.com/p/ab65e012e63a</guid>
            <category><![CDATA[art]]></category>
            <category><![CDATA[painters]]></category>
            <category><![CDATA[beautiful]]></category>
            <category><![CDATA[reserch]]></category>
            <category><![CDATA[collection]]></category>
            <dc:creator><![CDATA[Ilia Shevtsov]]></dc:creator>
            <pubDate>Sat, 21 Jan 2023 13:16:16 GMT</pubDate>
            <atom:updated>2023-01-21T13:16:47.564Z</atom:updated>
            <content:encoded><![CDATA[<p>Today I want to share something that I have been working on (bit by bit) for about 7 years. About my collection of artists.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/0*ySeLEVQ-q2JLYOZS.jpg" /><figcaption>The source is <a href="https://www.ilya-shevtsov.com/">my site</a></figcaption></figure><p>Somewhere since 2016, after I realized that most communities on social media post paintings by the same artists, I got the idea to make a list of these artists, in order to at least know their names, since I see them almost every day. Over time, this idea grew into something more. I began to collect a collection of artists who seem interesting to me or whose paintings I find most pleasing.</p><p>I must admit, the matter is actually very laborious: you see a random picture on the Internet, you try to find the name of the artist, you try to make sure that the picture is really the artist you found and so on. At first, I collected all the pictures and names in a regular Word file. But after the file grew to 34 pages, I realized that something needed to be changed. Of course, I didn’t change anything … That was back in 2019.</p><p>A few days ago (after a short break of 3 years) I finally came to the conclusion that I want to be able to share with someone everything that I have collected over the years. Whether it’s my favorite artists, bands or something else. I got excited about the idea of creating my own site, which would allow me to do it in the most beautiful and pleasant way.</p><p>A day and a half of work and voila <a href="https://www.ilya-shevtsov.com/">the site was created</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/628/1*u2wAF_DiO0FGyAQZ3TKYOw.png" /><figcaption>Second page of “My Favorite Painters”</figcaption></figure><p>The name of the artist appears when you click on the picture. If you double-click on it, the full name of the artist and a description of the painting will open.</p><p>I should also note that the “Interesting Artists” page is mega beautiful only on computers. On phones, it looks like a simple picture feed, so I advise you to check it out from your computer, if possible.</p><p>P.S. So far, the database contains 184 artists, but in reality there will be many more. So far, I have added only those names that I collected between 2016 and 2019.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ab65e012e63a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Story of Jesse Stewart]]></title>
            <link>https://medium.com/@iliashevtsov/the-story-of-jesse-stewart-d6f9ad04d3a?source=rss-769079413da1------2</link>
            <guid isPermaLink="false">https://medium.com/p/d6f9ad04d3a</guid>
            <category><![CDATA[music]]></category>
            <category><![CDATA[jesse-stewart]]></category>
            <category><![CDATA[folk]]></category>
            <dc:creator><![CDATA[Ilia Shevtsov]]></dc:creator>
            <pubDate>Sat, 21 Jan 2023 13:07:07 GMT</pubDate>
            <atom:updated>2025-09-03T14:15:22.683Z</atom:updated>
            <content:encoded><![CDATA[<p>Today I will talk about a man named Jesse Stewart. A man of great talent and a very tragic fate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/336/0*hdYSpxmpKGS-vbyD.jpg" /><figcaption>Jesse Stewart</figcaption></figure><p>Jesse was born in Canada and grew up in a small, beautiful town of Campbell River, British Columbia, he was fond of music since childhood, he was a rebel. In the words of his mother, “most of all, he did not want to live a boring, full of routine life, working at a job from 9 to 5.” After Jesse left home, he traveled extensively with his dog Arlo. Traveled to many cities, crossed Canada twice by hitchhiking.</p><p>Once, on a typical summer day, Jesse was sitting with his friends in the backyard of his shabby house. He took out his mandolin and played a song called “Cold beer”. He sang his own version of the song, putting new meaning into the words. The original song “Cry Tunes by Donnie Dumphy” is a comedy song about a guy who traded his girlfriend for a bottle of beer.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FRFs-Qmc3IcU%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DRFs-Qmc3IcU&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FRFs-Qmc3IcU%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/34d0f62e8191934c7d261c8f1058aaef/href">https://medium.com/media/34d0f62e8191934c7d261c8f1058aaef/href</a></iframe><p><strong>Jesse in turn sang a song about dealing with alcoholism and the pain it causes.</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FZEvQOPUHGH8%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DZEvQOPUHGH8&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FZEvQOPUHGH8%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/0d865c15d90b2f5c9a3cfea6c0016e2b/href">https://medium.com/media/0d865c15d90b2f5c9a3cfea6c0016e2b/href</a></iframe><p>I came across this video back in 2018. I was ecstatic. His voice, the sound of Mandolin, the entourage of the poor hinterland, visible in the background of the video, his clothes, the shaking camera and the laughter of his friends and most important the shivering pain with which he sang. From the video, it was clear that he was not singing about some fictional story, he was singing about the reality in which he lives. Soon after his video became famous, he started performing in local clubs and cafes, his appearance improved (according to the videos on his channel), he even recorded an album called “Shed Life”. The songs: “Cold Beer”, “Marauder” and “Another Last Chance” became my favorite of his.</p><p>Today, while doing house chores, I was listening to my music in VK on shuffle and suddenly I came across his song. I haven’t heard it in about two years. I immediately decided to check how he was doing, whether he managed to get out of his city, perhaps build a career. But when I went to his YouTube page, all I saw was a message:</p><blockquote>Rest In Peace to one of my good friends, Jesse Shea Stewart. July 18, 1990 — November 22, 2021.</blockquote><p>Years of poverty, alcoholism, drug use, sudden fame, sudden money. I’m afraid even the strongest people would find it hard to cope with such a drastic change in life. Jesse Shaya Stewart died on November 22, 2021 from an overdose, on the street of a cold, Canadian city of Edmonton.</p><p>It is very difficult to describe in words what the death of a musician means. After all, this is the death of not only his voice, emotions, the experience that he put into his music, his death means that the world has lost not only him, but also all the works, songs, music that he could ever write. I am very glad that his friends then, back in 2014, decided to film him and I am glad that I had the opportunity to hear it. I think he’s one of the best folk punk artists I’ve ever come across. May he rest in peace.</p><h4>Here are some of my most favorite songs from him</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fz8LYXg5v-h4%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dz8LYXg5v-h4&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fz8LYXg5v-h4%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/3ef437dd6df6d5cb9eeb286cf7f51c88/href">https://medium.com/media/3ef437dd6df6d5cb9eeb286cf7f51c88/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FJTmeKoBR-VA%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DJTmeKoBR-VA&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FJTmeKoBR-VA%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/fbd910cd4962a765e28b6978e3344c06/href">https://medium.com/media/fbd910cd4962a765e28b6978e3344c06/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F7tn_03LNNb8%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D7tn_03LNNb8&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F7tn_03LNNb8%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/e6afe507117ec03cce6fdfc9455fc421/href">https://medium.com/media/e6afe507117ec03cce6fdfc9455fc421/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FAw-eM_LM9xg%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DAw-eM_LM9xg&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FAw-eM_LM9xg%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/5c6d0ad12f03da03926f943d958b9fb7/href">https://medium.com/media/5c6d0ad12f03da03926f943d958b9fb7/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d6f9ad04d3a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating a Kotlin project with Navigation feature]]></title>
            <link>https://medium.com/@iliashevtsov/creating-a-kotlin-project-with-navigation-feature-e202bdef4573?source=rss-769079413da1------2</link>
            <guid isPermaLink="false">https://medium.com/p/e202bdef4573</guid>
            <category><![CDATA[guides-and-tutorials]]></category>
            <category><![CDATA[intellij-idea]]></category>
            <category><![CDATA[navigation-component]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[github]]></category>
            <dc:creator><![CDATA[Ilia Shevtsov]]></dc:creator>
            <pubDate>Sat, 21 Jan 2023 12:43:49 GMT</pubDate>
            <atom:updated>2023-01-21T12:43:49.452Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/426/0*BZKv--cpv2dzHCx0.png" /></figure><p>In this post I will talk about creating a Kotlin project that uses navigation feature to navigate between fragments of the application.</p><p>For the creation of the project I will be using JetBrains IntelliJ IDEA. Here is the <a href="https://github.com/ilya-shevtsov/Kotlin-Navigation-Project">GitHub repository of the project</a></p><h3>Creating a project</h3><p>First thing you need to is to create a project. To do so, you need to go to the top left corner of Android Studio, click “File” — “New” — “New Project”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/745/0*iV1Pg2paYCXUBUMT.jpg" /></figure><p>For the purposes of demonstration, we will be starting from an Empty Activity. So, select “Empty Activity” and click “Next”. Name you application and click “Finish”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/513/0*pvP1l93Ois8C29mS.jpg" /></figure><h3>Setting up the Gradle files</h3><p>We will start with the setup of the Gradle files. In this project we will be using View binding feature, so we have to add it to our project, as well as the necessary imports and dependencies for using the navigation feature. We will select the build.gradle.kts and edit it. The files are located here:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/542/0*pEymEjsir-_3aRyX.jpg" /></figure><p>Add the following code to the Project build.gradle file in the dependencies block:</p><pre>classpath &quot;androidx.navigation:navigation-safe-args-gradle-plugin:2.5.0&quot;</pre><p>It should look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/548/0*UKj3f5i9B5_xWiZM.jpg" /></figure><p>Now we will edit the Module build.gradle.kts file. Add the following implementations to the dependencies block:</p><pre>implementation &#39;androidx.navigation:navigation-fragment-ktx:2.5.0&#39;<br>implementation &#39;androidx.navigation:navigation-ui-ktx:2.5.0&#39;</pre><p>It should look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/553/0*q13xzYpx36XHFJZm.jpg" /></figure><p>Add the following plugin to the plugins block:</p><pre>id &#39;androidx.navigation.safeargs&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/567/0*2ctJh2OUsOdauPr-.jpg" /></figure><p>Add the following code to the android block:</p><pre>buildFeatures {<br>    viewBinding true<br>}</pre><p>It should look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*r8F2q7hDltZ8-7ed.jpg" /></figure><h3>Creating a navigation graph</h3><p>Now we are ready to start creating the project itself. To start, go to the resources manager on the left side of Android Studio. Select the navigation tab and click the plus sign.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/569/0*uIiJqm9Ri2pf07UU.jpg" /></figure><p>Name your navigation file and click “OK”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/570/0*0Gd7xq3C2uEkp8EY.jpg" /></figure><p>Now we will create two fragments. After that we will use the navigation between them. To do so click the little phone icon with a green plus.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/564/0*jjc8cZ_RetieuGqX.jpg" /></figure><p>Click “Create new destination” button and select “Blank Fragment” name it and click “Finish”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/559/0*8yz30QX-mvNUWlVS.jpg" /></figure><p>Do the same steps for the second fragment. The result should look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/557/0*d_w_PlK36KZGMXNy.jpg" /></figure><p>If you hover over the “mainFragment” layout a bobble will appear on the side of it. Click it and drag it to the right side of the secondFragment. Then do the same thing back. It should look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/559/0*DjpG0pzd9CsFUe3Z.jpg" /></figure><p>Now you have to create a Navigation Host Fragment. In our case its out Main Activity. To do so go to the XML file of the main activity and in the search bar type “frag…”. A NavHostFragment will show up. Click and drag the NavHostFragment to the main activity layout:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/558/0*4fvzQKxzJlbwW-Qf.jpg" /></figure><p>A popup will appear, select our navigation graph (my_nev in out case) and click “OK”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/563/0*Wu7wlXre-sTeRGr8.jpg" /></figure><p>After we edit some of the code in the Main Activity XML file we will be ready to start editing the code of the Fragments and their respective XML files.</p><h3>Editing fragments and their XML files</h3><p>Before we start we need to edit some of the code in the Main Activity XML file. Navigate to the code section of the Main Activity XML file and add the constraints. To do so, add the following code to the bottom of Fragment Container View code:</p><pre>app:layout_constraintBottom_toBottomOf=&quot;parent&quot;<br>app:layout_constraintEnd_toEndOf=&quot;parent&quot;<br>app:layout_constraintStart_toStartOf=&quot;parent&quot;<br>app:layout_constraintTop_toTopOf=&quot;parent&quot;</pre><p>It should look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/563/0*Dbaaj8PGuskn-7X9.jpg" /></figure><p>Now we are going to switch to the XML file of the Main Fragment. There we will add a button and some text to the fragment. To do so go to the xml file and select the code view:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/563/0*QqEgIGoWOgARx6bS.jpg" /></figure><p>Check if the layout type is constraintlayout or not. If its not replace FrameLayout with the following code:</p><pre>androidx.constraintlayout.widget.ConstraintLayout</pre><p>It should look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/677/1*3mCND0aD9PjkkQnlX0v32A.png" /></figure><p>Add the following code to make the button and the text of the fragment:</p><pre>&lt;TextView<br>    android:layout_width=&quot;200dp&quot;<br>    android:layout_height=&quot;200dp&quot;<br>    android:text=&quot;This is the First Fragment&quot;<br>    android:textSize=&quot;30sp&quot;<br>    android:textAlignment=&quot;center&quot;<br>    app:layout_constraintBottom_toTopOf=&quot;@id/button&quot;<br>    app:layout_constraintEnd_toEndOf=&quot;parent&quot;<br>    app:layout_constraintStart_toStartOf=&quot;parent&quot;<br>    app:layout_constraintTop_toTopOf=&quot;parent&quot;<br>    /&gt;<br><br>&lt;Button<br>    android:id=&quot;@+id/button&quot;<br>    android:layout_width=&quot;280dp&quot;<br>    android:layout_height=&quot;55dp&quot;<br>    android:text=&quot;To Next Fragment&quot;<br>    app:layout_constraintBottom_toBottomOf=&quot;parent&quot;<br>    app:layout_constraintEnd_toEndOf=&quot;parent&quot;<br>    app:layout_constraintStart_toStartOf=&quot;parent&quot;<br>    app:layout_constraintTop_toTopOf=&quot;parent&quot; /&gt;</pre><p>And this code to the XML file of the second Fragment:</p><pre>&lt;TextView<br>    android:layout_width=&quot;200dp&quot;<br>    android:layout_height=&quot;200dp&quot;<br>    android:text=&quot;This is the Second Fragment&quot;<br>    android:textSize=&quot;30sp&quot;<br>    android:textAlignment=&quot;center&quot;<br>    app:layout_constraintBottom_toBottomOf=&quot;parent&quot;<br>    app:layout_constraintEnd_toEndOf=&quot;parent&quot;<br>    app:layout_constraintStart_toStartOf=&quot;parent&quot;<br>    app:layout_constraintTop_toTopOf=&quot;parent&quot;<br>    /&gt;</pre><p>The last thing we have to do is to edit the code of the fragments. Now go to the MainFragment.kt and clear it of all code except of function “onCreateView”. Should look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/586/0*knFv2Ag1KH0j3c_I.jpg" /></figure><p>Connect the Fragment to the XML file. To do so add the following code to the Fragment():</p><pre>R.layout.fragment_main</pre><p>Now we have to edit the code of the fragment to bind the XML file to the fragment. We will also add a “setOnClickLisener” on the button we created with the following code:</p><pre>class MainFragment : Fragment(R.layout.fragment_main) {<br><br>    private lateinit var binding: FragmentMainBindingoverride fun onCreateView(<br>        inflater: LayoutInflater, container: ViewGroup?,<br>        savedInstanceState: Bundle?<br>    ): View {<br><br>        binding = FragmentMainBinding.inflate(inflater,container,false)<br><br>        binding.button.setOnClickListener {<br>            findNavController().navigate(R.id.secondFragment)<br>        }<br>        return binding.root<br><br>    }<br>}</pre><p>The end result should look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/0*fAHqHaTW2yg4Cuf5.jpg" /></figure><p>Do the same steps, except the button part, to the second fragment. Should look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*xInWinAdJndn7C7l.jpg" /></figure><p>That’s it! Now you have a project that uses the Navigation feature to switch between the fragments. If you click the button, it will take you to the second fragment and if you click “Back Arrow”, it will take you back.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e202bdef4573" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to set up AWS Elastic Beanstalk with a Ktor project]]></title>
            <link>https://medium.com/@iliashevtsov/how-to-set-up-aws-elastic-beanstalk-with-a-ktor-project-ccb7eb859e17?source=rss-769079413da1------2</link>
            <guid isPermaLink="false">https://medium.com/p/ccb7eb859e17</guid>
            <category><![CDATA[aws-elastic-beanstalk]]></category>
            <category><![CDATA[ktor]]></category>
            <category><![CDATA[servers]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[guides-and-tutorials]]></category>
            <dc:creator><![CDATA[Ilia Shevtsov]]></dc:creator>
            <pubDate>Sat, 21 Jan 2023 12:32:31 GMT</pubDate>
            <atom:updated>2023-01-23T12:53:15.638Z</atom:updated>
            <content:encoded><![CDATA[<h3>Creating a Kotlin Ktor project and running it on AWS Elastic Beanstalk Service</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/426/0*gkw4meeRVncJ7jwB.png" /></figure><p>In this post I will talk about creating and running a Kotlin Ktor project on an Amazon Web Service. For the creation of the project I will be using JetBrains IntelliJ IDEA. Here is the <a href="https://github.com/ilya-shevtsov/AWS-Elastic-Beanstalk-Ktor-Sample-Project">GitHub repository of the project</a>:</p><h3><strong>Setting up a project</strong></h3><h4>1. Make a project</h4><p>First you have to make a project. Click File — New — Project.</p><p>The settings are:</p><ul><li>Language — Kotlin</li><li>Build system — Gradle</li><li>Gradle DSL — Kotlin Should look something like this:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/0*lzF22rtbl4Z89bow" /></figure><h4>2. Setting up build.gradle.kts</h4><p>Now you have to setup your Gradle file.</p><ul><li>add this to the repositories block</li></ul><pre>maven { url = uri(&quot;https://maven.pkg.jetbrains.space/public/p/ktor/eap&quot;) }  </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Iy2uPuIQa2psLT5wba-b2Q.jpeg" /></figure><ul><li>and add this to the dependencies block</li></ul><pre>implementation(&quot;io.ktor:ktor-server-core:2.0.3&quot;)<br>implementation(&quot;io.ktor:ktor-server-netty:2.0.3&quot;)<br>implementation(&quot;ch.qos.logback:logback-classic:1.2.1&quot;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/906/1*WuhmTnXJCEyJHNgqJ3k58Q.jpeg" /></figure><ul><li>replace mainClass.set in the application block to</li></ul><pre>mainClass.set(&quot;io.ktor.server.netty.EngineMain&quot;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*dvLjolxJg231DJgi9fqWyg.jpeg" /></figure><ul><li>add this to plugins block</li></ul><pre>id(&quot;com.github.johnrengelman.shadow&quot;) version &quot;7.1.2&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/891/1*5ynxEQyjC6GqcHC2hbDxCA.jpeg" /></figure><ul><li>add “application.conf” file to resources and past this code into it</li></ul><pre>ktor {<br>    deployment {<br>        port = 5000<br>        port = ${?PORT}<br>    }<br>    application {<br>        modules = [ ApplicationKt.module ]<br>    }<br>}</pre><h4>3. Make the server</h4><p>Now you set up your server (the project itself)</p><ul><li>add this to your main file “Application.kt”. “/haha” — is the path that will be added to the url and response — is the thing that the server will output</li></ul><pre>fun main(args: Array&lt;String&gt;): Unit = EngineMain.main(args)<br><br>fun Application.module() {<br><br>    routing {<br>        get(&quot;/haha&quot;){<br>            val response = &quot;keke&quot;<br>            call.respond(response)<br>        }<br>    }<br>}  </pre><h4>4. Make a FatJar file</h4><p>Now you have to make a FatJar file. This is your project that will be uploaded to the AWS.</p><ul><li>go to the terminal and type</li></ul><pre>./gradlew shadowJar</pre><p>the file should appear in the aws-elastic-beanstalk-with-ktor\build\libs folder</p><h3>Uploading the project to AWS Beanstalk Services</h3><p>Now you have to upload the FatJar file to the AWS Beanstalk services. To do so, firstly you have to make an AWS account and then do the following steps.</p><h4>Create an application</h4><ul><li>type “Elastic Beanstalk into the search bar</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/677/1*g2Zv9AORuHSMP_esgGWaXA.jpeg" /></figure><ul><li>click “Create Application”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/935/1*dKPPbau8SKA7ARQr9DbA4g.jpeg" /></figure><ul><li>name your application</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LmeVIdUKGY4BPIKFwBZMng.jpeg" /></figure><ul><li>platform settings</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XIXkZrCAdTAK3cD0ijLkLQ.jpeg" /></figure><ul><li>click the upload your code and choose the FatJar file we have created before (its in build-libs path)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gUgmjM-fybzOKg5Af7CVTA.jpeg" /></figure><p>Click create and wait for it for finish creating the environment (it might take a while). If it takes more than 10 minutes, then click “Services” and then “Elastic Beanstalk”. The Elastic Beanstalk page should look something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/913/1*Oa2_iVdf4jwqxHN9ho88DA.jpeg" /></figure><p>The “Health” might be indicated as “Severe”, but the server works. Now click the environment name, here you can see the causes of the “Health” status, update your project and most important here is where the URL of your server is shown. It’s the link at the top that starts with the name of your project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/895/1*oBiw-ee3-fDM7qfYEfzyVw.jpeg" /></figure><p>You can copy the URL, add the path (/haha in our case) and you will get the response. That is it, now you have a working project.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ccb7eb859e17" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>