<?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 Oguzhan Tasimaz on Medium]]></title>
        <description><![CDATA[Stories by Oguzhan Tasimaz on Medium]]></description>
        <link>https://medium.com/@oguzhantasimaz?source=rss-3c88d286a83e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*E_tLGG9aw1KMigjhPs7sNQ.jpeg</url>
            <title>Stories by Oguzhan Tasimaz on Medium</title>
            <link>https://medium.com/@oguzhantasimaz?source=rss-3c88d286a83e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 12:18:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@oguzhantasimaz/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[Recreating the Solace of a Human Heartbeat: The Story Behind Lubb]]></title>
            <link>https://medium.com/@oguzhantasimaz/recreating-the-solace-of-a-human-heartbeat-the-story-behind-lubb-cfee64000851?source=rss-3c88d286a83e------2</link>
            <guid isPermaLink="false">https://medium.com/p/cfee64000851</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[indiehackers]]></category>
            <category><![CDATA[product-design]]></category>
            <category><![CDATA[mental-health]]></category>
            <category><![CDATA[sleep]]></category>
            <dc:creator><![CDATA[Oguzhan Tasimaz]]></dc:creator>
            <pubDate>Thu, 27 Aug 2026 19:36:00 GMT</pubDate>
            <atom:updated>2026-08-27T19:36:00.092Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><em>“The repetition and rhythm of sensory stimulation… brings the body back to a calm state that allows the brain to function most effectively.”</em></blockquote><blockquote><strong><em>- </em>Dr. Bruce Perry, What Happened to You?</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AbbSrkNZNPLgP-SlNhn9fQ.png" /></figure><p>There is a primitive, deeply biological comfort in falling asleep on a partner’s chest.</p><p>Long before we understood the terms “co-regulation” or “parasympathetic nervous system,” humans used tactile rhythm to soothe each other. As your ear rests against another person, <strong>their heartbeat becomes a biological metronome</strong>. Your breathing slows, your vagus nerve signals that you are safe, and your busy thoughts dissolve into the steady, twin-toned swell of a <em>lub-dub</em>.</p><p>But for millions of people, sleep is a solitary transition. Whether you are traveling for work, maintaining a long-distance relationship, or simply struggling in an empty bed, nighttime can bring a quiet, compounding <strong>anxiety.</strong></p><p>When we looked at the tools available to solve this, we found a disconnect. Current sleep apps catalog hours of loops: pouring rain, deep-space rumble, or synthetic white noise. While useful, these solutions are fundamentally clinical and passive. They fill the room with sound, but they do not provide a comforting physical presence.</p><p><strong>We wanted to build something that felt alive, comforting, and intimate.</strong></p><p>That is why we created Lubb a realistic heartbeat simulator designed to go under the edge of your pillow.</p><h3>The Physics of a Heartbeat Under the Pillow</h3><p>Most phones under pillows are just screens glowing in the dark, emitting high-pitched notification alerts. But inside every iPhone is one of the most sophisticated pieces of consumer engineering: the Taptic Engine.</p><p>Rather than vibrating like a cheap pager, the Taptic Engine can fire minute, highly localized kinetic transients. To the touch, it doesn’t feel like a buzzer; it feels like a tap.</p><p>When you place your iPhone under the edge of your pillow and turn on Lubb, the app disables the visual distraction. It uses exact kinetic waveforms to simulate the two distinct phases of a heartbeat:</p><ol><li>The “Lub” (S1): The closing of the AV valves a deep, round, and slightly longer pulse.</li><li>The “Dub” (S2): The closing of the semilunar valves a slightly sharper, quieter, and quicker follow-up.</li></ol><p>Because bedding and mattresses differ, the app includes highly responsive Feel and Strength sliders. You can morph the pulse from a round, organic thump (for heavy down pillows) to a crisper tap (for thinner foam or travel setups) and find the exact tactile balance that carries through your linens without shaking the bed.</p><h3>Helping Your Brain Chase a Slower Pace</h3><p>When we lie awake, our heart rates are often elevated from the day’s cortisol. Going straight from a screen-scrolling state to a resting rate of 50 BPM is a difficult bridge for the brain to cross.</p><p>Lubb solves this through <strong>Drift Mode.</strong></p><p>When active, you select a resting BPM target. Drift Mode starts you up to 15 BPM faster and gently decreases the pacing over the first 25 minutes. By mirroring your current state and slowly drawing the rhythm down, the app co-regulates your body’s physiology, naturally coaxing your breathing and pulse into a slow, somnolent drift.</p><p>Because a tempo change should never startle you, the app calculates these transitions at exact beat boundaries. <strong>The rhythm adjusts seamlessly, with zero stutters.</strong></p><h3>A Bedtime App That Respects Your Dark Room</h3><p>Many modern apps are designed to hoard your attention. They track your sleep cycles, compute scores, send morning notifications, and encourage you to stare at a screen right before closing your eyes.</p><p>We built Lubb under a strict design language we call “The Ember.”</p><p>When you start a session, the screen goes entirely black. The OLED display is off. There are no shifting graphics, no notifications, and no neon glares. It stays true black all night to preserve your sleep environment and protect your device’s battery.</p><p>To start your night, you don’t even have to open the app. Lubb fully integrates with iOS:</p><ul><li>Sleep Focus Automation: Set your iPhone to automatically launch Lubb the moment your Sleep Focus is activated.</li><li>Siri &amp; Shortcuts: Start your session with a quick voice command as you lay your head down.</li><li>Home Screen Quick Actions: Press and hold the app icon to “Start Tonight” instantly.</li></ul><p>At the end of your session, the haptics and audio don’t simply cut off; they execute a gentle, multi-minute fade so you are never awakened by the sudden absence of the rhythm.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FRCEcaESX_WE%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fshorts%2FRCEcaESX_WE&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FRCEcaESX_WE%2Fhq2.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/2d81cc3e18ff2cd89a93c715076b1b6e/href">https://medium.com/media/2d81cc3e18ff2cd89a93c715076b1b6e/href</a></iframe><h3>Sleep is Personal</h3><p>Your sleep tools shouldn’t demand a login or a bloated monthly subscription.</p><p>Lubb is <strong>free</strong> to use for 10-minute sessions as often as you need them. This fits perfectly within the average 10-to-20-minute window of natural sleep onset.</p><p>If you need deeper, extended comfort, Lubb Plus offers 30-minute wind-downs, 2-hour deep starts, and unrestricted all-night sessions.</p><ul><li>Annual Subscription: $9.99/year (includes a 7-night free trial)</li><li>Lifetime Access: $29.99 (a one-time purchase with no recurring fees)</li></ul><p>Whether you are coping with a quiet bedtime, <strong>looking to soothe nighttime anxiety</strong>, or <strong>missing the presence of someone far away</strong>, turn off the screens. Slide Lubb under your pillow, close your eyes, and let the rhythm carry you to <strong>sleep</strong>.</p><p><em>Lubb is available now on the iOS App Store. Click or search for </em><a href="https://apps.apple.com/us/app/lubb-heartbeat-for-sleep/id6791570461"><em>“Lubb” </em></a><em>or visit </em><a href="https://thelubb.com/"><em>thelubb.com</em></a><em> to learn more.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cfee64000851" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From $0 to $300 MRR: How I Grew My One App by Tweaking Freemium Features]]></title>
            <link>https://medium.com/@oguzhantasimaz/from-0-to-300-mrr-how-i-grew-my-one-app-by-tweaking-freemium-features-bbc3ebf8d526?source=rss-3c88d286a83e------2</link>
            <guid isPermaLink="false">https://medium.com/p/bbc3ebf8d526</guid>
            <category><![CDATA[freemium]]></category>
            <category><![CDATA[apps]]></category>
            <category><![CDATA[app-development]]></category>
            <category><![CDATA[application]]></category>
            <category><![CDATA[indie-developer]]></category>
            <dc:creator><![CDATA[Oguzhan Tasimaz]]></dc:creator>
            <pubDate>Wed, 11 Jun 2025 11:57:57 GMT</pubDate>
            <atom:updated>2025-06-11T11:57:57.006Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FRbFNA0--64RF65Y" /><figcaption>Photo by <a href="https://unsplash.com/@oguzhantasimaz?utm_source=medium&amp;utm_medium=referral">Oguzhan Tasimaz</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>I’m Oğuz, a solo indie developer from Istanbul, Turkey. I’ve started building an apps in January that solves a real pains . Now I’ve hit $300 in Monthly Recurring Revenue (MRR) not life-changing, but a milestone I’m damn proud of. Here’s how I went from $0 to $300 by rethinking my freemium model, without a big marketing budget or a team. Spoiler: it’s all about giving users just enough to hook them, then showing why paying is worth it.</p><p>The Starting Line: A Basic Freemium Model</p><p>When I launched in April 2025, my app had three tiers:</p><ul><li>Free: 5 searches per hour, no alarms, no notifications, no AI chatbot, daily available appointment slots but only showing one.</li><li>Premium ($9.99/month): Unlimited searches, 5 alarms with Low (daily) or Mid (hourly) checks, in-app/email notifications, AI chatbot, daily available appointment slots.</li><li>Premium+ ($14.99/month): Everything in Premium, plus 10 alarms with High (minute) checks and SMS notifications.</li></ul><p>The idea was simple: let Free users dip their toes, then nudge them to Premium for the full experience. I built the app solo, expanses are $5/month to Railway for deployment. Yes that’s it, and launched on Product Hunt to get early traction. By mid-April, I had ~500 Free users but zero paying customers. Ouch.</p><p>Why no conversions? The Free tier was too generous. With 5 searches/hour, users could poke around enough to feel satisfied without needing alarms or notifications the app’s real value. I was giving away too much, and my MRR was a big fat $0.</p><p>The Pivot: Tightening the Free Tier, Adding Value</p><p>By late April, I knew I had to change things up. I analyzed user data (shoutout to Mixpanel) and saw Free users were searching casually but dropping off before hitting the paywall. They weren’t experiencing the app’s core magic, real-time alerts and AI-driven help. So I made a bold move reduce the Free tier’s power but add just enough to tease the Premium value.</p><p>Here’s what I changed by May 2025:</p><ul><li>Free Tier (Before): 5 searches/hour, no alarms, no notifications.</li><li>Free Tier (After): 1 search every 24 hours, 1 alarm with Low (daily) checks, in-app notifications (no email/SMS), still no AI chatbot.</li><li>Premium ($9.99/month): Stayed the same — unlimited searches, 5 alarms (Low/Mid checks), in-app/email notifications, AI chatbot.</li><li>Premium+ ($14.99/month): Unchanged — adds 10 alarms (Low/Mid/High checks), extra SMS notifications plus everything in premium.</li><li>Improved ASO.</li></ul><p><em>Low = 1 Check per Day, Mid = 1 Check per Hour, High = 1 Check per Min</em></p><p>Why this shift? Cutting searches to 1/day made the Free tier a teaser, not a solution. Adding 1 alarm with daily checks and in-app notifications gave users a taste of the app’s real power getting alerted when something happens without solving their problem fully. It’s like letting someone smell fresh baklava but only giving them a crumb.</p><p>The Results: From $0 to $300 MRR</p><p>Here is the last chart I grabbed today from Mixpanel</p><figure><img alt="Statistics Board" src="https://cdn-images-1.medium.com/max/1024/1*OwKr6qojObdpu5kwipad6Q.png" /><figcaption>Statistics Board</figcaption></figure><p>The new model launched in early May, and the impact was instant. By June 4, 2025, here’s where I stood:</p><ul><li>User Growth: ~1,200 Free users, up from 500, thanks to Apple Search Ads and a Product Hunt bump.</li><li>Conversions: ~2% of Free users (24) upgraded to Premium ($9.99) = $239.76/month. ~0.5% (6) chose Premium+ ($14.99) = $89.94/month. Total MRR: ~$330, rounded down to $300 for humility.</li><li>Engagement: Free users setting 1 alarm saw in-app notifications, sparking curiosity about email/SMS and high check alerts and the AI chatbot. Mixpanel showed 30% of Free users hit the search limit within 2 days, prompting 10% to explore Premium.</li></ul><p>The tighter Free tier created urgency. Users hit the 1-search/day wall fast, saw the value of alarms/notifications, and realized $9.99 for unlimited searches and 5 alarms was a steal. Premium+’s 10 alarms and SMS appealed to power users needing minute-by-minute updates. Compared to agencies charging $100-$500 for similar services, my pricing felt like a bargain.</p><p>What I Learned:</p><ol><li>Tease, Don’t Satisfy: A Free tier should show what the app does, not solve the problem. One search/day and 1 alarm hooked users without giving away the farm.</li><li>Notifications Are King: Adding in-app notifications to Free users was a game-changer. They felt the app’s pulse, craving for high tier checks to get what they wanted instantly.</li><li>Keep It Simple: Two paid tiers (Premium, Premium+) with clear differences (5 vs. 10 alarms, SMS) worked better than one bloated tier. I considered weekly plans ($3.99) but stuck with monthly to lock in revenue.</li><li>Data Drives Decisions: Mixpanel’s Funnels report showed where Free users dropped off (post-search, pre-alarm). Without it, I’d be guessing.</li><li>Price Perception: $9.99-$14.99 felt fair because agencies charge 10x more. Always benchmark against real-world alternatives. I am still thinking about raising the prices.</li></ol><p>What’s Next?</p><p>Hitting $300 MRR is just the start. I’m eyeing $1,000 by Q4 2025. Plans include:</p><ul><li>Testing a weekly Premium plan ($3.99) for short-term users.</li><li>Adding more Free tier teasers (e.g., limited AI chatbot access).</li><li>Adding Apple Search Ads.</li><li>Gathering user feedback.</li></ul><p>To Fellow Indie Devs</p><p>Going from $0 to $300 MRR taught me to respect the Free tier’s power. It’s your handshake with users make it firm but quick, then show why paying’s worth it. Don’t be afraid to limit free features if it means showing your app’s true value. And lean on data; it’s your co-founder when you’re solo.</p><p>Tech Stack of my app for nerds: <br>Next.js , Upstash Redis , Railway , Mixpanel , SwiftUI , Firebase , RevenueCat</p><p>If you want to connect<br>X: <a href="https://x.com/oguztz">@oguztz</a><br>Linkedin: <a href="https://www.linkedin.com/in/oguzhantasimaz/">oguzhantasimaz</a><br>GitHub: <a href="https://github.com/oguzhantasimaz">oguzhantasimaz</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bbc3ebf8d526" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Golang, Kafka ve MongoDB ile ByNoGame ve Steam Counter Strike Skin Fiyat Karşılaştırıcı Geliştirme]]></title>
            <link>https://medium.com/@oguzhantasimaz/golang-kafka-ve-mongodb-ile-bynogame-ve-steam-counter-strike-skin-fiyat-kar%C5%9F%C4%B1la%C5%9Ft%C4%B1r%C4%B1c%CF%89%CF%89%CF%89-5ee4fa90fee2?source=rss-3c88d286a83e------2</link>
            <guid isPermaLink="false">https://medium.com/p/5ee4fa90fee2</guid>
            <category><![CDATA[counter-strike]]></category>
            <category><![CDATA[türkçe]]></category>
            <category><![CDATA[kafka]]></category>
            <category><![CDATA[mongodb]]></category>
            <category><![CDATA[golang]]></category>
            <dc:creator><![CDATA[Oguzhan Tasimaz]]></dc:creator>
            <pubDate>Mon, 02 Oct 2023 23:14:47 GMT</pubDate>
            <atom:updated>2023-10-02T23:15:49.052Z</atom:updated>
            <content:encoded><![CDATA[<h3>Golang, Kafka ve MongoDB ile ByNoGame ve Steam Counter Strike Skin Fiyat Karşılaştırıcısı Geliştirme</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cX3F21QTZNvSNXu2" /><figcaption>Photo by <a href="https://unsplash.com/@oguzhantasimaz?utm_source=medium&amp;utm_medium=referral">Oguzhan Tasimaz</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><a href="https://bynogamepriceanalyst.vercel.app/">Bu web uygulaması</a>, ByNoGame’de listelenen Counter Strike skin ilanların güncel Steam bilgisini alıp ilanın fiyat karşılaştırmasını, yüzdelik indirim tutarını, ürünün satılıp satılmadığını, float değerini ve satın alma linkini görmenizi sağlar.</p><p>Neden böyle bir uygulama geliştirme ihtiyacı hissettim?<br>Hem kendime kullanılan teknolojiler ile pratik olması ve paslanmamak için hem de çok aktif olmasam da Counter Strike skinleri ile takas, alım ve satım yaptığım için böyle bir uygulamaya da ihtiyacım vardı.</p><p>Şimdi size bunu nasıl yaptığımı anlatacağım.</p><p>Aşağıdaki resim uygulamamızın ön tarafının son hali. Hadi başlayalım!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*scAfZSvBwE4vI4GBC5H5vQ.png" /></figure><h3>Arka Plandaki Yapı</h3><p>Kullanılan teknolojileri listeledikten sonra mimariye geçiş yapalım.</p><ul><li><strong>Golang:</strong> Core, Consumer ve Producer bu programlama dilinde yazılmıştır.</li><li><strong>Kafka:</strong> Veri akışı ve mesajlaşma için Kafka kullanılmıştır.</li><li><strong>MongoDB:</strong> Verilerin depolanması için MongoDB kullanılmıştır.</li><li><strong>React.js</strong>: Frontend bu framework ile yazılmıştır.</li><li><strong>Fly.io:</strong> Core, Consumer ve Producer Fly.io üzerinde çalışmaktadır.</li><li><strong>Upstash:</strong> Kafka serverless olarak Upstash üzerinde çalışmaktadır.</li><li><strong>Atlas:</strong> MongoDB, kendi Atlas adlı sistemi üzerinde çalışmaktadır.</li><li><strong>Vercel:</strong> Frontend Vercel üzerinde çalışmaktadır.</li><li><strong>Docker</strong>: Uygulamaların konteynerleştirilmesi ve dağıtılması için Docker kullanılmıştır.</li></ul><p>Bu uygulamanın geliştirilmesi sırasında kullandığımız teknolojik altyapıya bir göz atalım.</p><p><em>(Kullanılan teknolojilerin ücretsiz versiyonları uygulamayı yapmak için yeterli)</em></p><figure><img alt="Web app infrastructure with kafka, mongo, golang backend api, client" src="https://cdn-images-1.medium.com/max/1024/1*2hcfJvipPUCY_hYHUn62EQ.png" /><figcaption>Made with Excalidraw ❤️</figcaption></figure><ul><li><strong>Producer:</strong> Cron job olarak çalışmaktadır. ByNoGame API’sine belirli aralıklarla GET http isteği atarak listelenen yeni ilanları alıp Kafka’ya mesaj olarak iletir.</li><li><strong>Consumer:</strong> Sürekli olarak Kafka’dan mesajları bekler/okur. Eğer mesaj okuma işlemi yaptıysa elindeki ByNoGame verisiyle ilgili skin’in Steam mağaza API’sine istek atarak güncel steam fiyat istatistiklerini çeker. Ardından bu iki veriyi birleştirip “Core” sisteme POST isteği atar.</li><li><strong>Core: </strong>Ana sistemdir. Consumer’dan gelen POST isteklerini karşılayıp MongoDB’ye body içinde gelen bilgiyi yazar. Client’tan gelen GET isteklerini karşılar ardından isteğin içeriğine göre MongoDB’den verileri okur ve client’a bu verileri geri döndürür</li><li><strong>Client: </strong>Arayüz kısmıdır kullanıcıların verileri daha şık ve anlaşılır görmesini sağlar.</li></ul><h3>İlk Gereklilikler</h3><p>Aşağıdaki hesap açma işlemlerini yaparken <strong>GitHub</strong> veya <strong>Google</strong> ile hesabı oluşturmanız size fayda sağlayacaktır.</p><p><strong>Upstash Hesabı Açma:</strong></p><ul><li><a href="https://upstash.com/"><strong>Upstash</strong></a> web sitesine gidin.</li><li>Hesap oluşturmak için gerekli bilgileri sağlayın.</li><li><strong>Upstash</strong> hesabınızı oluşturun.</li><li>Yönetim panelinden <strong>Kafka</strong> bölümüne gidin.</li><li>Yeni bir Kafka <strong>Cluster</strong>’ı oluşturun ve gerekli yapılandırmaları yapın.</li></ul><p><strong>Fly.io Hesabı Açma:</strong></p><ul><li><a href="https://fly.io/"><strong>Fly.io</strong></a> web sitesine gidin.</li><li>Hesap oluşturmak için gerekli bilgileri sağlayın.</li><li><strong>Fly.io</strong> hesabınızı oluşturun.</li></ul><p><strong>Vercel Hesabı Açma:</strong></p><ul><li><a href="https://vercel.com/"><strong>Vercel</strong></a> web sitesine gidin.</li><li>Hesap oluşturmak için gerekli bilgileri sağlayın.</li><li><strong>Vercel</strong> hesabınızı oluşturun.</li></ul><p><strong>MongoDB Atlas Hesabı Açma:</strong></p><ul><li><a href="https://www.mongodb.com/atlas/database"><strong>MongoDB Atlas</strong></a> web sitesine gidin.</li><li>Hesap oluşturmak için gerekli bilgileri sağlayın.</li><li>Atlas hesabınızı oluşturun.</li><li><strong>Projects</strong> paneline gidin.</li><li>Yeni bir Database <strong>Cluster</strong>’ı oluşturun. Yeni bir database oluşturduktan sonra bir “<strong>Username</strong>” ve “<strong>Password</strong>” oluşturun. Bu bilgiler database’e <strong>bağlanmanızı</strong> sağlayacak.</li></ul><p>Bu adımları takip ederek <strong>Upstash</strong>, <strong>Fly.io</strong>, <strong>MongoDB Atlas</strong> ve <strong>Vercel</strong> platformlarında hesaplarınızı oluşturabilirsiniz.</p><h3><strong>Kod, kod, kod!</strong></h3><p><em>Bütün </em><strong><em>kaynak kodları</em></strong><em>nı en altta </em><strong><em>GitHub</em></strong><em> </em><strong><em>repository</em></strong><em> linklerinde bulabilirsiniz!</em></p><p>Yukarıda arka planı okurken çalışma mantıklarına aşağı yukarı hakimiz, aşağıdaki kod parçacıklarını ve yorum satırlarını okuyarak daha da hakim olacağız.</p><h4>Producer</h4><p>Yapılan işlem her 5 dakikada bir veri alıp <strong>Kafka</strong>’ya göndermekten ibaret.</p><pre>func main() {<br>  log.Println(&quot;Producer started&quot;)<br><br>  // Environment Variableları yüklemek için custom bootstrap paketini kullanıyoruz.<br>  env := bootstrap.NewEnv()<br><br>  // KafkaWriter (kw) oluşturuluyor ve gerekli Kafka yapılandırma bilgileri ile başlatılıyor.<br>  kw := pkg.NewKafkaWriter(&quot;cs&quot;, env.KafkaUsername, env.KafkaPassword, env.KafkaBrokerUrl)<br><br>  // Fonksiyonun sonunda KafkaWriter&#39;ı kapatmak için defer kullanıyoruz.<br>  defer kw.Close()<br><br>  // CronClient cron işlemi için oluşturuluyor<br>  cronClient := pkg.NewCronClient()<br><br>  // 5 dakika aralıklarla ProcessCsItems fonksiyonunu çağırmak için bir görev planlanıyor.<br>  cronClient.Schedule(&quot;5m&quot;, func() {<br>      //ProcessCsItems ByNoGame&#39;den son listelenen skinleri alıp Kafka&#39;ya mesaj olarak gönderiyor.<br>      //Tüm koda sayfanın sonundaki GitHub repositorysinden ulaşabilirsiniz.<br>      ProcessCsItems(kw)<br>  })<br><br>  // CronClient başlatılıyor.<br>  cronClient.Start()<br><br>  // Fonksiyonun sonunda CronClient&#39;ı durdurmak için defer kullanıyoruz.<br>  defer cronClient.Stop()<br><br>  // Select ifadesi, uygulamanın sonsuz bir şekilde çalışmasını sağlar ve main go routine&#39;i blocklar.<br>  select {}<br>}</pre><h4>Consumer</h4><p>Burada temel mantık sürekli gelen mesajları dinleyip/okuyup verileri ana servise aktarmak.</p><pre>func main() {<br> log.Println(&quot;Starting consumer...&quot;)<br><br> // Environment Variableları yüklemek için custom bootstrap paketini kullanıyoruz.<br> env := bootstrap.NewEnv()<br> ctx := context.Background()<br><br> // Kafka Reader (Consumer) oluşturuluyor ve gerekli Kafka yapılandırma bilgileri ile başlatılıyor.<br> consumer := pkg.NewKafkaReader(&quot;cs&quot;, env.KafkaUsername, env.KafkaPassword, env.KafkaBrokerUrl)<br><br> //Sonsuz bir loop başlatılıyor...<br> for {<br>  //Consumer mesajları okuma işlemi yapıyor.<br>  message, err := consumer.ReadMessage(ctx)<br>  if err != nil {<br>   log.Error(err)<br>   continue<br>  }<br><br>  log.Info(&quot;Message received&quot;)<br><br>  //Okunan mesaj bgCsItem değişkenine dönüştürülüp atanıyor.<br>  var bgCsItem *domain.ByNoGameCsItem<br>  if err := json.Unmarshal(message.Value, &amp;bgCsItem); err != nil {<br>   log.Error(err)<br>   continue<br>  }<br><br>  //Steam API&#39;sinde skin isimlerini hash olarak istediğinden skinin<br>  //ismini hashleyip yeni bir değişkene atıyoruz<br>  hashedName := util.HashItemName(bgCsItem.TypeInfoSteam.Hash)<br><br>  //Steam API&#39;sine ilgili skinin güncel fiyat bilgisini almak için istek atıyoruz<br>  sr, err := pkg.GetItemSteamMarketPrice(hashedName)<br>  if err != nil {<br>   log.Error(err)<br>   continue<br>  }<br><br>  //Eğer Steam o an için size veri döndüremediyse veya ilgili skinin verisi yoksa continue diyoruz<br>  if sr == nil {<br>   log.Error(&quot;Item not found in steam market: &quot; + hashedName)<br>   sr = &amp;domain.SteamResponse{<br>    Success: false,<br>   }<br>   continue<br>  }<br><br>  //Elde ettiğimiz bilgileri tek bir değişkende birleştiriyoruz.<br>  //Burada kullanılan değişken isimleri tutarsızlık olmaması için ByNoGame ve Steam sistemlerini takip etmektedir.<br>  csItem := domain.CsItem{<br>   SellerMarketName: bgCsItem.SellerMarketName,<br>   Description:      bgCsItem.Description,<br>   ViewCounter:      bgCsItem.ViewCounter,<br>   SellerId:         bgCsItem.SellerId,<br>   Price:            bgCsItem.Price,<br>   Image:            bgCsItem.Image,<br>   NameSlug:         bgCsItem.NameSlug,<br>   SellerLogo:       bgCsItem.SellerLogo,<br>   Bngid:            bgCsItem.Bngid,<br>   CommentCount:     bgCsItem.CommentCount,<br>   TypeInfoSteam:    bgCsItem.TypeInfoSteam,<br>   GameCode:         bgCsItem.GameCode,<br>   SellerOnline:     bgCsItem.SellerOnline,<br>   Status:           bgCsItem.Status,<br>   CreatedAt:        bgCsItem.CreatedAt.UnixTime,<br>   DateTimeSold:     bgCsItem.DateTimeSold.UnixTime,<br>   SteamStats:       *sr,<br>  }<br><br> //Bu değişken Core servisine POST isteği olarak atılıyor.<br>  if err := pkg.PostToCoreService(csItem, env.CoreServiceUrl); err != nil {<br>   log.Error(err)<br>   continue<br>  }<br> }<br>}</pre><h4>Core</h4><p>Aşağıda iki tane farklı istek tipini handle eden fonksiyon görüyoruz. Bunlardan bir tanesi skin verisi isteyene <strong>MongoDB</strong>’ye kaydettiğimiz verilerden skinleri alıp gönderiyor. Diğeri ise <strong>Consumer</strong>’ın okuyup,işleyip ve gönderdiği verileri <strong>MongoDB</strong>’ye kaydediyor.</p><pre>type CsItemController struct {<br> CsItemUseCase domain.CsItemUseCase<br>}<br>//group.GET(&quot;/cs&quot;, cu.GetCsItems) rotamızın kullandığı GET isteklerini handle eden fonksiyonumuz.<br>func (cc *CsItemController) GetCsItems(c echo.Context) error {<br> ctx := context.Background()<br> var err error<br><br>//Sistemden kaç adet skin isteyeceğimizi belirleyen değişken limit<br> limit := 2<br> if c.QueryParam(&quot;limit&quot;) != &quot;&quot; {<br>  limit, err = strconv.Atoi(c.QueryParam(&quot;limit&quot;))<br>  if err != nil {<br>   log.Error(err)<br>   return c.JSON(400, domain.ErrorResponse{Message: err.Error()})<br>  }<br> }<br><br>//Service(usecase) layerımıza context ve limitimizi verip ondan skinleri döndürmesini istiyoruz.<br> items, err := cc.CsItemUseCase.GetCsItems(ctx, limit)<br> if err != nil {<br>  log.Error(err)<br>  return c.JSON(400, domain.ErrorResponse{Message: err.Error()})<br> }<br><br> return c.JSON(200, items)<br>}<br><br>//group.POST(&quot;/cs&quot;, cu.PostCsItem) rotamızın kullandığı POST isteklerini handle eden fonksiyonumuz.<br>func (cc *CsItemController) PostCsItem(c echo.Context) error {<br> ctx := context.Background()<br><br>//Gelen POST isteğinin body&#39;sini item adlı değişkenimize bind ediyoruz.<br> var item *domain.CsItem<br> if err := c.Bind(&amp;item); err != nil {<br>  log.Error(err)<br>  return c.JSON(400, err)<br> }<br><br>//Service(usecase) layerımıza context ve bodyden parse ettiğimiz itemi verip bunları veritabanına yazmasını istiyoruz.<br> err := cc.CsItemUseCase.PostCsItem(ctx, item)<br> if err != nil {<br>  log.Error(err)<br>  return c.JSON(400, domain.ErrorResponse{Message: err.Error()})<br> }<br><br> return c.JSON(200, &quot;Success&quot;)<br>}</pre><p><strong>Client</strong></p><p>Bu kod örneğinde, React kullanılarak oluşturulan <strong>Card</strong> bileşeni bulunmaktadır. Bu bileşen, <strong>Core</strong> ana servisimizden elde ettiğimiz Counter Strike skininin hem ByNoGame hem de Steam verilerini göstermek ve işlemek için kullanılır.</p><p>Bu <strong>Card</strong> bileşeni, daha sonra verileri listelemek için kullanılacak olan <strong>CardList</strong> bileşeninde kullanılır.</p><pre>import React, { useState } from &#39;react&#39;;<br><br>function Card({ cardData }) {<br>  const [imageError, setImageError] = useState(false);<br><br>  const handleImageError = () =&gt; {<br>    setImageError(true);<br>  };<br><br>  // Fiyatlara bakılarak yüzdelik fiyat farkı hesaplanıyor.<br>  const calculatePriceDifference = () =&gt; {<br>    const originalPrice = cardData.price;<br>    const lowestPrice = parseFloat(<br>      cardData.steamStats.lowest_price.replace(&#39;.&#39;, &#39;&#39;).replace(&#39; TL&#39;, &#39;&#39;)<br>    );<br>    const percentageDifference = ((lowestPrice - originalPrice) / originalPrice) * 100;<br>    return percentageDifference.toFixed(2);<br>  };<br><br>  //Skin satıldı mı kontrolü yapılıyor, satıldıysa uyarı gösteriliyor.<br>  const isSold = cardData.dateTimeSold &gt; 0;<br><br>  return (<br>    &lt;div className={`card ${isSold ? &#39;sold&#39; : &#39;&#39;}`}&gt;<br>      {isSold &amp;&amp; (<br>        &lt;div className=&quot;sold-flag&quot;&gt;SOLD!&lt;/div&gt;<br>      )}<br>      {imageError ? (<br>        &lt;img<br>          src=&quot;path_to_placeholder_image.png&quot; // Provide the path to your placeholder image<br>          alt={cardData.nameSlug}<br>        /&gt;<br>      ) : (<br>        &lt;img<br>          src={cardData.image}<br>          alt={cardData.nameSlug}<br>          onError={handleImageError}<br>        /&gt;<br>      )}<br>      &lt;h2&gt;{cardData.typeInfoSteam.hash}&lt;/h2&gt;<br>      &lt;p&gt;Description: {cardData.description}&lt;/p&gt;<br>      &lt;p&gt;Float: {cardData.float || &quot;Unavailable&quot;}&lt;/p&gt;<br>      &lt;p&gt;ByNoGame Price: {cardData.price} TL&lt;/p&gt;<br>      &lt;p&gt;Steam Lowest Price: {cardData.steamStats.lowest_price}&lt;/p&gt;<br>      &lt;p&gt;Price Difference: &lt;b&gt;{calculatePriceDifference()}%&lt;/b&gt;&lt;/p&gt;<br>      &lt;p&gt;Steam Volume: {cardData.steamStats.volume}&lt;/p&gt;<br>      &lt;p&gt;Steam Median Price: {cardData.steamStats.median_price}&lt;/p&gt;<br>      &lt;p&gt;Seller Name: {cardData.sellerMarketName}&lt;/p&gt;<br>      &lt;a href={&quot;https://www.bynogame.com/en/games/csgo/skin/&quot; + cardData.nameSlug} target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Buy Now&lt;/a&gt;<br>      {/* Add more card information as needed */}<br>    &lt;/div&gt;<br>  );<br>}<br><br>export default Card;</pre><p>Bu <strong>CardList</strong> bileşeni, Counter Strike skinlerinin verilerini belirtilen API&#39;den çeker ve her bir veri için <strong>Card</strong> bileşenini çağırarak bir kart listesi oluşturur. <strong>useEffect</strong> kullanılarak veri çekme işlemi bileşen yüklendiğinde gerçekleşir ve alınan veriler <strong>cards</strong> değişkenine atanır.</p><pre>// CardList.js<br>import React, { useState, useEffect } from &#39;react&#39;;<br>import Card from &#39;./Card&#39;;<br><br>function CardList() {<br>  const [cards, setCards] = useState([]);<br><br>// Ustte yazdığımız Core sistemine istek atıp bilgileri istiyoruz<br>  useEffect(() =&gt; {<br>    async function fetchCards() {<br>      try {<br>        const response = await fetch(<br>          &#39;https://bynogame-price-analyst-core.fly.dev/api/cs?limit=50&#39;<br>        );<br>        const data = await response.json();<br>        setCards(data);<br>      } catch (error) {<br>        console.error(&#39;Error fetching data:&#39;, error);<br>      }<br>    }<br><br>    fetchCards();<br>  }, []);<br><br>//Elde ettiğimiz veriyi ki bu json array verisi cards objesinde <br>// map edip Card componentleri oluşturup içlerine gömüyoruz<br><br>  return (<br>    &lt;div className=&quot;card-list&quot;&gt;<br>      {cards.map((card, index) =&gt; (<br>        &lt;Card key={index} cardData={card} /&gt;<br>      ))}<br>    &lt;/div&gt;<br>  );<br>}<br><br>export default CardList;<br></pre><p><strong>Dockerfile:<br>Docker</strong>’ı servislerimizi konteynerleştirip <strong>fly.io</strong>’ya koymak için kullanıyoruz. Burada ise tek aşamaya sahip olan örnek bir <strong>Dockerfile</strong> görüyoruz.</p><pre>FROM golang:1.21.1-alpine<br><br>RUN mkdir /app<br><br>ADD . /app<br><br>WORKDIR /app<br><br># ADD .ENV file to /app<br>ADD .env /app<br><br>RUN go build -o main cmd/main.go<br><br>CMD [&quot;/app/main&quot;]</pre><h3>Deployment Süreci</h3><p>Servislerimizin gerekli environment değişkenlerine sahip olduğuna emin olduktan sonra aşağıdaki adımlara geçebiliriz. Environment değişkenleri için <strong>GitHub </strong>repositorilerinde bulunan örnek <strong>.env.example</strong> adlı dosyalardan yardım alabilirsiniz.</p><ol><li>Aşağıdaki linkten <strong>flyctl cli </strong>indirelim. Brew ya da curl kullanabilirsiniz.</li></ol><p><a href="https://fly.io/docs/hands-on/install-flyctl/">Install flyctl</a></p><p>2. İsteğe bağlı olarak database yönetimi ve monitoringi için <a href="https://www.mongodb.com/products/tools/compass"><strong>MongoDB Compass</strong></a> indirebilirsiniz. Atlas Web’e göre daha kullanışlı.</p><p>3. Aşağıdaki komutları <strong>yorum satırlarını dikkate alarak</strong> sırayla çalıştırın.</p><pre>#CLI&#39;i hesabimizla authorize etmek icin bu komutu calistiriyoruz<br>flyctl auth login<br>#Authorize olduktan sonra Producer,Consumer ve Core klasorlerine tek tek girip<br>cd ../core<br>#bu komutu calistiriyoruz<br>flyctl launch<br>#Bu komut yeni bir uygulama deploy edilirken kullaniliyor. <br>#Ilk olarak isim sececeksiniz ardindan da hangi lokasyondaki serveri kullanmak<br>#istediginizi. Sizin icin Postgres ve Redis secenegi sunabilir N tusuna basip reddedbilirsiniz.<br><br>#----------------------------------------------------------------------<br><br>#Uygulama basariyla deploy edildikten sonra asagidaki komut ile <br>#herhangi guncelleme yapabilirsiniz.<br>flyctl deploy<br></pre><h3>Repository Linkleri</h3><ul><li><a href="https://github.com/oguzhantasimaz/bynogame-price-analyst">GitHub - oguzhantasimaz/bynogame-price-analyst: Item listings, price stats, price comparisons for Counter Strike between ByNoGame and Steam</a></li><li><a href="https://github.com/oguzhantasimaz/bynogame-price-analyst-fe">GitHub - oguzhantasimaz/bynogame-price-analyst-fe: Bynogame Price Analyst Frontend</a></li></ul><h3>Sözlük</h3><ul><li><strong>Producer (Üretici):</strong> Producer, bir veri akışının veya mesajların oluşturulduğu veya üretildiği tarafı temsil eder. Özellikle veri akışı veya mesaj kuyruğu gibi sistemlerde, verileri üreten veya gönderen bileşenlerdir.</li><li><strong>Consumer (Tüketici):</strong> Consumer, bir veri akışının veya mesajların alındığı veya tüketildiği tarafı temsil eder. Veri akışı veya mesaj kuyruğu gibi sistemlerde, verileri alan veya işleyen bileşenlerdir.</li><li><strong>Client (İstemci): </strong>Client, bir sunucuya veya hizmete erişim sağlayan ve veri veya hizmet taleplerini ileten bir bilgisayar programı veya cihazdır.</li><li><strong>Serverless (Sunucusuz): </strong>Serverless, geleneksel sunucu altyapısının aksine, uygulama kodunun çalıştırılması ve yönetilmesi için sunucuların görünür olmadığı bir bulut bilişim modelidir.</li><li><strong>API (Application Programming Interface):</strong> API, bir yazılımın veya uygulamanın diğer yazılımlarla veya bileşenlerle etkileşimde bulunmasını sağlayan bir arayüz veya protokoldür.</li><li><strong>Controller (Denetleyici):</strong> Controller, bir uygulamanın kullanıcı isteklerini karşılamak için gerekli işlemleri yürüten bir bileşendir.</li><li><strong>Cluster (Küme): </strong>Cluster, aynı türdeki veya ilgili işlevlere sahip birden fazla sunucunun veya bilgisayarın bir araya getirilerek oluşturduğu bir grup veya kümedir.</li><li><strong>CLI (Command Line Interface)</strong>: Kullanıcıların bir bilgisayar programını veya işletim sistemini komutlarla kontrol etmelerini sağlayan bir arayüzdür.</li><li><strong>Authorize (Yetkilendirme): </strong>Bir kullanıcının veya bir uygulamanın belirli kaynaklara erişim hakkını doğrulama veya verme işlemidir.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5ee4fa90fee2" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>