<?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 Vlad Mykol on Medium]]></title>
        <description><![CDATA[Stories by Vlad Mykol on Medium]]></description>
        <link>https://medium.com/@vladmykol?source=rss-36dbdcee1614------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Univ8Ka98rZEU4JOnGmVpg.jpeg</url>
            <title>Stories by Vlad Mykol on Medium</title>
            <link>https://medium.com/@vladmykol?source=rss-36dbdcee1614------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 05:33:46 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vladmykol/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[I Built a Powerbank-Sharing Startup Alone — and Today I’m Shutting It Down]]></title>
            <link>https://levelup.gitconnected.com/i-built-a-powerbank-sharing-startup-alone-and-today-im-shutting-it-down-d676894f578e?source=rss-36dbdcee1614------2</link>
            <guid isPermaLink="false">https://medium.com/p/d676894f578e</guid>
            <category><![CDATA[iot]]></category>
            <category><![CDATA[side-hustle]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[postmortem]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Vlad Mykol]]></dc:creator>
            <pubDate>Fri, 27 Feb 2026 15:53:10 GMT</pubDate>
            <atom:updated>2026-02-27T15:53:10.923Z</atom:updated>
            <content:encoded><![CDATA[<h4>ChargeBro: the idea, the build, the lessons</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/519/0*RmsEJwe9o5_A_kH5" /><figcaption>Image created by author</figcaption></figure><p>Today I’m switching off the server. This is the end of the journey for ChargeBro — and a good moment to recap and write down the lessons learned.</p><h3>The idea</h3><p>In December 2019, while travelling in Thailand, I first heard about powerbank sharing. I’ve never tried it before, but the idea stuck: scan a QR code, take a charged powerbank, and return it later — sometimes somewhere else. It solved a small but real problem at the exact moment you needed it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/579/0*S9Eaz-u0I-uHRu2p.png" /><figcaption>Image created by author</figcaption></figure><p>Back in Ukraine, I couldn’t stop thinking about it. At the time, we didn’t have anything like that locally. The idea sat in my head until COVID lockdowns arrived and private life slowed down. I needed inspiration-something messy and real.</p><p>That’s how ChargeBro started: a powerbank-sharing “startup” built by one developer, mostly at night, during a year when the world was paused.</p><p>My first Git commit is dated June 10, 2020. I didn’t know native iOS or Android development, but I was reading <a href="https://www.amazon.com/Create-Uber-Clone-Days-mobile/dp/1983258784">a book about building an Uber clone</a> with Codename One, and it inspired me so much that I decided to build the whole thing myself. I believed I could ship a mobile app without becoming a Swift/Kotlin developer first. That belief was naïve in some ways, but it removed the biggest obstacle: hesitation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*f5X07dFrPADkFf-3.jpg" /><figcaption>Uber clone in 7 days by Shai Almog</figcaption></figure><h3>Naming made it real</h3><p>The first working name was <strong>takeAndCharge</strong>. Then I shared the idea with a group of friends, and in a very informal setting, we started brainstorming names and slogans. Nothing structured — just jokes, ideas, and “what if we call it…?”</p><blockquote><em>“ChargeBro: charge in time — no stress to find”</em></blockquote><p>I checked domain availability. It was free, so it won.</p><h3>The hardware: six powerbanks and a SIM card</h3><p>I searched for hardware and ended up ordering a powerbank station from China. No screen — just a compact unit with six powerbanks, each with multiple built-in cables, plus a SIM-based internet module.</p><p>A sample arrived. I installed a local prepaid SIM, modified the device configuration, and started writing the backend that could speak the station’s protocol.</p><h3>Backend was fast</h3><p>Backend development is my full-time job. I already had solid experience, so it took me a few weeks to build a working draft.</p><p>As a hosting, I considered AWS first because I knew it well from work. But for a pet project, it was overkill — both in cost and complexity. I rented a small Hetzner server, used Dokku, and deployed a Spring Boot service. Swagger became my “control panel.” When you’re operating alone, being able to test and tweak quickly matters more than elegance.</p><p>The full system diagram, code structure, and deeper engineering notes are in the <a href="https://github.com/vladmykol/chargebro-backend">backend repo README</a></p><blockquote><em>The stations had random reconnections. I never fully proved why — carrier conditions, firmware instability, power issues, “all of the above.”</em></blockquote><p>I built online/offline status with a small delay, a map overlay to prevent users from walking to a dead station, and automatic admin alerts to my phone whenever something happened.</p><h3>The mobile app: where 80% of my time went</h3><p>Backend was familiar. Mobile was new, challenging and pure fun.</p><p>I decided to centre the app around a map: find stations, scan QR, unlock, and track the rental. I started with Figma mocks, showed them to a couple of friends, made fixes, and then started coding.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zMCWHDv4Ob7smdK7.png" /><figcaption>Image created by author</figcaption></figure><p>At one point, I spent two weeks polishing a splash screen animation: the logo appears, grows, fades into the map, and other elements appear. I proudly launched the empty app in front of my girlfriend, claiming I had added a new feature.</p><p>She watched it and said: “Okay… so where is it?”</p><p>I said: “That was it.”</p><p>She laughed. “So that’s what programmers do,” she said.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4NcPZb6UXgpLgax-.gif" /><figcaption>Image created by author</figcaption></figure><h3>The first pilot</h3><p>By December 8, 2020, I installed the first working station. The first real pilot happened through the most startup-like channel possible: I talked about the project to friends, and a friend of a friend worked with gym administration in Kyiv.</p><p>No official partnership. No payments at first. Just: “Let’s try it.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oZmsqKosnUqSACna.jpg" /><figcaption>Image created by author</figcaption></figure><p>I installed one station at the front desk for gym members. Soon, the gym’s other two locations wanted stations too.</p><p>That’s when it stopped being “a hobby project” and started acting like a startup. I monitored logs daily, watched every rent and return and fixed issues on the fly.</p><p>Support also became a real problem. Stations went offline, deposits didn’t release instantly, and sometimes users couldn’t unlock a slot on the first try. That’s why I added a dedicated Support button in the app: it redirected users straight to a chat with my bot, which routed the message to me. I also left my phone number there because, when you’re dealing with real users and real money, a fast response matters more than a perfect UI.</p><p>And yes, more than once, I was debugging a station connection from my phone while someone was standing at the gym front desk waiting.</p><h3>Mutual trust</h3><p>So even though I started as a fun non-profit experiment, I had to design for fraud from day one. My solution was intentionally small: a 50 UAH pre-authorisation hold, released automatically upon return of the powerbank. The amount was less than the powerbank itself. The point wasn’t full insurance — it was friction against casual fraud and a “don’t do something stupid” signal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/716/0*AE2z90zJ2SvaPy15.png" /><figcaption>Image created by author</figcaption></figure><p>But theft prevention has a cost: trust. In Ukraine back then, powerbank sharing was a new category-most people had never used anything like it. The moment the app asked for a card, many users hesitated: “What if my card gets charged?” or “What if the deposit doesn’t come back?” Others simply didn’t want to spend time registering for yet another app. In the gym pilot, that friction kept usage modest, around 1–2 rentals a day.</p><blockquote><em>People don’t adopt your product because it works; they adopt it because it feels safe and effortless.</em></blockquote><p>If I built it again, I would simplify onboarding aggressively: phone number + SMS login (no email/password), deposit via Apple Pay / Google Pay, and probably a web-first experience — because apps add install friction, update friction, and store policy friction.</p><h3>iOS was stricter (and shorter-lived)</h3><p>Android felt easier. iOS was slower to approve and earlier to remove. In the end, both disappeared because I wasn’t maintaining them, and store policies evolve.</p><p>That’s another practical reality of “shipping a product”: publishing is not a one-time event. It’s a long-term maintenance commitment.</p><h3>Shipping was possible. Scaling alone wasn’t.</h3><p>Technically, ChargeBro worked. I integrated hardware, ran a TCP station protocol server, built a backend, shipped a cross-platform app, deployed stations, and operated a pilot.</p><p>But while I was engineering, I wasn’t doing the other half: partnerships, distribution, sponsorships, fundraising. And then the market moved. A competitor later launched with broader coverage and real marketing, and I understood the truth:</p><blockquote><em>You can build a product alone. You cannot build a company alone — especially when it depends on physical deployment, venue relationships, and user trust at scale.</em></blockquote><h3>Why I made the repos public</h3><p>ChargeBro is no longer active, but it’s still one of the most educational projects I’ve ever built because it forced me to deal with real-world constraints: unreliable hardware connections, trust issues, and the gap between a working demo and a working business.</p><p>I’m publishing the code not because it’s perfect, but because it’s honest. If you’re a developer thinking about building something physical, this is your reminder: you can. You’ll learn fast.</p><p>The backend includes custom binary protocol handling (station ↔ server), a two-phase payment flow (pre-auth + release), and real-time bridging from station TCP events to WebSocket updates for the mobile clients. The “frontend” is a cross-platform Java mobile app (published on iOS and Android in the past) with the original UI flows and assets, things you rarely see in tutorials. Just don’t confuse shipping with scaling.</p><p>Repos: <a href="https://github.com/vladmykol/chargebro-mobile">chargebro-mobile</a> and <a href="https://github.com/vladmykol/chargebro-backend">chargebro-backend</a></p><p><em>Originally published at </em><a href="https://vladmykol.com/blog/chargebro-startup/"><em>https://vladmykol.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d676894f578e" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/i-built-a-powerbank-sharing-startup-alone-and-today-im-shutting-it-down-d676894f578e">I Built a Powerbank-Sharing Startup Alone — and Today I’m Shutting It Down</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[WildSentry: Building a Pet-Safe AI Squirrel Deterrent on ESP32-S3]]></title>
            <link>https://medium.com/@vladmykol/wildsentry-building-a-pet-safe-ai-squirrel-deterrent-on-esp32-s3-94a77e95a4cf?source=rss-36dbdcee1614------2</link>
            <guid isPermaLink="false">https://medium.com/p/94a77e95a4cf</guid>
            <category><![CDATA[esp32]]></category>
            <category><![CDATA[squirrels]]></category>
            <category><![CDATA[microcontrollers]]></category>
            <category><![CDATA[diy]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Vlad Mykol]]></dc:creator>
            <pubDate>Tue, 16 Dec 2025 23:09:45 GMT</pubDate>
            <atom:updated>2026-09-15T02:19:24.163Z</atom:updated>
            <content:encoded><![CDATA[<p><em>I have a problem — squirrels are destroying my balcony plants. I solved it as an engineer — the hard way.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UA2hhNCzzZrBEUctbm_tQA.jpeg" /><figcaption>My workbench of creating WildSentry</figcaption></figure><p>In my defence, I tried many things, but none of them really worked because my family, including my cat Leo, wants to use our balcony daily. So I needed a smart deterrent that would be triggered only by squirrels and would not bother others.</p><p>So I built <strong>WildSentry</strong> (the system) and <a href="http://balconypatrol.com/"><strong>BalconyPatrol</strong></a><strong> </strong>(the edge device): PIR wake → take a photo → send to server → classify → decide → deter by sound/flash → sleep.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*jMGQlGknGA4vaOcT6hy1Yw.gif" /><figcaption>BalconyPatrol in action</figcaption></figure><h3>Edge device: Balcony<strong>Patrol</strong></h3><p>The main component of the system is an <strong>ESP32-S3</strong> microcontroller — a tiny computer with a motion sensor, a camera, a Wi-Fi module, speakers, and a solar panel, powered by <strong>Arduino</strong> and <strong>PlatformIO</strong>. Things were a bit hard to comprehend all at once at the beginning, so, of course, I used <strong>ChatGPT</strong> to write the initial firmware for it in C++. On a ~3200 mAh battery, it has run for about <strong>3 hours </strong>before going out of charge<strong>, </strong>and then I realised:</p><blockquote>If you need off-grid runtime, the device must spend almost all its time asleep.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*72UDslHsG6G6oE9UMt1Fdw.jpeg" /><figcaption>BalconyPatro prototyping</figcaption></figure><p>After I rewrote the firmware to support <strong>light and deep sleep, </strong>and to<strong> </strong>wake only on movement detected by the PIR sensor. Battery life jumped from hours to days, and later it enabled a key hardware change: I could downsize the solar panel and still stay charged.</p><h4>Deep sleep caused a new bug: missing frames</h4><p>Once sleeping worked, I sought some missing frames right after waking. The root issue was simple:</p><ul><li>camera init takes time</li><li>Wi-Fi connect/reconnect can take seconds</li><li>if Wi-Fi blocks capture, you miss the subject</li></ul><p>The ESP32-S3 has two cores, and that saved the project.</p><h4>The turning point: split capture from networking (dual core)</h4><p>I pinned capture and sending to different cores so that Wi-Fi latency couldn’t steal the photo.</p><pre>void startCaptureAndSenderTasks()<br>{<br>    // core 1 = user app core, core 0 = Wi-Fi/LwIP core (Arduino)<br>    xTaskCreatePinnedToCore(captureTask, &quot;capture&quot;, 5120, nullptr, 3, &amp;capTaskHandle, 1);<br>    xTaskCreatePinnedToCore(senderTask,  &quot;sender&quot;,  10240, nullptr, 2, &amp;sendTaskHandle, 0);<br>}</pre><p><strong>Why this matters:</strong> squirrels don’t wait for your DHCP lease. Capture must be “real-time.” Networking is “best effort.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IUxb3aDj69DT-awl7rVv_w.jpeg" /><figcaption>BalconyPatrol assembly</figcaption></figure><h3>Backend: WildSentry brains</h3><p>To gain more runtime and some freedom on the edge device, I decided to offload the heavy lifting of AI image classification to the backend. I tried a few approaches for recognition and eventually went with <strong>OpenAI Vision</strong> because it let me ship a working system fast. Meanwhile I am gathering own dataset and will train my <a href="https://en.wikipedia.org/wiki/Computer_vision">ML vision model</a>.</p><p><em>To speed things up, I added a cache:</em></p><h4>pHash cache (the system gets faster over time)</h4><p>Most images are near-duplicates. I compute an image fingerprint (<a href="https://en.wikipedia.org/wiki/Perceptual_hashing">pHash</a>). If device sought the scene before, it reuses the previous result and skip slow AI classification; over time, system becomes faster and more self-sufficient.</p><h3>Controlling: Telemetry chatbot</h3><p>Soon after deploying outdoors, I realised I needed metrics to track efficiency, so I added a <a href="https://en.wikipedia.org/wiki/Heartbeat_(computing)">heartbeat</a> to each PIR activation to collect and monitor devices in the field. To simplify things further, I created a chatbot so no additional UI required.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Lbcd5gQ_CV_NVlLxQs1ucA.jpeg" /><figcaption>BalconyPatrol pics and telegram bot</figcaption></figure><p><strong>Key metrics (current meanings)</strong></p><ul><li><strong>Unstable connection</strong> = captured on-device vs successfully uploaded (network reliability)</li><li><strong>Bad image quality</strong> = mostly night frames (too dark/noisy)</li><li><strong>Fast response</strong> = cache hit rate (served from pHash cache, no AI)</li><li><strong>Uptime</strong> = active runtime without sleeps (not wall clock)</li><li><strong>Temp = </strong>board temperature to protect from harsh weather</li></ul><p>This helped me stop guessing whether a bad event was “AI,” “Wi-Fi,” or “camera.”</p><h3>What worked, what didn’t</h3><p><strong>Worked</strong></p><ul><li><strong>Outdoor-proven:</strong> <em>running on my balcony for 1+ month, surviving rain and snow</em></li><li><strong>Pet-safe behaviour: </strong><em>Leo isn’t bothered</em></li><li><strong>Reliable capture after the dual-core split:</strong> <em>~1–3 s from detection to deterrence</em></li><li><strong>Solar-powered after the sleep rewrite:</strong> <em>~3 days runtime with no sun</em></li><li><strong>Faster decisions over time thanks to caching:</strong> <em>~50% of frames are handled locally (cache hit), no backend/vision call</em></li></ul><p><strong>Still improving</strong></p><ul><li><strong>Night image quality:</strong> <em>likely needs IR illumination (and/or a better low-light sensor)</em></li><li><strong>Ultrasound deterrence:</strong> <em>to stay silent to humans (while remaining safe for pets)</em></li><li><strong>Firmware stability:</strong> <em>occasional restarts and upload/network failures to eliminate</em></li><li><strong>Truly off-grid mode:</strong> <em>no Wi-Fi + on-device vision (e.g., quantized YOLOv8 or a smaller detector running on the ESP32-S3)</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z9fT-Ub96Q0NpHSWST_ATQ.jpeg" /><figcaption>BalconyPatrol night shift on the snowy day</figcaption></figure><h3>Finally</h3><p>After months of building and testing, there’s still plenty to improve. If you’d be interested in building something similar for your balcony or garden — or you have ideas for what <strong>BalconyPatrol</strong> should do next — tell me.</p><blockquote>I decided to open-source this project and give it an official name, BalconyPatrol. Visit <a href="https://balconypatrol.com/?ad_id=1">https://balconypatrol.com/</a> to see it working and dollow <a href="https://x.com/BalconyPatrol">@BalconyPatrol</a> for constant updates</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=94a77e95a4cf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Norway -> False, critical error]]></title>
            <link>https://medium.com/@vladmykol/norway-false-critical-error-08c025446810?source=rss-36dbdcee1614------2</link>
            <guid isPermaLink="false">https://medium.com/p/08c025446810</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[yaml]]></category>
            <dc:creator><![CDATA[Vlad Mykol]]></dc:creator>
            <pubDate>Thu, 21 Nov 2024 15:39:24 GMT</pubDate>
            <atom:updated>2024-11-23T14:36:32.378Z</atom:updated>
            <content:encoded><![CDATA[<h4>YAML Debugging Tale for All Developers</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gUG0LfBcoUjQbSAE9vEuqA.png" /><figcaption>Created by Dall-E and me</figcaption></figure><p>Our team had recently decided to migrate some configuration files to YAML. It’s human-readable, widely supported, and works beautifully for configuration files across languages and frameworks.</p><p>This decision caused me to debug for half a day until I discovered YAML was “<strong>too helpful</strong>”. What I learned applies not just to Spring Boot (where this issue first cropped up) but to <strong>any language or framework</strong> that uses YAML for configuration.</p><h3>The Setup: Moving to YAML</h3><p>Let’s say you’re setting up some application configuration. The team decides that JSON files are clunky and hard to read, so YAML seems like the perfect choice.</p><pre>country-mapping:<br>  US: United States<br>  NO: Norway<br>  CA: Canada</pre><p>The expectation was simple: keys represent ISO Alpha-2 country codes (US, NO, CA), and values represent the corresponding country names. My application would load this configuration into a map or dictionary for easy access.</p><pre>import yaml<br><br>with open(&quot;config.yml&quot;, &quot;r&quot;) as file:<br>    config = yaml.safe_load(file)<br><br>print(config[&quot;country-codes&quot;])</pre><p>I expected this output:</p><p><em>{‘US’: ‘United States’, ‘NO’: ‘Norway’, ‘CA’: ‘Canada’}</em></p><h3>The Problem: YAML’s Type Inference</h3><p>When, for example, Spring Boot processes this file, it uses SnakeYAML under the hood to parse the YAML into Java objects. SnakeYAML sees NO and says, “Oh, you mean `false`, don’t you?” No, YAML. I mean ‘<strong>NO</strong>’</p><p>What I actually got:</p><blockquote><em>{‘US’: ‘United States’, ‘false’: ‘Norway’, ‘CA’: ‘Canada’}</em></blockquote><h3>Not a bug, a feature</h3><p>In YAML, certain strings are treated as <strong>boolean values</strong>. It’s not tied to a specific programming language but rather stated in the <a href="https://yaml.org/type/bool.html">specification</a></p><blockquote>A Boolean represents a true/false value. Booleans are formatted as English words for readability and may be abbreviated as a single character.</blockquote><p>So be aware of the following reserved strings:</p><p><strong>on|On|ON|y|Y|yes|Yes|YES|true|True|TRUE| -&gt; true<br>false|False|FALSE|off|Off|OFF|n|N|no|No|NO| -&gt; false</strong></p><h3>The Fix: Quoting Strings</h3><p>The solution is embarrassingly simple: always quote strings in YAML when you mean for them to stay strings.</p><p>Here’s the corrected configuration:</p><pre>country-mapping:<br>  &quot;US&quot;: &quot;United States&quot;<br>  &quot;NO&quot;: &quot;Norway&quot;<br>  &quot;CA&quot;: &quot;Canada&quot;</pre><h3>Lessons for Developers</h3><p>Spring Boot is a fantastic framework. It handles so much for you that you can focus on building features instead of boilerplate code. But sometimes it’s too good.</p><h4>1. Know Your Tools</h4><p>YAML is great, but its quirks can catch you off guard. Always quote values when the type isn’t immediately obvious.</p><p>Bad:<br><em> ```yaml<br> use-feature: yes<br> ```</em></p><p>Good:<br><em>```yaml<br> use-feature: “yes”<br> ```</em></p><h4>2. Validate Configuration</h4><p>Use tools like <a href="https://docs.spring.io/spring-boot/reference/features/external-config.html#features.external-config.typesafe-configuration-properties.validation">Spring Boot’s configuration validation</a>. This won’t catch YAML’s quirks directly, but it will alert you to unexpected `null` values.</p><h4>3. Log Early, Log Often</h4><p>Add logging in `<a href="http://twitter.com/PostConstruct">@PostConstruct</a>` methods to confirm your configuration values are what you expect. Catching an issue early in the application lifecycle saves hours of debugging.</p><pre>@PostConstruct<br> public void logConfigs() {<br> System.out.println(&quot;Contry mapping: &quot; + countryMapping);<br> }</pre><h3>Final Thoughts: Embrace the Pain (or Avoid It)</h3><p>Spring Boot and YAML are powerful tools, but with great power comes great responsibility. As developers, we must understand the tools we use — their strengths and their quirks.</p><p>This little misadventure cost me hours of debugging, but it also reminded me why I love being a developer. Every mistake is a chance to learn, and every lesson is an opportunity to share.</p><p>You&#39;re not alone if you’ve ever been bitten by YAML’s quirks or Spring Boot’s magic. Hopefully, this post helps you avoid the same frustration — or at least makes you smile when it happens.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=08c025446810" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Top 5 Improvements For Create-Next-App]]></title>
            <link>https://blog.devgenius.io/top-5-improvements-for-create-next-app-5e05dfc3dd50?source=rss-36dbdcee1614------2</link>
            <guid isPermaLink="false">https://medium.com/p/5e05dfc3dd50</guid>
            <category><![CDATA[performance]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[typescript]]></category>
            <dc:creator><![CDATA[Vlad Mykol]]></dc:creator>
            <pubDate>Mon, 17 Jul 2023 18:56:13 GMT</pubDate>
            <atom:updated>2023-07-18T16:57:29.980Z</atom:updated>
            <content:encoded><![CDATA[<h4>Your Next.js app could be a lot faster</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f0isDgEmYFP1YKpouh9o3w.png" /><figcaption>Image created by the author</figcaption></figure><p>I refactored my app to use Next.js and spotted an immediate performance drop. The reason was the standard <strong>create-next-app</strong> skeleton and not knowing some Next.js solutions. To address that, I did numerous performance tweaks, and here are the top five that were the most important.</p><h3>1. Slow Rebuilds</h3><p>This one doesn&#39;t affect end users but rather bothers me as a developer, so I started by optimizing a build time. In sizable projects, the rebuild time in create-next-app can be time-consuming as it tries to recompile every module during a build. To address this issue, I implemented incremental builds by configuring my webpack. Check out Webpack’s guide on caching to improve your particular case <a href="https://webpack.js.org/guides/caching/">https://webpack.js.org/guides/caching/</a></p><pre>// webpack.config.js<br>module.exports = {<br>  output: {<br>    filename: &#39;[name].[contenthash].js&#39;,<br>  },<br>  optimization: {<br>    runtimeChunk: &#39;single&#39;,<br>    moduleIds: &#39;deterministic&#39;,<br>    splitChunks: ...<br>},<br>};</pre><h3>2. Dynamic imports</h3><p>This technique refers to “code splitting” and “lazy loading”, which should be done irregardless of the technology stack. “Dynamic imports” is an extremely powerful feature that can be easily implemented but is not showcased in the initial create-next-app skeleton.</p><pre>import dynamic from &#39;next/dynamic&#39;<br>const HeavySection = dynamic(() =&gt; import(&#39;../components/comments&#39;))<br>...<br>  &lt;HeavySection /&gt;</pre><p>Honestly, I prefer <strong>react-lazyload</strong> library instead, but the idea is the same. Components are dynamically loaded only when they come into the viewport.</p><pre>import LazyLoad from &#39;react-lazyload&#39;;<br>import HeavySection from &#39;../components/comments&#39;<br>...<br>  &lt;LazyLoad offset={100}&gt;<br>    &lt;HeavySection /&gt;<br>  &lt;/LazyLoad&gt;</pre><p>Additionally, I moved any analytics script to be lazy loaded</p><pre>import Script from &#39;next/script&#39;<br>...<br>&lt;Script src=... strategy={&#39;lazyOnload&#39;}/&gt;</pre><h3>3. Metatags</h3><p>Metatags are crucial in rendering and optimising any web app. Many important ones are absent by default in create-next-app, so besides <a href="https://javascript.plainenglish.io/improve-seo-with-meta-tags-a-nextjs-example-340536efa9c7">well-known metatags</a>, I also added some OG tags and JSON-LD structured data:</p><pre>&lt;Head&gt;<br>    ...<br>    &lt;meta property=&quot;og:image&quot;<br>          content={fullImageUrl}/&gt;<br>    &lt;meta property=&quot;og:url&quot;<br>          content={fullUrl}/&gt;<br>    &lt;meta property=&quot;og:title&quot; content={title}/&gt;<br>    &lt;meta property=&quot;og:type&quot; content=&quot;article&quot;/&gt;<br>    &lt;meta property=&quot;og:site_name&quot; content={process.env.NEXT_PUBLIC_SITE_URL}/&gt;<br>    &lt;meta property=&quot;og:description&quot;<br>          content={desc}/&gt;<br>    &lt;meta property=&quot;og:locale&quot; content=&quot;en_GB&quot;/&gt;<br>    &lt;link rel=&quot;canonical&quot;<br>          href={checkedCanonicalUrl}/&gt;<br>    &lt;script<br>        type=&quot;application/ld+json&quot;<br>        dangerouslySetInnerHTML={{__html: JSON.stringify(schemaData)}}<br>    /&gt;<br>&lt;/Head&gt;</pre><p>Open Graph Meta Tags (OG) control how your page is represented when shared on social media platforms or other sites. JavaScript Object Notation for Linked Data (JSON-LD) lets you aid search engine crawlers in understanding the content, context, and relationships of the data on your web page. By the way, this is how I also managed to do <a href="https://medium.vladmykol.com/5-star-rating-in-google-search-with-wordpress-59aed2ac73d"><strong>5-Star Rating in Google Search</strong></a><strong>.</strong></p><h3>4. Optimizing fonts</h3><p>Obviously, I was loading only specific fonts, weights, and styles, but I was able to make it even faster by:</p><ul><li>Getting rid of webfonts-loader and self-hosting and preloading font files;</li><li>Using font subsets to reduce the size of the font file by excluding unused characters;</li><li>Swapping fonts to load a page with default fonts and dealing with layout shifts.</li></ul><pre>import localFont from &#39;next/font/local&#39;<br><br>const myFont = localFont({<br>    subsets: [&#39;latin&#39;],<br>    src: &#39;./my-font.woff2&#39;,<br>    display: &#39;swap&#39;,<br>    preload: true<br>})</pre><h3>5. Next/image and CDN</h3><p>And last but not least was image load optimization. I understood the benefit of next/images and refactored my app to be something like this:</p><pre>&lt;Image src={require(&#39;/public/img/logo.jpg&#39;)}<br>  placeholder=&quot;blur&quot;<br>  alt=&quot;Mando chatbot&quot;/&gt;</pre><p>After doing so, I realized that images were not cached with my Cloudflare CDN server anymore<em> (btw, if you are not using Cloudflare CDN, give it another thought, </em><a href="https://developers.cloudflare.com/registrar/get-started/transfer-domain-to-cloudflare/"><em>as it&#39;s free</em></a><em> and makes a huge difference in load time).</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gAnEaVIEgaQiG4CvryiV-w.png" /><figcaption>The cache status should be “HIT”</figcaption></figure><p>I referred to <a href="https://st4ng.medium.com/how-to-use-next-js-image-optimization-with-cloudflare-569da7b3ddc6">this excellent article </a>and was able to fix it.</p><h3>Summary</h3><p>When refactoring my app to use Next.js, I referred to Google Lighthouse and <a href="https://pagespeed.web.dev/">https://pagespeed.web.dev/</a> as affordable (free) visualizing tools that can bring significant performance issues to light.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gvBTg7uhq02Jc-K2XXQr1A.png" /><figcaption>Lighthouse scoring BEFORE</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p5JoVQ1ucuEYH8RuSDjIVg.png" /><figcaption>Lighthouse scoring AFTER</figcaption></figure><p>All measurements were taken on the live instance, as Next.js gives some excellent production build improvements. Your live server might be significantly different from your localhost machine.</p><p>I think that <strong>create-next-app</strong> could have been much better optimized, as many developers rely on it as a ‘best practice’ for beginning a new project, but hopefully, you are now aware and know what to do <em>next</em>.</p><p><em>Rooting for you, curious developer, and see you in the next round! Originally published at </em><a href="http://vladmykol.com/blog/create-next-app-optimization"><em>vladmykol.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5e05dfc3dd50" width="1" height="1" alt=""><hr><p><a href="https://blog.devgenius.io/top-5-improvements-for-create-next-app-5e05dfc3dd50">Top 5 Improvements For Create-Next-App</a> was originally published in <a href="https://blog.devgenius.io/">Dev Genius</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TypeScript or Kotlin for a BackEnd]]></title>
            <link>https://itnext.io/typescript-or-kotlin-for-a-backend-268191b56525?source=rss-36dbdcee1614------2</link>
            <guid isPermaLink="false">https://medium.com/p/268191b56525</guid>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[jvm]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[backend]]></category>
            <dc:creator><![CDATA[Vlad Mykol]]></dc:creator>
            <pubDate>Wed, 17 May 2023 16:23:25 GMT</pubDate>
            <atom:updated>2023-05-25T02:20:09.325Z</atom:updated>
            <content:encoded><![CDATA[<h4>Node.js vs Java to build the next RESTful API</h4><p>Hi. I am Vlad, a Software Developer who is about to start a new project. While I don&#39;t own the final decision, I want to help my Chief Technology Officer make the right choice, as in the end, it&#39;s my team and I who will get our hands dirty with whatever tech stack we end up with.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gRfKYGtsy1qbdt9Hd2hRqQ.jpeg" /><figcaption>TypeScript vs Kotlin</figcaption></figure><p>With the current team skillset, we don’t have complete freedom and can choose only between TypeScript (Node.js) and Kotlin (JVM).</p><p>Given the above motivation and my previous experience with both of these languages, I decided to write this article to get my thoughts together and gather some pros and cons from both worlds for someone who had exactly the same dilemma.</p><h3>Why Node.js (JavaScript runtime environment)</h3><p>You should agree with me that Java or any other JVM language is not suitable for front-end development, so TypeScript is the clear winner here. Using Typescript as a single cross-project language might help the company share resources between front-end and back-end teams for smaller tasks because of the language and type consistency.</p><p>For the teams that use full stack Typescript, their service can be a mini mono repo with their front-end and backend in the same repo sharing the API contract types.</p><h4>Popularity</h4><p>According to GitHub and StackOverflow statistics, TypeScript (or JavaScript) is more popular than Kotlin (or Java). It means a more considerable pull for specialists when it comes to hiring new developers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rkFoKwt32go-rDgBuu9yAw.png" /><figcaption>Stack Overflow Developer Survey 2022</figcaption></figure><h4>Advanced type system</h4><blockquote>“TypeScript provides static typing through type annotations to enable type checking at compile time. This is optional and can be ignored to use the regular dynamic typing of JavaScript” — Wiki</blockquote><blockquote>Kotlin is an open-source statically typed programming language that targets the JVM, Android, JavaScript and Native.” — kotlinlang.org</blockquote><p>I find the type system of TypeScript a lot more flexible than Kotlin. With TS, we are spoiled with: union and intersections, conditional types, mapped types, template literal types, type recursion, and utility types (ex. Partial, Pick, Omit etc.). The above is either impossible with Kotlin or requires tangled custom code to achieve the same one-line result in TypeScript.</p><pre>// Union: Return type definitions with optional error<br>type GetPersonType = Person | { error: string };<br><br>// Intersection: Combines multiple types into a single type<br>type EmployeePerson = Person &amp; Employee &amp; Agent;<br><br>// Conditional Types: Enables type checking based on conditions<br>type NonEmptyArray&lt;T&gt; = T extends Array&lt;infer U&gt; ? U[] : never;<br><br>const nonEmptyNumbers: NonEmptyArray&lt;number&gt; = [1, 2, 3];<br>const nonEmptyStrings: NonEmptyArray&lt;string&gt; = [&quot;Hello&quot;, &quot;World&quot;];<br><br>// Mapped Types: Transforms properties of a type<br>type Optional&lt;T&gt; = { [K in keyof T]?: T[K] };<br><br>const person: Optional&lt;Person&gt; = {<br>  name: &quot;Alice&quot;,<br>  age: 25,<br>};<br><br>// Indexed Access Types: Accesses properties dynamically using index types<br>type PersonProperty = Person[&quot;name&quot; | &quot;age&quot;];<br>const propertyName: PersonProperty = &quot;name&quot;; // Valid values: &quot;name&quot; or &quot;age&quot;<br><br>// Template Literal Types: Creates string literal types from templates<br>type Greeting = `Hello, ${string}!`;<br><br>const message: Greeting = &quot;Hello, TypeScript!&quot;;<br><br>// Type Recursion: Allows recursive definitions<br>type TreeNode&lt;T&gt; = {<br>  value: T;<br>  children: TreeNode&lt;T&gt;[];<br>};<br><br>// Utility Types: Predefined types that manipulate other types<br>type PartialPerson = Partial&lt;Person&gt;;<br>type PickedPerson = Pick&lt;Person, &quot;name&quot;&gt;;<br>type OmittedPerson = Omit&lt;Person, &quot;age&quot;&gt;;</pre><p>When I need to do a lot of JSON manipulation in the project, I find it a lot easier on TypeScript than in Kotlin, for example.</p><h4>Dependency injections</h4><p>TypeScript’s static typing and module system provide strong support for dependency management. It means that DI frameworks are unnecessary to decouple components and do effective unit testing. We can mock the dependency using various testing libraries (like Jest). I’ve never really understood this argument for DI in TypeScript.</p><h4>Cold startup time and memory footprint</h4><p>I used TypeScript for some async back-end work (AWS Lambdas). It works very well in this context. I don’t have as much worry over start-up times with Node.js as we would with the JVM.</p><p><a href="https://filia-aleks.medium.com/aws-lambda-battle-2021-performance-comparison-for-all-languages-c1b441005fd1">AWS Lambda battle 2021: performance comparison for all languages (cold and warm start)</a></p><h3>Why JVM (Java runtime environment)</h3><p>In general, JVM libraries are more stable than Node.js. The appearance of a new framework and the obsolescence of a previously popular framework are common occurrences in the Node.js world.</p><p>Usually, JVM libraries and frameworks have more robust backward compatibility than Node.js. It means you must spend less effort keeping everything up to date while migrating to new versions, which is always good for quality and security reasons.</p><p>Sometimes essential open-source JS libraries with millions of users are supported by a small group of enthusiasts, which can <a href="https://www.zdnet.com/article/when-open-source-developers-go-bad/">cause a lot of trouble</a> with the next update.</p><h4>Powerful frameworks</h4><p>Threading and frameworks are the main drawbacks in the Node.js world. Neither Apache Camel nor Spring Boot exists. Likewise, threading isn’t as attractive. To get a reliable multithreaded program, you must reinvent something like <a href="https://kotlinlang.org/docs/coroutines-overview.html">Kotlin Coroutines</a> in TypeScript. Although async IO is simple, it is ineffective for CPU-intensive operations.</p><h4>Debuging &amp; monitoring</h4><p>Java has fantastic monitoring features for machine clusters. To help find bottlenecks and errors, there are detailed profiling tools and deep hooks in the JVM. The Java enterprise stack powers some of the most advanced servers on the globe, and that says a lot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*u6Y1ygITAZkRNAus.png" /><figcaption>Visual VM</figcaption></figure><h4>Faster in a long run</h4><p>For 99% of projects, the difference will not be visible, but in general, the JVM is faster than Node.js. Besides Kotlin. being a statically typed language, there is much more tuning happening inside the JVM, which gives performance optimization benefits for long-running applications. I am talking about:</p><ul><li>Just-In-Time (JIT) Compilation</li><li>Method Inlining</li><li>Loop Optimizations</li><li>Escape Analysis</li><li>Garbage Collection (GC) Optimizations</li><li>Profile-Guided Optimization (PGO)</li></ul><h3>In the end</h3><p>Even though I did not compare actual syntaxe of TypeScript and Kotlin, I think both languages are pretty decent tools that will be in <a href="https://medium.vladmykol.com/most-popular-programming-languages-in-the-next-30-years-dada903030fd">high demand even after many years</a>. Instead, I focused on two runtime environments (JVM vs Node.js), weighing the pros and cons of both worlds, which is more important from my point of view.</p><p>Long story short, with all the circumstances in mind, I will try to convince my CTO to use TypeScript for the backend as we plan to use React for the front-end. Also, it will not be a high-load system that requires granular monitoring and multithreading. If we choose TypeScript, we can go fully serverless and cut some costs and maintenance overhead. Otherwise, my preference would be Kotlin or Java.</p><p>Wish me luck, and thank you for your time reading, curious reader!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=268191b56525" width="1" height="1" alt=""><hr><p><a href="https://itnext.io/typescript-or-kotlin-for-a-backend-268191b56525">TypeScript or Kotlin for a BackEnd</a> was originally published in <a href="https://itnext.io/">ITNEXT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hey Siri, Be Smart]]></title>
            <link>https://medium.com/@vladmykol/hey-siri-be-smart-ebf30237a95?source=rss-36dbdcee1614------2</link>
            <guid isPermaLink="false">https://medium.com/p/ebf30237a95</guid>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[siri]]></category>
            <category><![CDATA[shortcuts]]></category>
            <category><![CDATA[gpt-4]]></category>
            <category><![CDATA[ios]]></category>
            <dc:creator><![CDATA[Vlad Mykol]]></dc:creator>
            <pubDate>Fri, 17 Mar 2023 14:22:59 GMT</pubDate>
            <atom:updated>2025-02-05T16:45:07.916Z</atom:updated>
            <content:encoded><![CDATA[<h4>Integrating GPT4 (aka ChatGPT) with Siri</h4><p>GPT from OpenAI is much more helpful than any existing AI assistant, so I thought there should be a way to combine good voice recognition from Apple with a leading NLP model from OpenAI to improve the responses of my Siri.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/1*C2n422KPFmHurcyqW76N-Q.png" /><figcaption>Image created by the author</figcaption></figure><p>GPT4 was announced recently and was still in beta testing when I wrote this post. On the other hand, GPT3 was available for at least a year until it became a super popular thing thanks to ChatGPT. Even if you still don&#39;t have access to GPT4, use GPT3 instead. No programming skills are required to follow along.</p><h3>The idea</h3><p>I am tired of Siri responding to any non-standard questions by :</p><blockquote>Here is what I found in the Interten…or I am not sure…</blockquote><p>So I created a “Be Smart” iPhone Shortcut that transforms voice input into text, redirects it to OpenAI API to get a response from the GPT4 model and pronouns it back to me.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*uxUs8VrqOOxV8zv_50qoVA.png" /><figcaption>Conversation with Siri after integrating GPT4</figcaption></figure><h3>Before we start</h3><p>You will need the following:</p><ul><li>An iPhone or MacBook with the installed Shortcut app</li><li>An OpenAI account where you need to create an API key to access GPT4 API. It&#39;s not free, but it is a low price for the value it brings. It depends on how much you will use it, but for me, as an occasional user, it costs a few bucks a month. To make it even cheaper, use GPT3 or GPT3.5 turbo instead.</li></ul><h3>Implementation</h3><p>You must import <a href="https://www.icloud.com/shortcuts/4768af5295104a7294d6482a188d5cbb">this shortcut </a>to your iPhone and replace the token with your API key from the <a href="https://platform.openai.com/">OpenAI</a> website.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1k_bWcqJBht-FKziCV82yA.png" /><figcaption>Shortcut preview</figcaption></figure><p>Here I repeat the routine ten times to make it more conversation-like and allow rephrasing a question if you are unhappy with the result.</p><p>Now you can say, “Hey Siri Be Smart&quot; to run this shortcut, dictate any question you have and get a meaningful response.</p><h3>Further improvements</h3><p>Once Siri reads a response from GPT4, it disappears from the screen and asks for another question. If you want to save that response instead, I suggest modifying your shortcut with additional logic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/322/1*Gc-cUKzq3yWP_4uoTwZlHw.png" /></figure><p>That way, you can save a particular response to Notes once it was read by Siri or skip saving and ask the next question instead.</p><h3>Summarize</h3><p>Shortcuts automation is an easy way of integrating Siri with GPT4 to make your voice assistant as bright as ChatGPT. Of course, this is not a perfect solution, but it could make your life easier until we get native personal assistance based on GPT (like JarvisGPT).</p><p>No doubt that OpenAI made a massive punch in the face to all tech giants, including Apple, and I am sure if other companies does not improve their assistants, they all will fall behind very soon.</p><p>Meanwhile, here is my Shortcut</p><p><a href="https://www.icloud.com/shortcuts/4768af5295104a7294d6482a188d5cbb">https://www.icloud.com/shortcuts/4768af5295104a7294d6482a188d5cbb</a></p><p>to make your Siri smart.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ebf30237a95" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AnyMap Deep Merge with Kotlin]]></title>
            <link>https://itnext.io/anymap-deep-merge-with-kotlin-740c5fd6213f?source=rss-36dbdcee1614------2</link>
            <guid isPermaLink="false">https://medium.com/p/740c5fd6213f</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[json]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[deep-merge]]></category>
            <dc:creator><![CDATA[Vlad Mykol]]></dc:creator>
            <pubDate>Wed, 15 Mar 2023 14:10:03 GMT</pubDate>
            <atom:updated>2025-02-05T16:45:43.955Z</atom:updated>
            <content:encoded><![CDATA[<h4>How to merge two JSONs with no additional libraries</h4><p>Like my previous “<a href="https://medium.com/better-programming/kotlin-retry-to-make-your-code-more-resilient-5b8cc4fac4e4">Kotlin retry</a>” wrapper function, this is another handy function from my collection when I need to deep merge any two JSON-like Maps without additional libraries.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*96WrHPWwsCYHZWxvdRjH4w.png" /><figcaption>Image created by the author</figcaption></figure><p>Dealing with JSON could be easy for loosely typed programming languages like TypeScript or Python, but with Kotlin or Java, it&#39;s not a straightforward task. To represent JSON with Kotlin object, we must explicitly define all fields or use some special datatypes.</p><h3>Practical need</h3><p>I was developing REST API with frequently changed definitions, so instead of a particular input datatype, I came up with a controller like this:</p><pre>@POST<br>@Consumes(MediaType.APPLICATION_JSON)<br>fun createUser(<br>    data: Map&lt;String, Any&gt;<br>)</pre><p>This definition allows receiving any JSON in the <em>“data”</em> field, but…</p><blockquote>“The cost of flexibility is complexity” — Martin Fowler</blockquote><p>When I wanted to add default values to some input parameters, I ended up merging two JSONs (input and config) represented by <em>Map&lt;String, Any&gt; </em>type.</p><p>There is no standard function in Kotlin to deep merge two nested JSON-like maps, so I wrote my own method with recursions to do that.</p><h3>Method definition</h3><p>First, we define a custom type of our AnyMap to store JSON representation.</p><pre>typealias AnyMap = Map&lt;String, Any&gt;</pre><p>Then we define an extension function to safely cast nested maps, omit compiler warnings and throw explicit errors if something goes wrong. Since it is two JSON-like maps, we expect <em>MapKey</em> to be a <em>String</em>.</p><pre>val Any?.asAnyMap: AnyMap<br>    get() {<br>        val resultMap = mutableMapOf&lt;String, Any&gt;()<br>        if (this is Map&lt;*, *&gt;) {<br>            for (item in this) {<br>                val key = item.key<br>                val value = item.value<br>                if (key != null &amp;&amp; value != null) {<br>                    if (key is String) {<br>                        resultMap[key] = value<br>                    } else {<br>                        throw RuntimeException(&quot;Expected Map&lt;String,Any&gt; but was Map&lt;${key::class.simpleName},${value::class.simpleName}&gt;&quot;)<br>                    }<br>                }<br>            }<br>        } else {<br>            val typeName = if (this == null) &quot;null&quot; else this::class.simpleName<br>            throw RuntimeException(&quot;Expected Map&lt;*,*&gt; but was $typeName&quot;)<br>        }<br><br>        return resultMap<br>    }</pre><p>Finally, we define a method that merges two maps, including nested maps and collections. It also respects any “null” values in the source map, so they are not overridden by merge.</p><pre>private fun deepMerge(destination: AnyMap, source: AnyMap): AnyMap {<br>    val resultMap = destination.toMutableMap()<br>    for (key in source.keys) {<br>        //recursive merge for nested maps<br>        if (source[key] is Map&lt;*, *&gt; &amp;&amp; resultMap[key] is Map&lt;*, *&gt;) {<br>            val originalChild = resultMap[key].asAnyMap<br>            val newChild = source[key].asAnyMap<br>            resultMap[key] = deepMerge(originalChild, newChild)<br>        //merge for collections<br>        } else if (source[key] is Collection&lt;*&gt; &amp;&amp; resultMap[key] is Collection&lt;*&gt;) {<br>            if (!(resultMap[key] as Collection&lt;*&gt;).containsAll(source[key] as Collection&lt;*&gt;)) {<br>                resultMap[key] = (resultMap[key] as Collection&lt;*&gt;) + (source[key] as Collection&lt;*&gt;)<br>            }<br>        } else {<br>            if (source[key] == null || (source[key] is String &amp;&amp; (source[key] as String).isBlank())) continue<br>            resultMap[key] = source[key] as Any<br>        }<br>    }<br>    return resultMap<br>}</pre><blockquote>You should be aware that build in “+” operator does a shallow merge by default.</blockquote><p>If you do not expect a shallow merge and want to eliminate the confusion, you can override “+” operator to use your newly created deep merge function.</p><pre>operator fun AnyMap.plus(source: AnyMap): AnyMap {<br>    return deepMerge(this, source)<br>}</pre><h3>Usage</h3><p>Let&#39;s imagine that we need to merge the two following nested maps.</p><pre>val map1 = mapOf(<br>    &quot;name&quot; to &quot;John&quot;,<br>    &quot;address&quot; to mapOf(<br>        &quot;nums&quot; to listOf(1, 2),<br>        &quot;line1&quot; to 1,<br>        &quot;line2&quot; to null<br>    )<br>)<br><br>val map2 = mapOf(<br>    &quot;age&quot; to 18,<br>    &quot;address&quot; to mapOf(<br>        &quot;nums&quot; to listOf(3),<br>        &quot;line2&quot; to 2,<br>        &quot;line3&quot; to 3<br>    )<br>)</pre><p>Now we can compare the outcome of merging with shallow and deep merge functions using “+” operator.</p><pre>// BEFORE - shalow merge/replace, standart behaviour<br>print(map1 + map2)<br>//{name=John, address={nums=[3], line2=2, line3=3}, age=18}<br><br>// AFTER - deep merge, overridden ’+’<br>println(map1 + map2)<br>//{name=John, address={nums=[1, 2, 3], line1=1, line2=2, line3=3}, age=18}</pre><h3>Conclusion</h3><p>Sometimes it&#39;s required to make your REST API controller flexible enough to receive any JSON as an input object and deal with it dynamically after. While there are multiple ways of doing that, I prefer representing JSON with standard Map&lt;String, Any&gt; type instead of special JSONObject datatype.</p><p>Merging two Maps by “+” operator will lead to a shallow merge. To do a proper deep merge, you must use additional libraries or leverage my custom implementation above ☝️. To avoid possible mistakes, you can also override “+” operator.</p><p>I hope it was helpful, and see you in the next round, curious reader.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=740c5fd6213f" width="1" height="1" alt=""><hr><p><a href="https://itnext.io/anymap-deep-merge-with-kotlin-740c5fd6213f">AnyMap Deep Merge with Kotlin</a> was originally published in <a href="https://itnext.io/">ITNEXT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[2023 AI State Of The Art: It Feels Like Falling Behind]]></title>
            <link>https://medium.com/@vladmykol/2023-ai-state-of-the-art-it-feels-like-falling-behind-dedb93000355?source=rss-36dbdcee1614------2</link>
            <guid isPermaLink="false">https://medium.com/p/dedb93000355</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[pimeyes]]></category>
            <category><![CDATA[merlin]]></category>
            <dc:creator><![CDATA[Vlad Mykol]]></dc:creator>
            <pubDate>Sat, 28 Jan 2023 17:48:41 GMT</pubDate>
            <atom:updated>2025-02-05T16:46:03.802Z</atom:updated>
            <content:encoded><![CDATA[<h4>Why, Where, and How modern AI tools matters</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i42ejIFPkyP5Myq3JgF5AQ.png" /><figcaption>2023 AI rise (created by the author)</figcaption></figure><p>By 2023 we have so many powerful AI tools that when you find something like ChatGPT for the first time, it feels like you’re falling behind. I have always been curious about Artificial Intelligence tools, especially from a real-world appliance perspective. Now, I can’t stand sharing my thoughts with you when there are so many exciting things.</p><h3>WHY AI tools</h3><p>First, let’s clear a common misconception. The term Artificial Intelligence (AI) is heavily overused. There is no complete Artificial Intelligence (at least not in public access). A much better word for everything we know today is “AI tool”, and here is why:</p><blockquote>Artificial Intelligence, by definition, consists of 7 main branches. Today there are tools successfully combining only 4 of them.</blockquote><p>Some AI fields of study (components) are much more developed than others, and some even have their subcomponents. <strong>“Vision”</strong>, for example, has two branches where <strong>Image Recognition</strong> is the ability of a program to recognize objects or people in an image. And <strong>Machine Vision</strong> is the application of computer algorithms to extract information from an image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/993/1*lgq_thYEwkEZn9qtZmkbHA.png" /><figcaption>AI components (created by the author)</figcaption></figure><p>While we have at least some tools in every branch of Artificial Intelligence, the most advanced ones succeeded in their combination.</p><p><strong>Timeline of the most significant AI tools and their components (approximate year of success):</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l1J8mLSCWDisZ4VlE6_u0g.png" /><figcaption>AI timeline (created by the author)</figcaption></figure><blockquote>I see considerable potential in Google Duplex as a tool, but there are many things for Google to fix before it becomes stable. That is why it is greyed out.</blockquote><h3>WHERE AI tools are used</h3><p>Here are only some of the examples to give you an idea of why AI tools are an integral part of life in the twenty-first century:</p><ul><li>Recommendations engines, fraud/abuse detectors, and author rights trackers are today’s most common AI tools. They are everywhere, from Spotify and YouTube music to online shops and social networks.</li><li>With AI predictions, big online shops (like Alibaba and Amazon) know what customers might want to buy and starts delivery upfront. This is the way of achieving one-day delivery even with complex logistics.</li><li>Deep Voice from Baidu adds audio to online books with the author’s voice. The author needs to read a sample text for a tool to imitate his voice for the whole book — the same idea for VALL-E from Microsoft.</li><li>The AI algorithms in Amazon Go shops identify the shopper’s actions, pair them with sensor information, debit the Amazon shopper’s account as they exit the store, and send them a receipt.</li></ul><h3>HOW can I benefit</h3><p>There is so much I can show you here, but not to make it boring, I selected only the most exciting ideas from my perspective and divided them into categories.</p><h4># Creating — if you have some coding skills</h4><p>Machine learning must be the oldest and most developed branch of AI, hence the easiest to start from. You can create your first Deep learning model with just a few lines of Python code to predict customer behaviour, stock market trends or even weather patterns.</p><pre># MultiLayer Perceptron (MLP) neural network<br>model = Sequential()<br># fully-connected network layer with number of nodes representing the number of input variables<br>model.add(Dense(x_train.shape[1], input_dim=x_train.shape[1], activation=&#39;relu&#39;))<br># fully-connected network layer with 1 node for representing output<br>model.add(Dense(1, activation=&#39;sigmoid&#39;))<br># compile the keras model with loss function for a binary classification problems<br>model.compile(loss=&#39;binary_crossentropy&#39;, optimizer=&#39;adam&#39;, metrics=[&#39;accuracy&#39;])</pre><p>Of course, the most challenging part of machine learning is model training. The accuracy and reliability of AI-based predictions often depend on the data quality used for the projections. There are many good books about it, but if you want to understand the idea without spending much time on theory, I recommend you complete this manual and explore <a href="https://machinelearningmastery.com/tutorial-first-neural-network-python-keras/">this blog</a>. That is how I found many answers to my questions.</p><h4># Evaluating — if you want a ready-to-use tool</h4><p>There are lots of startups and even big companies that take complex logic of AI behind the scene and give you only beautiful wrappers to use:</p><ul><li>Grammarly — to fix your grammar in any writing you do</li><li>PimEyes Reverse Image Search — to find a person all over the Internet by photo</li><li>Dall-E and Midjourney — to create or edit images by just describing what you want</li><li>Deep Nostalgia — to make your old photos live</li></ul><p>… I am sure this list can go on and on. Let me know if I missed your favourite AI tool.</p><h4># Applying — if you do not have a specific need</h4><p>Even without knowing much about AI and being willing to learn something new, you can use one of the most powerful AI tools in your daily life for free. Meet <a href="https://chrome.google.com/webstore/detail/merlin-openai-chatgpt-pow/camppjleccjaphfdbohjdohecfnoikec">Merlin</a> — GPT3-based Google Chrome plugin.</p><p>Here is an example of automating my daily email routine by asking <a href="https://chrome.google.com/webstore/detail/merlin-openai-chatgpt-pow/camppjleccjaphfdbohjdohecfnoikec">Merlin</a> for the perfect polite response, even without reading a full email. Merlin is <a href="https://openai.com/blog/chatgpt/">ChatGPT</a> but in handy wrapping.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zdl0x4zN19ZmKeOeUNYU5g.png" /><figcaption>Merlin(GPT3) helps me to respond to an email</figcaption></figure><p>Harry up, this tool is soo good that I bet it won’t be free very soon.</p><h3>After all</h3><p>By exploring modern AI tools and knowing the main AI components, you can see that we are less than halfway from real AI. Four out of seven main AI fields of study are successfully combined in the last couple of years. Now you probably understand why some people (<a href="https://www.vox.com/future-perfect/2018/11/2/18053418/elon-musk-artificial-intelligence-google-deepmind-openai">including Elon</a>) are even scared by how fast AI technologies are growing today.</p><p>2023 is predicted to be an exciting and innovative year for Artificial Intelligence (AI), and if you still are not using at least <a href="https://chrome.google.com/webstore/detail/merlin-openai-chatgpt-pow/camppjleccjaphfdbohjdohecfnoikec">Merlin</a>, then you’re falling behind.</p><p>And one more thing — this article was written solely by a human 😁. Given what big publishers such as <a href="https://futurism.com/the-byte/cnet-publishing-articles-by-ai">CNET do</a>, it should become important now.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dedb93000355" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Optimising 3 Years Old AWS Infrastructure]]></title>
            <link>https://medium.com/@vladmykol/optimising-3-years-old-aws-infrastructure-fddbffada15b?source=rss-36dbdcee1614------2</link>
            <guid isPermaLink="false">https://medium.com/p/fddbffada15b</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Vlad Mykol]]></dc:creator>
            <pubDate>Tue, 24 Jan 2023 02:09:00 GMT</pubDate>
            <atom:updated>2025-02-05T16:47:06.200Z</atom:updated>
            <content:encoded><![CDATA[<h4>Applying modern best practices for Amazon Web Services</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/1*fS6zKEL4L8flVMiAHFeNJw.png" /><figcaption>Image created by the author</figcaption></figure><p>If your AWS infrastructure (like ours) was created around three years ago and hasn&#39;t been reviewed for modern best practices since then, it&#39;s just about time to explore some exciting updates.</p><p>Sometime before, I passed the AWS Architecture Associate certification, and now I am preparing for the AWS Architecture Professional exam. All these pushed me to review our existing AWS infrastructure and develop multiple improvements we hadn’t considered before because they simply weren’t there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q9YBJuUUrZoK4-Td3SGMSg.png" /><figcaption>The Dunning-Kruger effect in knowing AWS</figcaption></figure><blockquote>Intresting fact that EC2 and S3 are not about version 2 or 3 as lots of people might think at first. This is just amusing shortening of dublicated letters. Otherwise it could have been ECC (Elastic Compute Cloud) and SSS (Simple Storage Service).</blockquote><h3>IAM Identity Center (aka AWS SSO)</h3><p>Even though AWS SSO appeared more than 3 years ago, only recently it became really <a href="https://aws.amazon.com/blogs/security/scale-your-workforce-access-management-with-aws-iam-identity-center-previously-known-as-aws-sso/">flexible tool</a>. It&#39;s a good way to hook identity management to your company&#39;s preference provider and use just one account for everything (SSO). Before, it could have been quite a task to make some development tools <a href="https://github.com/aws/aws-cli/issues/4982">work properly</a> with AWS. Now that all those issues are fixed, it&#39;s time to consider this convenient security feature offered by Amazon Web Services.</p><h3>App builders</h3><p>Many big companies use AWS as an infrastructure-as-a-service (IaaS) tool. Some companies mix it with platform-as-a-service (PaaS) tools from AWS to eliminate some of the management overhead while younger companies or startups benefit from packaged software-as-a-service (SaaS) offerings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jFOnft4TQABTxJnMIHHNxg.png" /><figcaption>Image created by the author</figcaption></figure><p>While I still think “app builders” (left part of the above picture) are not a good choice for long-term projects, now I definitely consider some “automation” offered by a platform, especially for any POC or StartUp projects.</p><h3>Load Balancing</h3><p>Load balancing, discovery and failover are essential parts of any highly available system. While ALB (or ELB, or API Gateway) became a pretty standard choice for load-balancing incoming requests, some of the approaches in load balancing evolved since then. One of them was the load-balancing algorithm. Are you still on round-ribbon?</p><p><a href="https://medium.com/dazn-tech/aws-application-load-balancer-algorithms-765be2eca158">AWS Application Load Balancer algorithms</a></p><p>Another important improvement was in load balancing and managing internal calls. Think about Microservice architecture. Before, we had to configure some combination of ALB + ECS Discovery + App Mesh. Now it could be done within only one service — <a href="https://aws.amazon.com/blogs/aws/new-amazon-ecs-service-connect-enabling-easy-communication-between-microservices/">Service Connect</a>.</p><h3>Cheaper CPU power (arm64)</h3><p>You might have heard about the revolutionary Apple M1 and M2. Still, Apple is not the only tech company that came up with the brilliant idea of creating its own CPUs on arm64 architecture.</p><p>We were not ready for this technology when it first appeared, but now when all new software finally supports arm64, we can use better CPU performance for the same or even lower price offered by AWS Gravitron-based servers. These are how you can update your existing infrastructure:</p><ul><li><strong>Lambda</strong> —one setting to enable Graviton. No downtime (up to 34% better price-performance improvement)</li><li><strong>Database</strong> — one setting to enable Graviton. Some downtime. (up to 52% better price-performance improvement)</li><li><strong>AWS Fargate, EC2</strong> — one setting to enable Graviton. Some downtime. Depending on what software you use (up to 40% better price-performance improvement)</li></ul><h3>Serverless</h3><p>Although AWS Lambda was the feature that made serverless popular in the first place, it has improved significantly since then. Not only were existing tools improved, but completely new approaches were introduced.</p><ol><li>One of the major downsides of using Lamdas was the complex “local” debugging setup. Now it became much simpler with <a href="https://aws.amazon.com/blogs/compute/better-together-aws-sam-cli-and-hashicorp-terraform/">recent announcements</a>.</li><li>Now you can have Lambda running for 15 minutes instead of 3 as before, so very few specific tasks are left to be processed for such a long time. And even if there is something, you are more than welcome to use <a href="https://docs.aws.amazon.com/batch/latest/userguide/what-is-batch.html">AWS Batch</a> and “pay only for what you use.”</li><li>Even the cold start time, which was a major argument against serverless, is <a href="https://filia-aleks.medium.com/aws-lambda-battle-2021-performance-comparison-for-all-languages-c1b441005fd1">getting much better</a>. The rise of JIT compilers such as GraalVM and <a href="https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html">Lambda SnapStart</a> caused us to reconsider using serverless instead of Docker containers for our JVM Rest API.</li></ol><blockquote>TIP: If you use Lamdas, make sure you benefit from reusing TCP connections, as it improves warm start time by up to 50%. That is a usual mistake, especially if you use NodeJS and AWS SDK version 2, where it&#39;s not a default option. So either update to version 3 or change the <a href="https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/node-reusing-connections.html">default behaviour</a>.</blockquote><h3>After all</h3><p>Amazon Web Services is still actively evolving. And even the Cloud Console interface is updated literally every month (which is sometimes annoying). Given all that, reviewing existing AWS infrastructure for modern best practices is necessary on a regular basis, and the critical point to do that is three years.</p><blockquote>Almost all AWS certificates have expiration time of 3 years, hence everyting you learned about AWS might be invalid after 3 years and that is what that expiration time about</blockquote><p>see you in the next round, curious reader!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fddbffada15b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[5-Star Rating in Google Search with WordPress]]></title>
            <link>https://medium.com/@vladmykol/5-star-rating-in-google-search-with-wordpress-59aed2ac73d?source=rss-36dbdcee1614------2</link>
            <guid isPermaLink="false">https://medium.com/p/59aed2ac73d</guid>
            <category><![CDATA[google-ranking]]></category>
            <category><![CDATA[seo]]></category>
            <category><![CDATA[wordpress]]></category>
            <dc:creator><![CDATA[Vlad Mykol]]></dc:creator>
            <pubDate>Sat, 14 Jan 2023 18:04:49 GMT</pubDate>
            <atom:updated>2025-02-05T16:47:34.780Z</atom:updated>
            <content:encoded><![CDATA[<h4>Free way to make your website stand out</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OcktEIwXg9iJ7YTz-TaGeA.png" /><figcaption>Image created by the author</figcaption></figure><p>I’ve never used WordPress before, but I am a backend software engineer, and since my good friend asked me to help with these “rating stars” thing, I had to figure it out.</p><blockquote>Who am I to break the myth that Tech person can fix a fridge?</blockquote><p>When I tried to search for a manual on “<em>how to add rating stars in a google search with WordPress”</em>, I found only some overpriced plugins or overcomplicated manuals. People are trying to profit from it, but since that’s not my goal, and I managed to get Google to show my made-up rating for free pretty easily, I want to share this achievement with you too.</p><h4>The result is not guaranteed</h4><p>First, you need to understand that you cannot control what Google shows about your website. You can only highlight some information, but since the search engine algorithm is constantly improving (my friend calls it Search Engine Storm), the chance that Google shows what you want is not guaranteed. Even if you buy the most expensive WordPress plugin for SEO or find the best WordPress developer, the outcome is up to Google and might change over time.</p><h4>The Benefit</h4><p>Google search results might show whatever rating you want next to your website, making it more appealing and increases the chance of being clicked. However, even a 5-star rating is not something Google considers when showing your website in search results, and that is not a ranking rating.</p><h4>How it works</h4><p>Google might help users find your page by showing them a small sample of that content — the “snippet.” There are various unreported Google algorithms to create these snippets and give users relevant information about what they’ll find when they visit your site. In 2009, Google announced a way for website owners to influence these snippet-generating algorithms. It&#39;s said that additional information might be taken from HTML-based structured data on a page, which is what we are about to add.</p><p>First, I thought a star rating was somehow related to Google Reviews, but they are different things.</p><blockquote>You might have your own rating engine or even don&#39;t have any reviews at all and get a 5-star rating next to your website.</blockquote><h3>Step 1-Find way of editing Headers</h3><p>We need to add structured data to the HTML page header. One way is to go and modify WordPress files directly, but I don&#39;t recommend this since it is easy to break something, especially if you don&#39;t have any coding skills. I used the <a href="https://wordpress.org/plugins/wp-headers-and-footers/">“Insert Headers And Footers”</a> plugin. It&#39;s free and does exactly what we need.</p><p>The downside of this approach is that the same rating will be applied to all your website pages. In my case, it was okay.</p><h3>Step 2-Add Structured Data</h3><p>Now add something like this to your Headers.</p><pre>&lt;script type=&quot;application/ld+json&quot;&gt;<br>{<br>  &quot;@context&quot;: &quot;https://schema.org/&quot;,<br>  &quot;@type&quot;: &quot;Product&quot;,<br>  &quot;name&quot;: &quot;Your product name here&quot;,<br>  &quot;aggregateRating&quot;: {<br>    &quot;@type&quot;: &quot;AggregateRating&quot;,<br>    &quot;ratingValue&quot;: &quot;5&quot;,<br>    &quot;bestRating&quot;: &quot;5&quot;,<br>    &quot;worstRating&quot;: &quot;1&quot;,<br>    &quot;ratingCount&quot;: &quot;995&quot;<br>  }<br>}<br>&lt;/script&gt;</pre><p>That is the minimum you need. I added more info, like brand description and image, but I’m unsure if that matters to get a star rating. I recommend using a <a href="https://lxrmarketplace.com/structured-data-generator.html">Structured Data Generator</a> to get what you need.</p><p>As you can see above, we can set any rating we want. Theoretically, you can even set a 100500 rating, but since everyone gets used to the 5-grade system, don&#39;t be over-creative.</p><p>While I was researching this, I found a bunch of other must-have headers that any website will benefit from:</p><ul><li>Meta tags for <a href="https://ogp.me/">Open Graph protocol</a></li><li>Canonical tag</li><li>Robots tag</li></ul><p>but that is a whole different story.</p><h3>Step 3-Verify</h3><p>To ensure you did everything correctly, use the <a href="https://search.google.com/test/rich-results">official Google tool</a> to verify if your Structured Data is correct. In my case, Google did not see any structured data on my website. The reason was a <strong>stale cache</strong>. Ensure you refresh the cache (or/and CDN servers) if you use any Speed Buster plugins like Jetpac, WP Rocket, WP Super Cache, etc.</p><h3>Step 4-Wait</h3><p>It will take at least one week for Google to react to your new Structured Data info. Two weeks passed in my case when I started seeing stars next to my website. If you still don&#39;t see the desired outcome after a reasonable time, you should try adding a real review to be visible somewhere on your webpage, representing the same numbers as in your structured data.</p><p>Since our structured data is data that does not relate to Google Reviews, we may need to update the rating or number of reviews manually over time, as described in step 2.</p><h3>In general</h3><p>I learned and showed you above how to make Google show a 5-star rating next to your website for free by adding structured data to the HTML page. Also, it looks like it’s even unnecessary to have actual Reviews to show a Star Rating next to your website in Google Search results. There are many expensive SEO plugins on the internet, but remember that the final result is up to Google.</p><p>This rating is entirely made up and might help your website stand out. In general, that’s a simple and accessible part of SEO that I would consider doing if I had my website.</p><p><em>I hope I saved you some time googling, and see you in the next round, curious reader.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=59aed2ac73d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>