<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: MD Masud Ur Rahman</title>
    <description>The latest articles on DEV Community by MD Masud Ur Rahman (@shoytanbaba99).</description>
    <link>https://dev.to/shoytanbaba99</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4058588%2F7ae27f0b-e84a-4c69-a159-2c697f71c730.jpg</url>
      <title>DEV Community: MD Masud Ur Rahman</title>
      <link>https://dev.to/shoytanbaba99</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shoytanbaba99"/>
    <language>en</language>
    <item>
      <title>I’m done building CRUD apps. It’s time to learn real systems engineering.</title>
      <dc:creator>MD Masud Ur Rahman</dc:creator>
      <pubDate>Wed, 12 Aug 2026 05:08:27 +0000</pubDate>
      <link>https://dev.to/shoytanbaba99/im-done-building-crud-apps-its-time-to-learn-real-systems-engineering-2ohb</link>
      <guid>https://dev.to/shoytanbaba99/im-done-building-crud-apps-its-time-to-learn-real-systems-engineering-2ohb</guid>
      <description>&lt;p&gt;I recently wrapped up a project idea for my university (&lt;a href="https://github.com/Shoytanbaba99/CampusCare" rel="noopener noreferrer"&gt;CampusCare&lt;/a&gt;) I got from a friend. I managed to get the setup and initialization running pretty quickly by adapting the foundation from a previous app I built (&lt;a href="https://github.com/Shoytanbaba99/frontdesk" rel="noopener noreferrer"&gt;FrontDesk&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;Everything was going fine, but I ran into a couple of weird edge cases I hadn't faced before:&lt;/p&gt;

&lt;p&gt;The Supabase RLS Infinite Loop: I hit a wall with Row Level Security recursion and had to figure out how to use SECURITY DEFINER helper functions to execute queries as the database owner without crashing the database.&lt;/p&gt;

&lt;p&gt;Zod UUID Strictness: I got totally blocked by a silent validation error. It turns out Zod's .uuid() method strictly enforces RFC 4122 rules (requiring specific characters at the 14th/17th position), which was silently dropping my form inputs before they even hit the server.&lt;/p&gt;

&lt;p&gt;Those two bugs were the only actual new things I learned. The rest was just the exact same CRUD, multi-tenant boilerplate.&lt;/p&gt;

&lt;p&gt;Even though I knocked the project out in about a day (admittedly using AI to do the heavy lifting for the UI/UX), it honestly wasn't fun.&lt;/p&gt;

&lt;p&gt;I came back from university today and had a realization: building an e-commerce app next would lead me absolutely nowhere. It would just be the exact same framework magic with a shopping cart attached. I’d be typing the same Next.js routes and Supabase queries, and learning very little.&lt;/p&gt;

&lt;p&gt;My goal right now needs to be depth, not quantity.&lt;/p&gt;

&lt;p&gt;So, I'm pivoting. I sat down, and mapped out a massive 52-week roadmap to completely push myself out of this framework fatigue. It’s a complete guide to understanding low-level systems engineering—going from how a computer actually processes memory, down to raw TCP/IP networking, headless Go APIs, raw PostgreSQL, and Docker deployment.&lt;/p&gt;

&lt;p&gt;I’ll be logging my progress every single day. I find this kind of raw learning genuinely exhilarating right now, and the drive to do this is definitely a blessing from my Creator.&lt;/p&gt;

&lt;p&gt;So yeah, no more shallow, full-stack CRUD apps for a while. It’s time to go deep.&lt;/p&gt;

&lt;p&gt;I’ll drop in here occasionally to post anything interesting I figure out along the way. If you want to follow along or critique the path, here is the GitHub repository where I'll be tracking everything:&lt;/p&gt;

&lt;p&gt;👉 Road to Complete Backend (&lt;a href="https://github.com/Shoytanbaba99/road-to-complete-backend" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;)&lt;/p&gt;

</description>
      <category>learning</category>
      <category>systemdesign</category>
      <category>backend</category>
    </item>
    <item>
      <title>I Tried to Build Monkeytype to Learn React. It Nearly Broke Me.</title>
      <dc:creator>MD Masud Ur Rahman</dc:creator>
      <pubDate>Sun, 09 Aug 2026 11:27:12 +0000</pubDate>
      <link>https://dev.to/shoytanbaba99/i-tried-to-build-monkeytype-to-learn-react-it-nearly-broke-me-58a9</link>
      <guid>https://dev.to/shoytanbaba99/i-tried-to-build-monkeytype-to-learn-react-it-nearly-broke-me-58a9</guid>
      <description>&lt;p&gt;I got off &lt;a href="https://github.com/Shoytanbaba99/frontdesk" rel="noopener noreferrer"&gt;FrontDesk&lt;/a&gt; not satisfied with its UI/UX, and figured: FrontDesk already taught me some things, so why not build something frontend-heavy and actually learn &lt;code&gt;useRef&lt;/code&gt;, &lt;code&gt;useMemo&lt;/code&gt;, rendering, and state management properly this time.&lt;/p&gt;

&lt;p&gt;Back in early college, I'd built a simple typing checker: a plain &lt;code&gt;&amp;lt;textarea&amp;gt;&lt;/code&gt; where typing checked against the target word and swapped CSS classes. Very simple. This time, with more knowledge and AI tools to ask for help and explain things along the way, I figured I'd rebuild it properly as a retro RobCo CRT terminal app: &lt;a href="https://github.com/Shoytanbaba99/typedesk" rel="noopener noreferrer"&gt;Typedesk&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I was completely blown away by how miserable the experience got.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. Where It Worked: Modules 1 &amp;amp; 2
&lt;/h2&gt;

&lt;p&gt;Up through Module 2 (Setup, Design System &amp;amp; Event Architecture), I could actually keep up and understand what was happening.&lt;/p&gt;

&lt;p&gt;I set up localStorage persistence, built &lt;code&gt;useLocalStorage&lt;/code&gt; and &lt;code&gt;useThemeSwitcher&lt;/code&gt; hooks, and put together a 5-theme CRT design system (&lt;code&gt;FALLOUT&lt;/code&gt; green, &lt;code&gt;WYSE&lt;/code&gt; amber, &lt;code&gt;RADAR&lt;/code&gt; emerald, &lt;code&gt;CODEX&lt;/code&gt; parchment, &lt;code&gt;CYBER&lt;/code&gt; hot magenta).&lt;/p&gt;

&lt;p&gt;I was tracking every decision:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Managing root &lt;code&gt;[data-theme="..."]&lt;/code&gt; CSS custom properties on &lt;code&gt;&amp;lt;html&amp;gt;&lt;/code&gt; as the single source of truth, so theme switches bypassed React's Virtual DOM diffing entirely.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Writing an anti-FOUT hydration script to kill theme flashes on load.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Using a render-phase state-adjustment pattern to update state during render instead of chasing cascading &lt;code&gt;useEffect&lt;/code&gt; re-renders.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I was thinking, "okay, I'll drop a &lt;code&gt;useMemo&lt;/code&gt; here and there" - everything felt under control.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjdljr33l9zrmi6o6h03q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjdljr33l9zrmi6o6h03q.png" alt=" " width="800" height="239"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The 5-theme CRT switcher: Fallout Green, Wyse Amber, Cold War Radar, Monastic Codex, Cyberpunk Edo.&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  2. The Wall: Module 3 (Hot-Path Rendering &amp;amp; Caret Math)
&lt;/h2&gt;

&lt;p&gt;Then I hit Module 3: Hot-Path Rendering &amp;amp; Caret Math. That's where the typing engine came in, and I got completely floored.&lt;/p&gt;

&lt;p&gt;My god. Both Gemini and Claude started hallucinating and couldn't figure it out. Forget teaching me best practices—they couldn't even implement a working approach once React's Virtual DOM state loops got mixed with monospace caret pixel math. One prompt would fix caret drift but break line wrapping; the next would fix wrapping and trigger infinite re-renders instead.&lt;/p&gt;

&lt;p&gt;The caret math wasn't just "move right after each character." I had to calculate the exact pixel width of every character across different monitors, handle monospace line-breaking, sync it with CSS transitions, and run a high-precision &lt;code&gt;performance.now()&lt;/code&gt; monotonic timer on top of all of it.&lt;/p&gt;

&lt;p&gt;It felt more like designing an operating system than building a website. Like, damn.&lt;/p&gt;

&lt;p&gt;I was in a rush, so I thought: fuck it, let's push. I pushed again, and again, juggling prompts from here and there. The sheer complexity was unfathomable to me: how does a typing engine website get this fucking hard and require this much goddamn complexity?&lt;/p&gt;

&lt;p&gt;I just gave up. Understood: React just ain't it, man.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. The Reframe: Turns Out I Was Half Right
&lt;/h2&gt;

&lt;p&gt;My gut reaction at the time was blunt: React just isn't it for this. Turns out I was half right.&lt;/p&gt;

&lt;p&gt;I checked how the actual &lt;a href="https://github.com/monkeytypegame/monkeytype" rel="noopener noreferrer"&gt;Monkeytype&lt;/a&gt; is built. Monkeytype uses no framework at all: plain vanilla TypeScript, direct DOM manipulation, no Virtual DOM, no state reconciliation.&lt;/p&gt;

&lt;p&gt;The caret coordinate math is inherent to any real-time positioned-cursor UI: that part was never React's fault. But wrapping high-frequency keydown events (10+ per second) inside React's rendering model (&lt;code&gt;useState&lt;/code&gt;, &lt;code&gt;useRef&lt;/code&gt;, referential equality, component re-renders) piled a whole extra layer of state-management hell on top of an already hard problem.&lt;/p&gt;

&lt;p&gt;The real takeaway: match your stack to the problem, not the other way around. Don't take on a rendering-engine-grade problem and a new framework's mental model at the exact same time.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. What's Next
&lt;/h2&gt;

&lt;p&gt;The idea itself was solid, and I actually pulled it off with AI's help. It's the optimization layer, the React re-render chasing, the state-management spiral, where I hit the wall.&lt;/p&gt;

&lt;p&gt;Despite that, &lt;a href="https://github.com/Shoytanbaba99/typedesk" rel="noopener noreferrer"&gt;Typedesk&lt;/a&gt; is finished, responsive, and deployed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;🚀 &lt;strong&gt;Live Demo:&lt;/strong&gt; &lt;a href="https://shoytanbaba99.github.io/typedesk/" rel="noopener noreferrer"&gt;https://shoytanbaba99.github.io/typedesk/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;📦 &lt;strong&gt;Typedesk GitHub Repo:&lt;/strong&gt; &lt;a href="https://github.com/Shoytanbaba99/typedesk" rel="noopener noreferrer"&gt;https://github.com/Shoytanbaba99/typedesk&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;🔗 &lt;strong&gt;Monkeytype Source Code:&lt;/strong&gt; &lt;a href="https://github.com/monkeytypegame/monkeytype" rel="noopener noreferrer"&gt;https://github.com/monkeytypegame/monkeytype&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Next up: something more bearable. Got a college assignment, asked a friend for ideas, and he said: &lt;em&gt;"just build a complaint management system, just pass, man."&lt;/em&gt; Fair enough.&lt;/p&gt;

&lt;p&gt;That's the next target, back to CRUD, forms, and state transitions, where I can actually hold the whole thing in my head, and hopefully learn something new instead of just surviving it. Cheers for now.&lt;/p&gt;




</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>react</category>
      <category>typescript</category>
    </item>
    <item>
      <title>Escaping Tutorial Hell: Building FrontDesk</title>
      <dc:creator>MD Masud Ur Rahman</dc:creator>
      <pubDate>Fri, 07 Aug 2026 21:17:11 +0000</pubDate>
      <link>https://dev.to/shoytanbaba99/escaping-tutorial-hell-building-frontdesk-112n</link>
      <guid>https://dev.to/shoytanbaba99/escaping-tutorial-hell-building-frontdesk-112n</guid>
      <description>&lt;p&gt;Recently, I decided it was time to step out of tutorial hell and actually build a serious full-stack application from scratch. I wanted to understand how production software is planned, structured, and secured.&lt;/p&gt;

&lt;p&gt;That project became FrontDesk, a multi-tenant solo service provider platform. It basically allows freelancers to create a public profile, display their services, and let clients request bookings straight into a private inbox. I built it using Next.js 16 (App Router), Supabase, Zod, and Tailwind CSS.&lt;/p&gt;

&lt;p&gt;Here is a breakdown of the mental models I gained, how the security pipeline actually works, and why I am immediately moving on to a new project.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Real Software Actually Gets Planned
&lt;/h2&gt;

&lt;p&gt;Before this, I did not really know where to start when building a complex web app. Do you build the buttons first? The database?&lt;/p&gt;

&lt;p&gt;Through FrontDesk, I finally understood the sequential phases that software goes through. I realized you do not just start writing React components. The flow looks more like this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Database Schema (DDL):&lt;/strong&gt; Designing the PostgreSQL tables (profiles, blocks, requests) and foreign keys first.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Auth &amp;amp; Proxy:&lt;/strong&gt; Setting up HttpOnly session cookies and the Next.js middleware proxy.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Server Actions &amp;amp; Validation:&lt;/strong&gt; Building the backend mutation logic and parsing inputs with Zod.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Component Assembly:&lt;/strong&gt; Creating the decoupled React components.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;UI/UX Polish:&lt;/strong&gt; (Which I admittedly kind of skipped... more on that later).&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The 4-Layer Defense-in-Depth Funnel
&lt;/h2&gt;

&lt;p&gt;My biggest takeaway was learning that modern web security is not just a single &lt;code&gt;if (user)&lt;/code&gt; check. It is a multi-stage defense funnel.&lt;/p&gt;

&lt;p&gt;If someone tries to submit a form on FrontDesk, here is the exact pipeline their data has to survive:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Client-Side Validation (Zod):&lt;/strong&gt; Catching typos and malformed types before a network request is even sent.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Middleware Proxy Session Check:&lt;/strong&gt; Verifying the HttpOnly cookie and refreshing the auth state securely.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Server Action Validation:&lt;/strong&gt; Re-running Zod checks on the server because client-side validation can always be bypassed.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Database Row Level Security (RLS):&lt;/strong&gt; PostgreSQL policies ensuring the authenticated user actually owns the target resource.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F43etygvh14ws0i0upbxj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F43etygvh14ws0i0upbxj.png" alt="an attempt was made" width="552" height="1159"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Supabase Abstraction Realization
&lt;/h2&gt;

&lt;p&gt;Supabase is an amazing BaaS (Backend as a Service). It abstracts away a lot of heavy backend complexity.&lt;/p&gt;

&lt;p&gt;Initially, the architecture looked pretty overwhelming, but eventually, the mental model clicked. I realized that while Supabase handled the connection pooling, the JWT signing, and the background refresh tokens, I still had to architect the application logic. I had to manually manage session redirection, set up the Edge proxy, and write the Row Level Security (RLS) policies in PostgreSQL so that users could only mutate their own data.&lt;/p&gt;

&lt;h2&gt;
  
  
  The "Ugly UI" Confession &amp;amp; What is Next
&lt;/h2&gt;

&lt;p&gt;So, here is the truth about the frontend: the default UI of FrontDesk is highly minimal.&lt;/p&gt;

&lt;p&gt;I spent so much mental energy focusing on the backend pipeline, the security layers, and the database schema that I intentionally kept the UI generic. However, the beauty of the platform is that it is entirely data-driven. The interface comes to life once a user customizes it, uploading custom avatars, injecting their own hex accent colors, and populating service blocks with dynamic cover images. It’s a functional, workable canvas.&lt;/p&gt;

&lt;p&gt;Still, wrestling with the backend architecture was exhausting, and honestly? I need a palate cleanser.&lt;/p&gt;

&lt;p&gt;I want to dive deep into frontend-heavy, client-side state management without worrying about database schemas or RLS for a minute. So, my next project is going to be &lt;strong&gt;TypeDesk&lt;/strong&gt;, a completely sanitized, SPA speed-typing website (like Monkeytype) with a retro terminal aesthetic. I'm going to focus entirely on high-frequency UI updates, &lt;code&gt;requestAnimationFrame&lt;/code&gt;, and hyper-optimized React rendering.&lt;/p&gt;

&lt;p&gt;I'll write about that once it's done. Until then, you can check out the FrontDesk repo [&lt;a href="https://github.com/Shoytanbaba99/frontdesk" rel="noopener noreferrer"&gt;here&lt;/a&gt;].&lt;/p&gt;

&lt;p&gt;Pretty crazy journey so far, ig ;3&lt;/p&gt;




&lt;h2&gt;
  
  
  🚨 UPDATE: Security Post-Mortem (Application-Layer Rate Limiting)
&lt;/h2&gt;

&lt;p&gt;So, after publishing this post, a code review pointed out a massive blind spot I completely missed regarding public write endpoints.&lt;/p&gt;

&lt;p&gt;Sure, RLS handles &lt;em&gt;who&lt;/em&gt; can touch a table, and Vercel/Supabase stop basic network DDoS attacks. But PostgREST doesn't know anything about custom business logic for my &lt;code&gt;requests&lt;/code&gt; table. Left unchecked, a basic script could just spam my booking form in a loop and fill my database with garbage data until storage blows up.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Fix:&lt;/strong&gt; Before a form submission even sniffs the database, the Next.js Server Action has to hit an IP rate-limiter (like an Upstash Redis sliding window) to cap public submissions, keeping it locked to something sensible like 3 requests per minute per IP.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>typescript</category>
      <category>security</category>
      <category>nextjs</category>
    </item>
    <item>
      <title>How Node.js Actually Works (A Beginner's Mental Model)</title>
      <dc:creator>MD Masud Ur Rahman</dc:creator>
      <pubDate>Thu, 06 Aug 2026 13:30:42 +0000</pubDate>
      <link>https://dev.to/shoytanbaba99/how-nodejs-actually-works-a-beginners-mental-model-682</link>
      <guid>https://dev.to/shoytanbaba99/how-nodejs-actually-works-a-beginners-mental-model-682</guid>
      <description>&lt;p&gt;Recently, I went down a rabbit hole trying to understand how Node.js handles asynchronous operations under the hood. I took a bunch of notes, refined them to make sense of the chaos, and wanted to share the mental model that finally made it "click" for me. If you are a beginner like me, I hope this helps you too!&lt;/p&gt;




&lt;h2&gt;
  
  
  What Node.js Actually Is
&lt;/h2&gt;

&lt;p&gt;Node.js is a server-side JavaScript runtime environment. It takes the &lt;strong&gt;V8 JavaScript engine&lt;/strong&gt; (the exact same engine that powers Google Chrome) out of the browser and wraps it in C++ bindings.&lt;/p&gt;

&lt;p&gt;This allows JavaScript to break out of the browser sandbox and interact directly with the Operating System, file systems (&lt;code&gt;fs&lt;/code&gt;), and network protocols.&lt;/p&gt;




&lt;h2&gt;
  
  
  How It Executes Code (The Delegation Model)
&lt;/h2&gt;

&lt;p&gt;JavaScript is strictly &lt;strong&gt;single-threaded&lt;/strong&gt;. This means its main execution space (the V8 Call Stack) can only process one operation at a time. To prevent your server from freezing during slow tasks (like querying a database), Node.js uses a delegation architecture:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Encounter &amp;amp; Delegate:&lt;/strong&gt; When JavaScript hits an operation it cannot execute directly on the main thread (such as reading from disk or fetching from a remote API), V8 immediately delegates that task to Node's underlying C++ background engine (&lt;code&gt;libuv&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Registers &amp;amp; Frees the Stack:&lt;/strong&gt; Node hands &lt;code&gt;libuv&lt;/code&gt; the background task alongside a reference to your callback. V8 finishes executing the initial setup function immediately and pops it off the Call Stack. This frees the main JavaScript thread to instantly handle other users or execute the rest of your script.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Background Work:&lt;/strong&gt; While JavaScript continues executing code on the main thread, &lt;code&gt;libuv&lt;/code&gt; carries out the heavy lifting in the background using OS kernel facilities or a background Worker Thread Pool.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Task Queue Resolution:&lt;/strong&gt; When &lt;code&gt;libuv&lt;/code&gt; finishes the background work, it pushes the completed result along with its callback into the Task Queue.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Resuming Execution:&lt;/strong&gt; The &lt;strong&gt;Event Loop&lt;/strong&gt; constantly monitors the V8 Call Stack. Once it detects that the Call Stack is completely empty, it picks up the callback from the Task Queue, pushes it back onto the V8 Call Stack, and JavaScript resumes executing the rest of the code.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Visualizing the Flow
&lt;/h2&gt;

&lt;p&gt;Here is a simple architectural map of how V8 and C++ work together:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
      [1] JAVASCRIPT CODE
      fs.readFile('data.json', callback) 
               |
               v
  [2] V8 ENGINE (Call Stack)
      - Looks up function in C++ Binding Registry
               |
               v
  [3] C++ BINDING BRIDGE
      - Registers callback with libuv &amp;amp; returns to V8
               |
               +-----------------------------------+
               |                                   |
               v                                   v
  [4] V8 CONTINUES MAIN THREAD            [5] LIBUV (C++ Thread / OS Kernel)
      - Call stack is freed!       - Reads file from physical disk
      - Runs next lines of JS code                 |
                                                   v
                                          [6] TASK COMPLETE
                                    - Pushes result to Task Queue
                                                   |
                                                   v
                                          [7] EVENT LOOP
                               - Detects V8 Call Stack is empty
                        - Moves callback back onto V8 Call Stack

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If we write a simple script, we can see this exact delegation happening in real-time:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;fs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;fs&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;1. V8 runs this immediately on the Call Stack.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// V8 delegates this to Node (libuv), empties the stack, and moves on! &lt;/span&gt;
&lt;span class="nx"&gt;fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;readFile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;database.json&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;3. The Event Loop pushes this back to V8 when the background work is done.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;2. V8 runs this without waiting for the file to finish reading.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you run this code, it will always print in this exact sequence:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1. V8 runs this immediately on the Call Stack.

2. V8 runs this without waiting for the file to finish reading.

3. The Event Loop pushes this back to V8 when the background work is done.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The main thread never blocked for a single millisecond!&lt;/p&gt;

&lt;p&gt;Pretty cool i guess \+_+/.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>node</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
