<?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 sankit on Medium]]></title>
        <description><![CDATA[Stories by sankit on Medium]]></description>
        <link>https://medium.com/@sankitdev?source=rss-e49841d4b9bb------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*A4BU4MBAv7YWjIPeH4YBHg.jpeg</url>
            <title>Stories by sankit on Medium</title>
            <link>https://medium.com/@sankitdev?source=rss-e49841d4b9bb------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 11:21:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sankitdev/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 DevAtlas So You Don’t Need 5 Tabs to Pick a Backend Tool]]></title>
            <link>https://sankitdev.medium.com/i-built-devatlas-so-you-dont-need-5-tabs-to-pick-a-backend-tool-3ba4520e7be9?source=rss-e49841d4b9bb------2</link>
            <guid isPermaLink="false">https://medium.com/p/3ba4520e7be9</guid>
            <dc:creator><![CDATA[sankit]]></dc:creator>
            <pubDate>Thu, 01 Oct 2026 09:46:37 GMT</pubDate>
            <atom:updated>2026-10-01T09:46:37.538Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wBwgCzomACeylobBu9QusQ.png" /></figure><p><strong>Quick question:</strong></p><blockquote>How many tabs did you open the last time you had to pick an auth library?</blockquote><p>If the answer is “more than three”, this post is for you.</p><p>I’m going to explain why I built <strong>DevAtlas</strong>, what is inside it, and what I’m planning next. It’s short, and I promise there’s no boring feature list.</p><h3>The actual problem</h3><p>Before you write a single line of backend code, you have to decide what to use. And that’s where most beginners I’ve seen get stuck, not on the code.</p><p>Because backend comes with a lot of questions, and every one of them has ten answers.</p><ul><li>Which auth should I use?</li><li>Which database?</li><li>How do I test my APIs?</li></ul><p>So what do we do? We open ChatGPT or Claude and ask. Then someone on X says “<strong><em>just use Better Auth</em></strong>” and now you’re asking again, why that one and not Clerk? And again for the next tool. And the next.</p><p>Think of it like buying a phone by asking one friend at a time. Each friend only knows their own phone, and swears it’s the best one. You never see the whole shelf.</p><p>That’s exactly what happens with tools. You hear about one, you never see the whole picture around it.</p><p>I watched beginners go through this loop again and again. So I built something to end it.</p><h3>So what is DevAtlas?</h3><p><a href="https://www.devatlas.site/"><strong>DevAtlas</strong></a><strong> </strong>is a curated directory of backend and infra tools. (Infra = the stuff your app runs on, like databases, hosting and so on.)</p><p>It’s free, and you don’t need to sign up to browse. But you can log in to save your favorite tools.</p><p>The idea is simple:</p><p>Decision → one recommended tool → runner-ups → a one-line reason</p><p>On the homepage you get one pick for each of the 15 backend decisions every app has to make. Authentication, databases, testing, API testing, all of it. And when you open a tool, you don’t just get a feature list. You get the exact reason to choose it, or to skip it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zXk8OCIR82C4UU40rTJu1A.png" /><figcaption>DevAtlas Homepage</figcaption></figure><h3>Comparisons, because that’s what you actually want</h3><p>Most of the time you’re not asking “<strong>what does this tool do?</strong>”</p><p>You’re asking “should I pick this one or that one?”</p><p>So I added two-tool comparisons. What this one offers, what that one offers, and where each fits. Everything side by side. No more five tabs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E_f_XgoJBsVLWd5BLdH4Ig.png" /></figure><h3>Stacks, for when you already know your setup</h3><p>Sometimes you don’t want to compare tool by tool. You just want to know “what fits my stack?”</p><p>So there’s a separate Stacks section. Say you’re on Next.js. You get a page with one tool picked for each decision, made for Next.js. Same for Node.</p><p>It’s not just about comparing. It’s about getting a ready answer for the setup you’re already using.</p><h3>The study site came first</h3><p>Quick backstory. I built the study site first, and DevAtlas came later.</p><p>It’s <a href="https://study.devatlas.site/">study.devatlas.site</a>. Short revision notes you can go through right before an interview. Computer networking, operating systems, JavaScript, MERN stack and more.</p><p>It’s not a textbook, bhai. It’s for quick revision, so you can walk into an interview a bit more confident. It lives on a subdomain of DevAtlas now.</p><h3>Who is this for?</h3><p>Mostly people early in their journey:</p><ul><li>Frontend developers moving to backend</li><li>Students</li><li>Anyone tired of stitching answers together from five places</li></ul><h3>What’s next</h3><p>I’m nowhere near done. Here’s what’s on my list:</p><ul><li>More tools and more comparisons</li><li>New categories where there are gaps right now</li><li>More stacks, so more setups get a ready answer</li><li>More revision notes on the study site</li><li>MCP support, so an AI agent like Claude can connect directly and query DevAtlas’s data (a friend gave me this idea)</li></ul><h3>One thing before you go</h3><p>I’m not claiming every pick is perfect. Tools change, opinions differ, and I might have gotten a comparison wrong somewhere. That’s why I want your feedback.</p><p>If a tool is missing, or a comparison looks wrong or unclear, tell me in the comments. It really helps.</p><p>That’s it. If you want to check it out: <a href="https://www.devatlas.site/">devatlas.site</a></p><p>Thanks for reading. Next article might be on how I’m getting DevAtlas to show up on Google.</p><p>You can connect with me on <a href="https://x.com/sankitdev">X</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ba4520e7be9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Hidden System Behind ‘Username Already Taken’ (Used by Instagram, X, Google and more)]]></title>
            <link>https://sankitdev.medium.com/the-hidden-system-behind-username-already-taken-used-by-instagram-x-google-and-more-ff302baab888?source=rss-e49841d4b9bb------2</link>
            <guid isPermaLink="false">https://medium.com/p/ff302baab888</guid>
            <category><![CDATA[username-already-taken]]></category>
            <category><![CDATA[bloom-filter]]></category>
            <category><![CDATA[username-validation-api]]></category>
            <dc:creator><![CDATA[sankit]]></dc:creator>
            <pubDate>Sun, 24 May 2026 16:01:11 GMT</pubDate>
            <atom:updated>2026-05-24T16:01:11.233Z</atom:updated>
            <content:encoded><![CDATA[<p>Every social media handle comes with a username, which is uniquely yours if you have claimed it, and no one else in the world can claim it.</p><p>Whats interesting is that platforms like Instagram, X (Twitter), Google can tell whether a username is available almost instantly while you are still typing.</p><p>The question is, how?</p><p>Prefer video over reading?</p><p>I explained Bloom Filters here:</p><p><a href="https://youtu.be/ffqxMEOQYYo?si=IVE7_D29YBKqeeVz&amp;utm_source=chatgpt.com">Watch on YouTube</a></p><p>Well, One of the key tehnique behind this is a probabilistic data structure called a “Bloom Filter”.</p><p>In this article, we will first understand the completed username-checking flow user in actual large-scale systems, and then deep dive into Bloom Filters, exploring how they work, their trade-offs, and everything in between.</p><p>So, grab your tea, coffee, monster, red bull, or whatever keep your brain alive and let’s delve into the world of probabilistic data structures.</p><p><strong>How usernames are checked instantly?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/0*c7LXR4LpjdZlI7iv" /></figure><p>The journey of checking username starts from the the frontend.</p><p>The moment you start typing a username, the frontend waits for you to stop typing for some time like 200–300 ms before making the actual API request.</p><p>This technique is called debouncing. ((Debouncing means delaying the API call until the user pauses typing.))</p><p>Once the request is made, it first reaches the nearest edge server or API gateway. From there the request may go through the bloom filter.</p><p>Bloom Filter is a super fast data structure that helps system quickly guess whether username might exist or definitely doesn’t exist (more on that later)</p><ul><li>If Bloom filter returns false, it means username definitely doesn’t exist, so the request can stop there immediately.</li><li>If it returns true, it means the username might exists (false positive) so further checks is need.</li></ul><p>The next step is usally checking a fast cache like Redis.</p><p>Redis holds the most searched or commonly used usernames across world like john, don, ram, aam, apple, mango, etc. Because Redis is extremly fast, request can be answered without touching the database.</p><p>But if the username is not found in Redis either. the next natural step will be the to check from db (the final source of truth).</p><p>From there the final yes or no will come eventually.</p><p>With that said lets understand Bloom Filters now how they work and all.</p><p><strong>What is Bloom Filters?</strong></p><p>A Bloom filter is <strong>a space-efficient probabilistic data structure used to test whether an element might exist in a set.</strong></p><p>The reason it is called <em>probabilistic</em> is because it trades accuracy for memory efficiency.</p><p>For example, imagine checking whether a username is already taken.</p><ul><li>If the Bloom filter says the username is <strong>not present</strong>, then it is 100% sure the username is available.</li><li>But if the Bloom filter says the username <strong>exists</strong>, it might be wrong because multiple usernames can map to the same hash positions.</li></ul><p>This is called a <strong>false positive</strong>.</p><p>So a Bloom filter follows this rule:</p><blockquote><em>NO → definitely no</em></blockquote><blockquote><em>YES → maybe yes</em></blockquote><p>So, when you see the message,</p><blockquote><em>“username available”</em></blockquote><p>the bloom filter being 100% sure.</p><p>But when you see</p><blockquote><em>“username not available”</em></blockquote><p>there is chances of “False positive” here.</p><p>It means that username might actually be available, but bloom filter thinks its already taken because some other usernames might have produced the same hash positions.</p><p><strong>Simple mental model</strong></p><p>Bloom filter name sounds confusing but its very simple to create. I have explained the same in this below video.</p><ol><li>Create a Bit Array — Its an array with only zeros inside it.</li><li>Create some hash function — Hash function will be used to take the username and convert it into some numbers.</li></ol><p>That’s it now you have the Bloom Filter.</p><p>Now, when a username comes it, we pass it through all the hash functions</p><p>Each hash functions generates a number, and those number point to the positions inside the bit array.</p><p>Intially the bit array is all 0.</p><p>As usernames comes, goes through the hash function we get the numbers.</p><p>We then turn those position in the array from 0 to 1.</p><p>Later, while checking a username</p><ul><li>if any position is 0, the username definitely doesn’t exist.</li><li>If all positions are 1, the username might exists.</li></ul><p>That “might” is where the false positive comes from.</p><p><strong>Tiny Implementation of Bloom Filter</strong></p><pre>// bit Array of size 10<br>const bitArray = Array(10).fill(0);<br><br>// hash functions<br>const h1 = (str) =&gt; str.length % bitArray.length;<br>const h2 = (str) =&gt; str.charCodeAt(0) % bitArray.length;<br>const h3 = (str) =&gt; str.charCodeAt(str.length - 1) % bitArray.length;<br><br>// function to add into the array<br>function add(str) {<br>  const indexes = [h1(str), h2(str), h3(str)];<br><br>  console.log(indexes);<br><br>  for (let i = 0; i &lt; indexes.length; i++) {<br>    bitArray[indexes[i]] = 1;<br>  }<br><br>  return bitArray;<br>}<br><br>// function to check the indexes availability<br>function contains(str) {<br>  const indexes = [h1(str), h2(str), h3(str)];<br><br>  for (let i = 0; i &lt; indexes.length; i++) {<br>    if (bitArray[indexes[i]] !== 1) {<br>      return false;<br>    }<br>  }<br><br>  return true;<br>}<br><br>console.log(add(&quot;dog&quot;));<br>console.log(add(&quot;cat&quot;));<br>console.log(add(&quot;apple&quot;));<br>console.log(add(&quot;banana&quot;))<br>console.log(add(&quot;dgoingnsmgi&quot;))</pre><p><strong>Conclusion</strong></p><p>In systems with high volume of users bloom filters are cost effective data structure with some tradeoff. There are many other usecases of bloom filters as well:</p><ul><li>databases use bloom filters to avoid checking disk storage when data definitely not exists</li><li>caching systems use them to prevent cache misses from hitting the databse</li><li>Browsers use bloom filters to quickly check whether a malicious URL might exists in a blacklist.</li></ul><p>And many other uses.</p><p>Ref for more read:</p><p><a href="https://en.wikipedia.org/wiki/Bloom_filter">https://en.wikipedia.org/wiki/Bloom_filter</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ff302baab888" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI and Jobs: Why This Time Might Actually Be Different (Part 1)]]></title>
            <link>https://sankitdev.medium.com/ai-and-jobs-why-this-time-might-actually-be-different-part-1-c23c9fd17b66?source=rss-e49841d4b9bb------2</link>
            <guid isPermaLink="false">https://medium.com/p/c23c9fd17b66</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[ai-taking-jobs]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[jobs]]></category>
            <dc:creator><![CDATA[sankit]]></dc:creator>
            <pubDate>Sun, 08 Feb 2026 15:23:01 GMT</pubDate>
            <atom:updated>2026-02-08T15:23:01.443Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>AI and Jobs: Real Threat or Hype? (Part 1)</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/0*uDj7DwdhpPVALQwZ" /><figcaption>Understand AI with history</figcaption></figure><p>Let’s settle this debate forever. Yes, after reading this, you will have every question answered.</p><p>Before I start talking about anything, let me attach a video of <a href="https://x.com/@AnthropicAI">@AnthropicAI</a></p><p>The CEO, who has been getting viral recently.</p><iframe src="https://cdn.embedly.com/widgets/media.html?type=text%2Fhtml&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;schema=twitter&amp;url=https%3A//x.com/i/status/2015243473901817917&amp;image=" width="500" height="281" frameborder="0" scrolling="no"><a href="https://medium.com/media/21e183c80ab74a7515411128473a7936/href">https://medium.com/media/21e183c80ab74a7515411128473a7936/href</a></iframe><p>I’m sure this clip has reached each one of your feeds.</p><p>And, even on this, everybody would have different opinions. Like, “<strong>we have been hearing this since </strong>ChatGPT<strong> release</strong>,<strong>”</strong> etc</p><p>So, here is the truth.</p><blockquote><em>AI will take each one of our job not in 12 month but surely in 5 year. And I am not only talking about software engineers here.</em></blockquote><p>Each day I wake up, something new in AI has already come. The day I am writing this, two things happened.</p><p>The Sarvam AI’s Language speech, tbh, it was mind-boggling how these assistants are getting more natural day by day. I won’t be surprised if one day we won’t be able to distinguish between a human and an AI voice.</p><p>With these facts in place. Let’s delve into it now.</p><blockquote><strong><em>Note</em></strong><em>: I am not an expert in this field. The whole article revolves around my personal pov. We can agree or disagree; it doesn’t matter, but the truth will remain the same.</em></blockquote><h3><strong>Let’s talk some history first</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/0*Dp_yFDA7_YRpmcMt" /></figure><p>I love history cause whatever is happening in the current situation is not accidental.</p><p>It has its roots in history. If we can understand that <strong>the present becomes obvious </strong>and the future predictable<strong>.</strong></p><p>Let’s go back <strong>before jobs existed</strong>.</p><p>There was a time when humans weren’t “professionals.” We were animals. We still are.</p><p>We ate. We hunted. We survived.</p><p>No resumes. No salaries. No Monday motivation posts.</p><p>So this raises the first uncomfortable question:</p><h3>What Is a Job, Really?</h3><p>A <em>job</em> is not natural. A job is a <strong>human invention</strong>.</p><p>A job exists only when:</p><ul><li>Resources are controlled</li><li>Tasks are divided</li><li>Survival is no longer direct</li></ul><p>A <strong>“job,”</strong> as we understand it today, is actually a relatively modern invention.</p><p>It’s formalized work in exchange for compensation that allows you to acquire what you need to survive,<strong> food, shelter, and security,</strong> without having to produce everything yourself.</p><p>Jobs emerged not from nature, but from the complexity of human civilization. They’re a solution to a coordination problem: how do we organize millions of people to do specialized things so society functions?</p><p><strong>The crucial insight here:</strong> jobs aren’t natural. They’re invented. Which means they can be <strong>reinvented</strong>. Or <strong>eliminated</strong>.</p><h3>From Survival to Surplus: The Birth of Work</h3><p>The story changes around 10,000 BCE with the Agricultural Revolution.</p><p>Someone figured out you could plant seeds, wait, and food would grow in the same spot next year. Suddenly, you didn’t need to chase your dinner across the savannah.</p><p>You could stay put. You could <em>plan</em>.</p><p>But here’s where it gets interesting: <strong>farming created surplus</strong>. For the first time in human history, one person could produce more food than they personally needed. This surplus changed everything.</p><p>With surplus came <strong>specialization</strong>. Not everyone needed to farm. Some people could make tools. Others could make clothes, build houses, or guard the settlement. The guy good at making sandals could trade his footwear for grain. The woman skilled at weaving could exchange cloth for fruit.</p><p>This is proto-work, the ancestor of what we now call jobs. But there was a problem…</p><h3>The Exchange Problem and the Invention of Money</h3><p>Let’s say you grow mangoes. I grow apples. You want apples, I want mangoes. Easy trade, right? Five mangoes for five apples. Done.</p><p>But what if you grow mangoes and I make sandals? You need sandals, but I don’t need mangoes. I already have a stockpile from the last guy. Or worse, I need mangoes, but you don’t need sandals. Now what?</p><p>This is called the “double coincidence of wants” problem, and it paralyzed early economies. Barter only works when both parties want exactly what the other has, at exactly the same time, in exactly the right quantities.</p><p>Then came one of humanity’s most important inventions: <strong>money</strong>.</p><p>Coins, shells, beads — whatever the culture used — created a universal medium of exchange. Suddenly, I could trade my sandals for coins, even if you didn’t make anything I wanted.</p><p>I could save those coins and buy mangoes from someone else tomorrow. The shoemaker didn’t need to find someone who both needed shoes <em>and</em> had grain; he could simply sell shoes for money, then buy grain.</p><p>Money unlocked specialization at scale. And with that came the seeds of capitalism.</p><h3>Capitalism and Industrialization: When Jobs Became “Jobs”</h3><p>All the setup above was for this one guy, welcome <strong>“Capitalism”.</strong></p><p><strong>Who is this Capitalism? </strong>Well, capitalism is a system — an economic system in which we all live inside it. In this system:</p><ul><li>Resources are privately owned</li><li>People sell their labor for money</li><li>Ownership decides control</li><li>Markets decide value</li></ul><p>Even in early agricultural societies, inequality emerged.</p><p>Some people had more land, better tools, more workers (through family size or, darker, slavery and servitude). Those with capital — land, tools, resources — could generate surplus without working themselves. They owned the means of production.</p><p>Fast forward to the 1700s-1800s:<strong> the Industrial Revolution.</strong></p><p>Factories emerged. Steam engines, textile mills, assembly lines. Now, instead of a craftsman making shoes one pair at a time, a factory could produce thousands. But factories needed workers lots of them.</p><p>This is when the modern “job” crystallized: you don’t own the factory. You don’t own the tools.</p><p><strong>You sell your time and labor to someone who does, in exchange for a wage. </strong>You show up, do your assigned task, collect your pay, go home. Repeat.</p><p>The factory owner <strong>keeps the profit</strong>. You get <strong>enough to survive</strong> (ideally) and come back tomorrow.</p><p>This is the job as we know it: formalized labor, wage-based, owned by capital, operating within a system where the worker and the owner have fundamentally different relationships to the work and its rewards.</p><p>And from that moment forward, <strong>technology has been disrupting this arrangement.</strong></p><h3>The Pattern of Disruption: Bulls to Tractors, to Softwares</h3><p>Here’s the thing that both calms people down and terrifies them: <em>this has all happened before</em>.</p><ul><li><strong>Farmers used bulls to plow fields. Then tractors arrived.</strong> Millions of agricultural jobs vanished. Draft animals became obsolete. Did people lose work? Absolutely. But new jobs emerged: tractor mechanics, factory workers building tractors, fuel suppliers.</li><li><strong>Goods were transported by elephants, horses, and human porters. Then trains, trucks, and planes arrived.</strong> Porters lost work. But drivers, pilots, logistics coordinators, and engineers gained it.</li><li><strong>Accountants kept ledgers by hand. Then Excel arrived.</strong> Did bookkeepers lose jobs? Yes. But those who learned Excel became more productive, handled bigger clients, and new roles emerged: data analysts, financial modelers, and software trainers.</li></ul><p>The pattern is consistent: <strong>Technology destroys specific tasks, but historically creates new categories of work.</strong></p><p>The <a href="https://www.google.com/search?q=Luddites&amp;oq=Luddites&amp;gs_lcrp=EgZjaHJvbWUyBggAEEUYOdIBBzE4MWowajeoAgCwAgA&amp;sourceid=chrome&amp;ie=UTF-8">Luddites</a> smashed textile machines in the 1810s, fearing unemployment. They were right that <strong><em>their specific jobs</em> </strong>would disappear. But they were wrong that work itself would vanish. The economy adapted. New industries emerged.</p><p>So when people say, “<strong>AI is just another tool, like tractors or Excel</strong>,” they’re pointing to this historical pattern. Disruption, adaptation, new equilibrium.</p><p>But here’s the uncomfortable question…</p><h3>So, How Is AI Different?</h3><p>Because AI is not just another tractor or another Excel. It’s a tool that has attacked the core thing of human or white collar job — cognitive ability.</p><p>For the first time in history, technological progress isn’t following a linear path. It’s <strong>exponential</strong>. The graph doesn’t climb steadily — it rockets upward, doubling and doubling again. And we’re still in the early part of that curve.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/0*oIo6iw3OV8lmoYrx" /><figcaption><a href="https://thirdeyedata.ai/ai-past-present-and-future/">https://thirdeyedata.ai/ai-past-present-and-future/</a></figcaption></figure><p><strong>Here’s why the AI disruption might break the historical pattern:</strong></p><p><strong>Speed</strong>: Previous technological shifts took decades. Tractors didn’t replace bulls overnight. Workers had time to retrain, and new industries had time to absorb displaced labor. AI is moving faster — potentially replacing cognitive work across multiple industries simultaneously within years, not generations.</p><p><strong>Scope</strong>: Tractors replaced physical labor. Excel replaced manual calculation. But AI can potentially replace <em>cognitive labor</em> — decision-making, pattern recognition, creativity, and analysis. What happens when the “new jobs” that emerge <em>also</em> require skills that AI can do better than humans?</p><p><strong>Generality</strong>: Past tools were narrow. A tractor plows. Excel calculates. AI is general-purpose. GPT can write, code, analyze, design, teach, and diagnose. It’s not replacing one job category; it’s touching all of them at once.</p><p><strong>Ownership</strong>: Here’s the capitalism angle: who owns the AI? If a factory owner bought a tractor, they still needed workers to drive it. If a company deploys AI, it might need <em>far fewer</em> workers — or none. The productivity gains go to capital, not labor. Workers aren’t retrained to use the new tool; they’re simply removed.</p><p><strong>Learning Curve</strong>: You could teach someone to drive a tractor or use Excel in weeks or months. But if AI keeps advancing, can workers retrain fast enough? And retrain into <em>what</em>, if AI is advancing into those fields too?</p><p>The historical pattern assumed human adaptability would outpace technological replacement. AI challenges that assumption.</p><p>So the question isn’t: “Will AI take jobs?” History says yes, it will take <em>some</em> jobs.</p><p>The real questions are:</p><ul><li>Will it create <em>enough</em> new jobs?</li><li>Will it create them <em>fast enough</em>?</li><li>Will those new jobs be <em>accessible</em> to displaced workers?</li><li>And most critically: <strong>In a world where AI can do most cognitive work, what jobs remain uniquely human</strong>,<strong> and will there be enough of them?</strong></li></ul><p>That’s what we need to explore next.</p><p>Alright, we’ve done the history lesson. I have laid the proper foundation for the next part. Part 2 will dig into the present: what jobs has AI already taken? What’s happening to freelance writers, junior developers, photographers, graphic designers, and other areas?</p><p>Are new jobs appearing fast enough? And critically, are they accessible to the people being displaced?</p><p>To be continued…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c23c9fd17b66" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React Context : A beautiful Nightmare]]></title>
            <link>https://sankitdev.medium.com/react-context-a-beautiful-nightmare-55e00efcabca?source=rss-e49841d4b9bb------2</link>
            <guid isPermaLink="false">https://medium.com/p/55e00efcabca</guid>
            <category><![CDATA[react-context-api]]></category>
            <category><![CDATA[state-management]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[react-context]]></category>
            <category><![CDATA[prop-drilling]]></category>
            <dc:creator><![CDATA[sankit]]></dc:creator>
            <pubDate>Sun, 04 Jan 2026 12:54:33 GMT</pubDate>
            <atom:updated>2026-01-04T12:54:33.061Z</atom:updated>
            <content:encoded><![CDATA[<h3>React Context : A beautiful Nightmare</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DhvbhLbnUqnt6Czt7NLo-Q.png" /><figcaption>React Context</figcaption></figure><p>TL;DR — React context was introduced to tackle another nightmare — <strong>prop drilling.</strong></p><p><strong>Prop drilling</strong> is a state where you pass data from parent component to multiple layers of children component.</p><p>For small scale its not an issue but mostly everybody hates it. (I also)</p><p>This is where React Context comes to solve problem in three steps:</p><ol><li>Create a context.</li><li>Create a provider</li><li>Wrap your component with provider</li><li>Consuming the context</li></ol><p>Ok not three but four.</p><h3>1. Creating a Context</h3><p>this is the first step of this whole beautiful mess. React provides an API which is createContext().</p><p>Let me setup an analogy.</p><p>Think of context as setup a white board where something will be written and read by everyone. Currently white board will be empty.</p><p>That’s it.</p><p>Now, Lets say I want to store user information after logging here so that I can access info in child components.</p><p>Lets start with the first step which is creating a context and this part will be remain same for every situations.</p><pre>const UserContext = createContext(null);</pre><p>We need to pass a <strong>default value</strong> to createContext<strong> </strong>as a fall back and if you don’t have any then pass <strong>null</strong>.</p><p>Because when you consume the context and try to access the value you will get <strong>null </strong>if nothing is there.</p><p>But you should not be this lazy, use typescript to define the data this context will hold.</p><pre>// context type<br>export type UserContextType = {<br>  user: string | null;<br>  setUser: (user: string | null) =&gt; void;<br>};<br><br>// creation of context<br>export const UserContext = createContext&lt;UserContextType | null&gt;(null);</pre><p>In above code I have created a type for my UserContext .</p><p>By this type I am damn sure what my context will hold and also it will help with autocomplete while working with provider.</p><p>I have used <strong>union </strong>to be safe here also, if nothing is passed its null. (its all typescript terminology)</p><p>Now coming the hook its a safety net, if you try to access the context outside of provider than it will kick it.</p><p>And apart from this it provides the autocomplete in the components and we won’t need to check for the null in every component.</p><h3>2. Creating a Provider</h3><p>We have done the setup with createContext API. Its time to create a provider which is again simple.</p><p>There are two version of it before React 19 and after it a simple change in syntax is there.</p><p><em>Continuing with our analogy.</em></p><p>This is where we can and others can write something on the board and modify it (with respect to the types we have defined).</p><pre>import { useState } from &quot;react&quot;;<br>import { UserContext } from &quot;./UserContext&quot;;<br><br>type Props = {<br>  children: React.ReactNode,<br>};<br><br>export function UserProvider({ children }: Props) {<br>  const [user, setUser] = useState&lt;string | null&gt;(&quot;mike&quot;);<br><br>  return (<br>  // here is the provider we are talking about<br>    &lt;UserContext.Provider value={{ user, setUser }}&gt;<br>      {children}<br>    &lt;/UserContext.Provider&gt;<br>  );<br>}</pre><p>This is the last piece which used to seem cryptic to me.</p><p>So, here we have defined the properties / states and pass to value prop of provider that we need to consume across the components.</p><p>Remember we defined the types for context this will be useful here when you try to pass some other things you will get typescript compile time error.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bqw2cCYGTTe0sW7fhMYkEw.png" /></figure><p>As you can clearly see the benefits of using typescript here (remember my <a href="https://x.com/sankitdev/status/1992951850354819358?s=20">tweet</a>).</p><p>Ok so what’s changed in React 19. Well you don’t need to write UserContext.Provider.</p><p>I really like the react team efforts to simplifying the APIs.</p><pre>return (<br>    &lt;UserContext value={{ user, setUser }}&gt;<br>      {children}<br>    &lt;/UserContext&gt;<br>  );</pre><p>It works same less annoyance with syntax now. but remember its works with react 19 and which working on old projects you will need to know the old way lol. (fuck you old projects)</p><p>Ok enough talk we have only reached second step.</p><h3>3. Wrap your component with provider</h3><p>So our provider is ready to receive react component as children and whatever component you put inside this will be provided everything from this context.</p><p>for now I have provided to whole App from main. you don’t need to do this btw.</p><p>Provide the context to the component that requires it — to keep things simple.</p><p>Cause if you provide the context to whole children then any children who have subscribed to the context (used the values) will rerender unececssarily.</p><p>In simple words,</p><ul><li>When context value changes</li><li>All the consumers of that context will rerender.</li></ul><pre>createRoot(document.getElementById(&quot;root&quot;)!).render(<br>    &lt;UserProvider&gt;<br>      &lt;App /&gt;<br>    &lt;/UserProvider&gt;<br>);</pre><p>Now inside &lt;App /&gt; component all its children will have access to the UserContext. That’s it.</p><p>Lets move to last step where we will consume the context (finally… after this much majdoori).</p><h3>4. Consuming the context</h3><p>Now there are two ways to consume the context.</p><ol><li>Directly using useContext API</li></ol><pre>const value = useContext(UserContext)<br><br>Now you can access by value.user or value.setUser.<br><br>But you can also destructure things<br><br>const {user, setUser} = useContext(UserContext)<br><br>But there is an issue here typeScript will complain.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*p-kPBsMJtLwt0KzrmZunNw.png" /></figure><p>As you can see typescript is saying that setUser doesn’t exist but I have defined it.</p><p>Its because of the union type we have used that tells typescript that either it can be a value or null.</p><p>So now typescript won’t give autocomplete if we don’t check for null before.</p><p>There are two easy fixes here to get the fucking autocomplete properly.</p><ol><li><strong>Use non-null assertion</strong></li></ol><pre>// non-null assertion:<br>  const { user, setUser } = useContext(UserContext)!;</pre><p>By adding ! we are telling to typescript that trust me bro. I know the value is not null or undefined. (Bhai ne bola to man lene ka).</p><p>But I know you know we are fucking stupid we code so this is not a good approach.</p><p>Making typescript shut up at compile time to make code look error is not a good move.</p><p>Runtime error will kick you ass when time comes.</p><p>With that said here is the safer and recommended approach.</p><p><strong>2. Create a hook</strong></p><p>This is the recommended and scalable approach because we are explicitly checking for null/undefined values and throwing error and returning the values after that.</p><pre>export function useUser() {<br>  const ctx = useContext(UserContext);<br>  if (!ctx) throw new Error(&quot;useUser must be used within a UserProvider&quot;);<br>  return ctx;<br>}</pre><p>Now typescript will not throw error at compile time. Giving you proper suggestion and you don’t need make any random use of things to shut typescript.</p><p>This make me respect typescript more.</p><blockquote><em>TypeScript is like my girlfriend. she warns me early because fixing things later is expensive.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/1*KmIC1N3sY2o0r3lPz3s1Cg.png" /></figure><p>Now you can easily call this hook and everything works like breeze.</p><p>With that said this whole context setup things is now done with all the steps.</p><p>I hope this article might have made some sense to you.</p><p>Thanks for reading.</p><p>Next article might be on state managment hell.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=55e00efcabca" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Made an Existing App Multilingual Without Breaking 100 APIs]]></title>
            <link>https://sankitdev.medium.com/how-i-made-an-existing-app-multilingual-without-breaking-100-apis-bd050d3fb124?source=rss-e49841d4b9bb------2</link>
            <guid isPermaLink="false">https://medium.com/p/bd050d3fb124</guid>
            <category><![CDATA[multilingual-websites]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[backend]]></category>
            <dc:creator><![CDATA[sankit]]></dc:creator>
            <pubDate>Tue, 21 Oct 2025 07:37:03 GMT</pubDate>
            <atom:updated>2025-10-21T07:37:03.034Z</atom:updated>
            <content:encoded><![CDATA[<h3>How I Added Multilingual Support to an Existing App Without Breaking 100 APIs</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LMq4mmqcHv2PfSmVVzrBvQ.png" /><figcaption>Making backend language aware</figcaption></figure><p>In this blog I am going to explain my thought process on implementing language aware backend + frontend in a most simplistic way with minimal changes.</p><h3>Here’s what we’ll cover:</h3><ul><li>The Challenge</li><li>My Approach</li><li>Making the Backend Language Aware</li><li>Frontend Side — Where Things Got Trickier</li><li>Final Outcome</li></ul><h3>The Challenge</h3><p>So, when you’re told to make an entire app multilingual <em>without breaking the existing APIs</em>, you know it’s going to be one of those weeks.</p><p>I got this task on a Wednesday and had to finish to Friday EOD.</p><p><strong>Goal:</strong> Add Spanish support to an existing English-only admin web app &amp; app.</p><p><strong>Catch:</strong> Do it with minimal API changes and without breaking the admin panel.</p><h3>My Approach</h3><p>The project was built in Node.js with MongoDB on the backend and Angular on the frontend.</p><p>All data, API responses, and labels were in English for Admin Dashboards &amp; native app. The new requirement was simple on paper — <em>make everything support Spanish too.</em></p><p>In reality, that meant:</p><ul><li>API responses should depend on selected language.</li><li>Admin dashboard text and labels should switch too.</li><li>Any new content added should automatically be tagged with that language.</li></ul><p>The last point is more crucial. Like I could have added a language option in UI for every content being added. But again that would have increased the complexity for admins.</p><p>The requirement was to add a simple language selector at the top right of the website, and ensure that both fetching and adding content would automatically work for the selected language only.</p><h3>Starting with Backend</h3><p>I started with creating a dedicated Language schema a single source of truth for all supported languages. And most important part adding another language in future will be fairly easy.</p><p>Here is the language schema.</p><pre>const languageSchema = new Schema({<br>  name: { type: String, required: true },<br>  code: { type: String, required: true, unique: true }<br>}, { timestamps: true });</pre><pre>export const Language = mongoose.model(&quot;Language&quot;, languageSchema);</pre><p>PS: We use mongoose ORM to handle all database operations here.</p><p>The next logical step was to modify all the existing schemas so they could reference the <strong>Language</strong> model and be seeded properly.</p><p>I went through each schema and added just one extra line.</p><p>If you’ve worked with MongoDB before, this will look familiar I’m simply creating a reference to the Language model I just defined.</p><p>It’s similar to having a <strong>foreign key</strong> in SQL databases like MySQL or PostgreSQL.</p><pre>language: {type: mongoose.Schema.type.ObjectId, ref: Language, index:true}</pre><p>After this I seeded the language collection with English and Spanish.</p><p>You can create a script to seed or create a proper API with endpoint to add and it will be useful for future use. I did both.</p><p>Then I created another script to link all existing records with the English language ID.</p><p>This was the first most crucial step in making the system language-aware.</p><p>Since all the existing content was in English, I just ran the script and attached the English language Id to every existing record.</p><p>Now, this setup is the backbone of the entire multilingual system. I had laid the foundation till this point.</p><p>Lets move to make the backend language aware so it show the right data for chosen language.</p><h3>Making the Backend Language Aware</h3><p>Once I had the language model, the next step was to make the backend <em>language-aware.</em></p><p>First, I started by creating a function that takes the language code from the frontend query and returns the corresponding language ID from the database.</p><p>But then I realized this approach would waste compute on every request. Imagine hitting the database just to fetch the same language ID again and again, that’s a complete waste of resources.</p><p>So I implemented a simple in-memory cache. I maintained a key-value pair object where the language code was the key and the language ID was the value. If the value was already present in memory, no database call was made.</p><p>here is the simple implementation:-</p><pre>const language = {};<br><br>const fetchLanguageId = async (code) =&gt; {<br>  if (!code) throw new Error(&quot;Code is not passed&quot;);<br>  if (language[code]) return language[code];<br>  // getLanguageId is a simple DB fetch that returns the language object<br>  const languageId = await getLanguageId(code);<br>  // store the ID in memory for future calls<br>  language[code] = languageId._id;<br>  return languageId._id;<br>};</pre><p>After that, my next challenge was to safely extract the language code from the frontend URL.</p><pre>/language=es</pre><p>To access the code I can do below in every controller</p><pre>const langaugeCode = req.query.language</pre><p>but that felt messy and repetitive. It clearly wasn’t the right way to do it.</p><p>So, I created a middleware for admin routes that did one job:</p><ul><li>Check the request for language (from req.query, req.body, or fallback to &#39;en&#39;)</li><li>Fetch the corresponding language object using above function</li><li>Attach it to req.languageId globally</li></ul><p>That meant any controller or service could now access the current language directly no need to check for it around manually for every controllers.</p><h3>Backend was mostly logic. Admin Frontend was chaos.</h3><p>Not only did I have to switch dynamic content based on the selected language, but even the <em>admin dashboard’s static labels</em> had to support multiple languages.</p><p>Luckily, Angular already had i18n set up I just needed to build proper JSON maps for each language and hook them up with the existing translation pipeline.</p><p>This part was mostly labor-intensive. I created the initial JSON structure for all the modules in one language and then used GPT to generate translations for the others. After that, I carefully replaced all static text across the project.</p><p>The setup was like the language code was being saved in cookies and in angular there is HTTP interceptors that sits between the frontend and every API call, acting like a middle layer.</p><p>So what I did was add a simple check inside the interceptor to verify the HTTP method. If the method was <strong>GET</strong>, <strong>POST</strong>, <strong>PUT</strong>, or <strong>PATCH</strong>, I appended the selected language code to the request query.</p><p>After setting that up, I added a quick window reload whenever the language changed, just to make sure everything refreshed correctly.</p><p>That way, when the admin switched the language from the dropdown, all APIs automatically received.</p><pre>?language=es // or en (language code)</pre><p>query no manual handling needed.</p><h3>App implementation</h3><p>Once the admin dashboard was multilingual, it was time to tackle the app side which came with its own set of constraints.</p><p>First, I updated the registration logic to receive the language as a code and store its corresponding language ID in the user document.</p><p>The logic for handling language here was a bit different from the admin side. I didn’t have access to the mobile app code, so I couldn’t make any frontend changes there. I also didn’t want to send any API updates to mobile users, since that would require additional communication and time.</p><p>So, my approach was simple — I already had the user’s preferred language saved in the database. Instead of extracting it from the query or body like on the admin side, I decided to fetch the language ID directly from the user record itself.</p><p>This is where I took advantage of the <strong>existing middleware</strong> used to authenticate users with JWT tokens. I added a small piece of logic there:</p><ul><li>Check if the user has a language set; if not, default to English.</li><li>Once the user is authenticated, attach the language to req.user, which is already globally accessible in the app.</li></ul><p>With this, app user didn’t have to do anything on their end. Whatever language they selected during registration was automatically respected by the backend, and all data was filtered according to that preference.</p><h3>Final Outcome</h3><p>After completing all the above steps, I went through every controller, fetched the language ID from the middleware, and passed it to all relevant functions.</p><p>This ensured that every response returned language-specific content based on the selected language ID.</p><p>Here’s what I achieved in the end:</p><ul><li>Admins could switch languages anytime.</li><li>Mobile users could switch or update their language anytime.</li><li>APIs automatically responded in the selected language.</li><li>Any new content was saved with the correct language ID.</li><li>Static labels switched seamlessly using Angular’s i18n.</li><li>Total code changes: <strong>~5000 lines</strong> (yeah, it was big and I deployed it to dev on Friday 🙂).</li><li>The deployment broke twice, but I fixed it. Both times it turned out to be small TypeScript errors.</li></ul><figure><img alt="Image of Frontend PR with 4,371 line changes" src="https://cdn-images-1.medium.com/max/262/1*TNT12XKEzC8aKGseZ7HARw.jpeg" /><figcaption>Frontend PR Code Changes</figcaption></figure><h3>Key Learning</h3><p><strong>Plan for internationalization early</strong></p><ul><li>Even if you’re starting with one language, set up i18n in the frontend from day one. Retrofitting it later is always harder and boring.</li></ul><p><strong>Design backend components with language in mind</strong></p><ul><li>Define schemas, controllers, and services so they can easily adapt to multiple languages instead of being tightly coupled to one.</li></ul><p><strong>Be mindful of database performance</strong></p><ul><li>Always write functions logic to not overload db with unnecessary calls. At least implement simple cache, middleware wherever necessary.</li></ul><p>Still, this is only half the story. I haven’t even covered how I handled <strong>notifications, emails, and other dynamic content</strong> yet.</p><p>If you guys show some love to this post, I’ll share the next part soon.</p><p>You can connect me on <a href="https://x.com/sankitdev">X</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bd050d3fb124" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>