<?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: Neweraofcoding</title>
    <description>The latest articles on DEV Community by Neweraofcoding (@sunny7899).</description>
    <link>https://dev.to/sunny7899</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%2F507848%2F1ef50d4c-bba5-4ae0-a9cf-7b949aed7e6e.png</url>
      <title>DEV Community: Neweraofcoding</title>
      <link>https://dev.to/sunny7899</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sunny7899"/>
    <language>en</language>
    <item>
      <title>How to Build a Modern Chrome Extension with Manifest V3 Best Practices</title>
      <dc:creator>Neweraofcoding</dc:creator>
      <pubDate>Sat, 12 Sep 2026 11:20:25 +0000</pubDate>
      <link>https://dev.to/sunny7899/how-to-build-a-modern-chrome-extension-with-manifest-v3-best-practices-3h56</link>
      <guid>https://dev.to/sunny7899/how-to-build-a-modern-chrome-extension-with-manifest-v3-best-practices-3h56</guid>
      <description>&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%2F9jqqtxmojkv3x8m5abo8.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%2F9jqqtxmojkv3x8m5abo8.png" alt="How to create a Chrome extension with best practices" width="800" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Browser extensions are one of the fastest ways to build high-impact tools using the frontend skills you already have (HTML, CSS, and JavaScript).&lt;/p&gt;

&lt;p&gt;However, if your experience was based on Manifest V2, building extensions in 2026 requires adapting to &lt;strong&gt;Manifest V3 (MV3)&lt;/strong&gt; standards—including event-driven service workers, stricter Content Security Policies (CSP), and promise-based Chrome APIs.&lt;/p&gt;

&lt;h3&gt;
  
  
  What’s Covered in This Guide:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Structuring &lt;code&gt;manifest.json&lt;/code&gt; under Manifest V3 specifications&lt;/li&gt;
&lt;li&gt;Designing popup UIs and styling with modern CSS&lt;/li&gt;
&lt;li&gt;Working with event-driven background service workers&lt;/li&gt;
&lt;li&gt;Injecting and managing content scripts safely&lt;/li&gt;
&lt;li&gt;Cross-component messaging via &lt;code&gt;chrome.runtime.sendMessage&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Managing persistent state using &lt;code&gt;chrome.storage.local&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Check out the full tutorial and code snippets on &lt;a href="https://sunnyblog.apexmansunny.workers.dev/posts/how-to-create-a-chrome-extension-with-best-practices/" rel="noopener noreferrer"&gt;SunnyWriteUps&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>node</category>
      <category>programming</category>
    </item>
    <item>
      <title>Get Started with Kotlin: Building Your First Android App with Jetpack Compose</title>
      <dc:creator>Neweraofcoding</dc:creator>
      <pubDate>Tue, 08 Sep 2026 04:05:23 +0000</pubDate>
      <link>https://dev.to/sunny7899/get-started-with-kotlin-building-your-first-android-app-with-jetpack-compose-33m9</link>
      <guid>https://dev.to/sunny7899/get-started-with-kotlin-building-your-first-android-app-with-jetpack-compose-33m9</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/..." 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/..." alt="Uploading image" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you've been wanting to build native Android apps, there's never been a better time to jump in. The days of juggling XML layouts, &lt;code&gt;findViewById&lt;/code&gt;, and fragmented lifecycle logic are behind us. &lt;/p&gt;

&lt;p&gt;Modern Android development is entirely &lt;strong&gt;Kotlin-first&lt;/strong&gt;, powered by &lt;strong&gt;Jetpack Compose&lt;/strong&gt;—Google's modern declarative UI toolkit.&lt;/p&gt;

&lt;h3&gt;
  
  
  In this tutorial, we cover:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Setting up your development environment in Android Studio&lt;/li&gt;
&lt;li&gt;Understanding declarative UI with &lt;code&gt;@Composable&lt;/code&gt; functions&lt;/li&gt;
&lt;li&gt;Managing UI state and handling user events&lt;/li&gt;
&lt;li&gt;Leveraging interactive previews to speed up design iterations&lt;/li&gt;
&lt;li&gt;Running and debugging your app on emulators and real devices&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Read the full tutorial on &lt;a href="https://sunnyblog.apexmansunny.workers.dev/posts/get-started-with-kotlin/" rel="noopener noreferrer"&gt;SunnyWriteUps&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>android</category>
      <category>kotlin</category>
      <category>mobile</category>
      <category>programming</category>
    </item>
    <item>
      <title>How to Build and Publish Your First Python Package to PyPI</title>
      <dc:creator>Neweraofcoding</dc:creator>
      <pubDate>Thu, 03 Sep 2026 05:24:03 +0000</pubDate>
      <link>https://dev.to/sunny7899/how-to-build-and-publish-your-first-python-package-to-pypi-367p</link>
      <guid>https://dev.to/sunny7899/how-to-build-and-publish-your-first-python-package-to-pypi-367p</guid>
      <description>&lt;p&gt;Publishing your own library to the Python Package Index (PyPI) turns a local script into a globally installable tool with a single command: &lt;code&gt;pip install your-package&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;If you've been putting off package creation because older tooling felt convoluted, modern Python standards (&lt;code&gt;pyproject.toml&lt;/code&gt;) make the process clean and predictable.&lt;/p&gt;

&lt;h3&gt;
  
  
  What We Cover:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Setting up the recommended &lt;code&gt;src/&lt;/code&gt; directory structure&lt;/li&gt;
&lt;li&gt;Configuring &lt;code&gt;pyproject.toml&lt;/code&gt; with metadata, licenses, and build backends&lt;/li&gt;
&lt;li&gt;Building source distributions and wheels using &lt;code&gt;python -m build&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Testing your upload safely against TestPyPI&lt;/li&gt;
&lt;li&gt;Publishing to production PyPI with API token security&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Read the complete walkthrough on &lt;a href="https://sunnyblog.apexmansunny.workers.dev/posts/how-to-create-your-first-pypi-package/" rel="noopener noreferrer"&gt;SunnyWriteUps&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>python</category>
      <category>programming</category>
      <category>opensource</category>
      <category>devops</category>
    </item>
    <item>
      <title>How to Create and Publish Your First Rust Package (Crate)</title>
      <dc:creator>Neweraofcoding</dc:creator>
      <pubDate>Tue, 01 Sep 2026 18:08:41 +0000</pubDate>
      <link>https://dev.to/sunny7899/how-to-create-and-publish-your-first-rust-package-crate-3kg6</link>
      <guid>https://dev.to/sunny7899/how-to-create-and-publish-your-first-rust-package-crate-3kg6</guid>
      <description>&lt;p&gt;Building and distributing reusable code is a major milestone in Rust. In the Rust ecosystem, packages are called &lt;strong&gt;crates&lt;/strong&gt;, and they are managed through &lt;strong&gt;Cargo&lt;/strong&gt;—Rust’s official build system and package manager.&lt;/p&gt;

&lt;p&gt;In this guide, we cover:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Scaffolding binary vs. library crates&lt;/li&gt;
&lt;li&gt;Setting up metadata and dependencies in &lt;code&gt;Cargo.toml&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Best practices for testing and generating documentation&lt;/li&gt;
&lt;li&gt;Publishing your package to crates.io&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Check out the full walkthrough on &lt;a href="https://sunnyblog.apexmansunny.workers.dev/posts/how-to-create-your-rust-package/" rel="noopener noreferrer"&gt;SunnyWriteUps&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>rust</category>
      <category>cargo</category>
      <category>programming</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Angular Lite: Architecting a Compiler with Gemini</title>
      <dc:creator>Neweraofcoding</dc:creator>
      <pubDate>Mon, 17 Aug 2026 14:18:30 +0000</pubDate>
      <link>https://dev.to/sunny7899/angular-lite-architecting-a-compiler-with-gemini-2ihj</link>
      <guid>https://dev.to/sunny7899/angular-lite-architecting-a-compiler-with-gemini-2ihj</guid>
      <description>&lt;p&gt;Can AI help architect a frontend compiler? 🤔 I just published a deep dive into a Gemini-powered Angular "Lite" prototype.&lt;/p&gt;

&lt;p&gt;We are moving past AI generating basic components and into AI-assisted system architecture.&lt;/p&gt;

&lt;p&gt;Read the full breakdown here 👇&lt;br&gt;
&lt;a href="https://sunnyblog.apexmansunny.workers.dev/posts/angular-compiler-with-gemini/" rel="noopener noreferrer"&gt;https://sunnyblog.apexmansunny.workers.dev/posts/angular-compiler-with-gemini/&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Angular #GeminiAI #WebDev
&lt;/h1&gt;

</description>
      <category>angular</category>
    </item>
    <item>
      <title>The Core of Angular Configuration</title>
      <dc:creator>Neweraofcoding</dc:creator>
      <pubDate>Wed, 05 Aug 2026 19:00:01 +0000</pubDate>
      <link>https://dev.to/sunny7899/the-core-of-angular-configuration-2dhm</link>
      <guid>https://dev.to/sunny7899/the-core-of-angular-configuration-2dhm</guid>
      <description>&lt;p&gt;You write the code, but what manages the workspace? Uncover the secrets of angular.json, the unsung hero and central command center of every Angular application. Join me for a tour of the control room.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://sunnyblog.apexmansunny.workers.dev/posts/angular/the-control-room-of-your-angular-workspace/" rel="noopener noreferrer"&gt;https://sunnyblog.apexmansunny.workers.dev/posts/angular/the-control-room-of-your-angular-workspace/&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Browser APIs That Can Replace Third-Party Libraries</title>
      <dc:creator>Neweraofcoding</dc:creator>
      <pubDate>Mon, 27 Jul 2026 16:09:41 +0000</pubDate>
      <link>https://dev.to/sunny7899/browser-apis-that-can-replace-third-party-libraries-b7d</link>
      <guid>https://dev.to/sunny7899/browser-apis-that-can-replace-third-party-libraries-b7d</guid>
      <description>&lt;p&gt;Modern browsers are far more powerful than most developers realize. Beyond rendering web pages, they provide a rich ecosystem of native APIs that enable applications to access device capabilities, work offline, interact with hardware, communicate in real time, and deliver experiences that rival native apps—all without relying on heavy third-party libraries.&lt;/p&gt;

&lt;p&gt;In this article, I explore the world of Native Browser APIs, explaining how modern web applications can leverage built-in browser features such as the File System Access API, Clipboard API, Web Share API, Geolocation, Notifications, Web Bluetooth, WebUSB, WebRTC, and many more. Along the way, you'll discover practical use cases, real-world examples, browser compatibility considerations, and best practices for building secure, performant, and future-ready web applications.&lt;/p&gt;

&lt;p&gt;Whether you're a frontend developer, full-stack engineer, or simply curious about the evolving capabilities of the web platform, this guide will help you unlock the true potential of modern browsers and build experiences that are faster, smarter, and more engaging—using the APIs already available in the browser. Inspired by the continued evolution of the web platform and modern browser capabilities, this article serves as a practical guide to leveraging native features that reduce dependencies while improving user experience.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://sunnyblog.apexmansunny.workers.dev/posts/unlocking-the-power-of-the-web-a-guide-to-native-browser-apis/" rel="noopener noreferrer"&gt;https://sunnyblog.apexmansunny.workers.dev/posts/unlocking-the-power-of-the-web-a-guide-to-native-browser-apis/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>api</category>
      <category>frontend</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>The Agentic Stack: Discover the Gemini Enterprise Agent Platform.</title>
      <dc:creator>Neweraofcoding</dc:creator>
      <pubDate>Fri, 26 Jun 2026 17:33:28 +0000</pubDate>
      <link>https://dev.to/sunny7899/the-agentic-stack-why-managing-thousands-of-ai-agents-is-the-next-enterprise-revolution-5b2o</link>
      <guid>https://dev.to/sunny7899/the-agentic-stack-why-managing-thousands-of-ai-agents-is-the-next-enterprise-revolution-5b2o</guid>
      <description>&lt;p&gt;Learn how to move from building single agents to managing a mission control of thousands of them – all with complete governance.&lt;/p&gt;

&lt;p&gt;The Agentic Stack: Why Managing Thousands of AI Agents Is the Next Enterprise Revolution&lt;/p&gt;

&lt;p&gt;For the past two years, the AI industry has been obsessed with one question:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"How do we build better AI agents?"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;But we're now entering a new era where that question is no longer enough.&lt;/p&gt;

&lt;p&gt;The real challenge isn't creating one intelligent agent—it's managing thousands of them.&lt;/p&gt;

&lt;p&gt;Imagine an enterprise where every department has its own specialized AI:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A customer support agent answering tickets.&lt;/li&gt;
&lt;li&gt;A finance agent processing invoices.&lt;/li&gt;
&lt;li&gt;An HR agent screening resumes.&lt;/li&gt;
&lt;li&gt;A legal agent reviewing contracts.&lt;/li&gt;
&lt;li&gt;A DevOps agent monitoring infrastructure.&lt;/li&gt;
&lt;li&gt;A sales agent qualifying leads.&lt;/li&gt;
&lt;li&gt;A marketing agent creating campaigns.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now imagine these agents working together, sharing context, using enterprise data, and operating under strict governance.&lt;/p&gt;

&lt;p&gt;That's what the &lt;strong&gt;Agentic Stack&lt;/strong&gt; is all about.&lt;/p&gt;

&lt;p&gt;It's not just another AI framework—it's a blueprint for building an enterprise powered by intelligent, autonomous systems.&lt;/p&gt;




&lt;h1&gt;
  
  
  The Shift: From Single Agents to Agent Ecosystems
&lt;/h1&gt;

&lt;p&gt;Most developers begin by building a single AI assistant.&lt;/p&gt;

&lt;p&gt;It can answer questions, summarize documents, or automate a workflow.&lt;/p&gt;

&lt;p&gt;That's a great starting point.&lt;/p&gt;

&lt;p&gt;But enterprises don't operate through a single workflow.&lt;/p&gt;

&lt;p&gt;They run hundreds of interconnected processes every day.&lt;/p&gt;

&lt;p&gt;Instead of one AI assistant, organizations need an ecosystem of specialized agents that collaborate to achieve business goals.&lt;/p&gt;

&lt;p&gt;Think of it like a modern company:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Employees specialize in different functions.&lt;/li&gt;
&lt;li&gt;Teams collaborate across departments.&lt;/li&gt;
&lt;li&gt;Managers coordinate priorities.&lt;/li&gt;
&lt;li&gt;Governance ensures compliance and accountability.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The future of AI follows the same model.&lt;/p&gt;




&lt;h1&gt;
  
  
  What Is the Agentic Stack?
&lt;/h1&gt;

&lt;p&gt;The Agentic Stack is the foundation for building, deploying, orchestrating, and governing AI agents at enterprise scale.&lt;/p&gt;

&lt;p&gt;Rather than treating AI as a chatbot, it treats agents as digital workers with clearly defined responsibilities.&lt;/p&gt;

&lt;p&gt;A complete Agentic Stack typically includes:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Specialized AI Agents
&lt;/h3&gt;

&lt;p&gt;Each agent has a focused responsibility instead of trying to solve every problem.&lt;/p&gt;

&lt;p&gt;Examples include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Customer Support Agent&lt;/li&gt;
&lt;li&gt;Sales Assistant&lt;/li&gt;
&lt;li&gt;Research Agent&lt;/li&gt;
&lt;li&gt;Document Intelligence Agent&lt;/li&gt;
&lt;li&gt;Data Analyst Agent&lt;/li&gt;
&lt;li&gt;Infrastructure Monitoring Agent&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Specialization improves both reliability and performance.&lt;/p&gt;




&lt;h3&gt;
  
  
  2. Agent Orchestration
&lt;/h3&gt;

&lt;p&gt;Real business problems often require multiple steps.&lt;/p&gt;

&lt;p&gt;A customer asking for a refund might trigger:&lt;/p&gt;

&lt;p&gt;Customer Agent&lt;/p&gt;

&lt;p&gt;↓&lt;/p&gt;

&lt;p&gt;Order Verification Agent&lt;/p&gt;

&lt;p&gt;↓&lt;/p&gt;

&lt;p&gt;Fraud Detection Agent&lt;/p&gt;

&lt;p&gt;↓&lt;/p&gt;

&lt;p&gt;Finance Agent&lt;/p&gt;

&lt;p&gt;↓&lt;/p&gt;

&lt;p&gt;Notification Agent&lt;/p&gt;

&lt;p&gt;No single agent should handle the entire process.&lt;/p&gt;

&lt;p&gt;Instead, orchestration ensures the right agent performs the right task at the right time.&lt;/p&gt;




&lt;h3&gt;
  
  
  3. Shared Enterprise Knowledge
&lt;/h3&gt;

&lt;p&gt;An AI agent without business context is like a new employee on their first day.&lt;/p&gt;

&lt;p&gt;To make informed decisions, agents need secure access to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Internal documentation&lt;/li&gt;
&lt;li&gt;Knowledge bases&lt;/li&gt;
&lt;li&gt;CRM systems&lt;/li&gt;
&lt;li&gt;ERP platforms&lt;/li&gt;
&lt;li&gt;Product catalogs&lt;/li&gt;
&lt;li&gt;Company policies&lt;/li&gt;
&lt;li&gt;Historical conversations&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Retrieval-Augmented Generation (RAG) helps agents retrieve relevant information instead of relying only on model memory.&lt;/p&gt;




&lt;h3&gt;
  
  
  4. Tool Integration
&lt;/h3&gt;

&lt;p&gt;Enterprise agents create value when they take action.&lt;/p&gt;

&lt;p&gt;Instead of only generating text, they should be able to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create Jira tickets&lt;/li&gt;
&lt;li&gt;Send emails&lt;/li&gt;
&lt;li&gt;Query databases&lt;/li&gt;
&lt;li&gt;Schedule meetings&lt;/li&gt;
&lt;li&gt;Generate reports&lt;/li&gt;
&lt;li&gt;Trigger APIs&lt;/li&gt;
&lt;li&gt;Update CRMs&lt;/li&gt;
&lt;li&gt;Monitor cloud infrastructure&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;An agent becomes truly useful when it can move from reasoning to execution.&lt;/p&gt;




&lt;h3&gt;
  
  
  5. Memory and Context
&lt;/h3&gt;

&lt;p&gt;Modern AI agents shouldn't forget every conversation after a single interaction.&lt;/p&gt;

&lt;p&gt;Persistent memory enables them to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Remember previous customer interactions&lt;/li&gt;
&lt;li&gt;Track ongoing projects&lt;/li&gt;
&lt;li&gt;Personalize recommendations&lt;/li&gt;
&lt;li&gt;Maintain long-running workflows&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Context transforms isolated conversations into continuous collaboration.&lt;/p&gt;




&lt;h1&gt;
  
  
  Why Governance Matters More Than Intelligence
&lt;/h1&gt;

&lt;p&gt;As organizations deploy hundreds—or even thousands—of AI agents, governance becomes the foundation of trust.&lt;/p&gt;

&lt;p&gt;Without governance, businesses risk:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Data leaks&lt;/li&gt;
&lt;li&gt;Unauthorized actions&lt;/li&gt;
&lt;li&gt;Compliance violations&lt;/li&gt;
&lt;li&gt;Hallucinated responses&lt;/li&gt;
&lt;li&gt;Inconsistent decision-making&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Enterprise AI requires guardrails, including:&lt;/p&gt;

&lt;h3&gt;
  
  
  Identity and Access Control
&lt;/h3&gt;

&lt;p&gt;Every agent should have clearly defined permissions.&lt;/p&gt;

&lt;p&gt;A marketing agent should never access payroll records.&lt;/p&gt;

&lt;p&gt;A finance agent shouldn't modify engineering systems.&lt;/p&gt;




&lt;h3&gt;
  
  
  Audit Logs
&lt;/h3&gt;

&lt;p&gt;Every decision should be traceable.&lt;/p&gt;

&lt;p&gt;Organizations need visibility into:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which agent acted&lt;/li&gt;
&lt;li&gt;What information it used&lt;/li&gt;
&lt;li&gt;Which tools it accessed&lt;/li&gt;
&lt;li&gt;Why a decision was made&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Transparency is essential for compliance and debugging.&lt;/p&gt;




&lt;h3&gt;
  
  
  Human Approval
&lt;/h3&gt;

&lt;p&gt;Not every action should be fully autonomous.&lt;/p&gt;

&lt;p&gt;Critical tasks—such as financial transactions, legal approvals, or customer escalations—should include human review.&lt;/p&gt;

&lt;p&gt;The goal isn't to replace people.&lt;/p&gt;

&lt;p&gt;It's to automate routine work while preserving human oversight where it matters most.&lt;/p&gt;




&lt;h1&gt;
  
  
  The Mission Control for AI Agents
&lt;/h1&gt;

&lt;p&gt;Imagine opening a dashboard that shows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;2,500 active AI agents&lt;/li&gt;
&lt;li&gt;Real-time health monitoring&lt;/li&gt;
&lt;li&gt;Task completion rates&lt;/li&gt;
&lt;li&gt;Agent collaboration graphs&lt;/li&gt;
&lt;li&gt;Cost per workflow&lt;/li&gt;
&lt;li&gt;Success and failure metrics&lt;/li&gt;
&lt;li&gt;Security alerts&lt;/li&gt;
&lt;li&gt;Compliance status&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This becomes the mission control center for enterprise AI.&lt;/p&gt;

&lt;p&gt;Just as Kubernetes transformed how we manage containers, the next generation of platforms will transform how we manage AI agents.&lt;/p&gt;

&lt;p&gt;The future isn't about launching one agent.&lt;/p&gt;

&lt;p&gt;It's about operating an entire workforce of them.&lt;/p&gt;




&lt;h1&gt;
  
  
  Challenges Enterprises Must Solve
&lt;/h1&gt;

&lt;p&gt;Scaling AI agents isn't just a technical problem.&lt;/p&gt;

&lt;p&gt;Organizations need to address:&lt;/p&gt;

&lt;h2&gt;
  
  
  Cost Optimization
&lt;/h2&gt;

&lt;p&gt;Thousands of AI agents can generate significant inference costs.&lt;/p&gt;

&lt;p&gt;Smart orchestration determines:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which model to use&lt;/li&gt;
&lt;li&gt;When to cache responses&lt;/li&gt;
&lt;li&gt;When smaller models are sufficient&lt;/li&gt;
&lt;li&gt;When reasoning models are necessary&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Efficiency becomes a competitive advantage.&lt;/p&gt;




&lt;h2&gt;
  
  
  Security
&lt;/h2&gt;

&lt;p&gt;AI agents interact with sensitive systems.&lt;/p&gt;

&lt;p&gt;Protecting customer data requires:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Encryption&lt;/li&gt;
&lt;li&gt;Role-based access control&lt;/li&gt;
&lt;li&gt;Secret management&lt;/li&gt;
&lt;li&gt;Secure API authentication&lt;/li&gt;
&lt;li&gt;Data isolation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Security must be built into the architecture—not added later.&lt;/p&gt;




&lt;h2&gt;
  
  
  Observability
&lt;/h2&gt;

&lt;p&gt;Traditional monitoring tracks servers and APIs.&lt;/p&gt;

&lt;p&gt;Agentic systems also need to measure:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Task success rates&lt;/li&gt;
&lt;li&gt;Decision quality&lt;/li&gt;
&lt;li&gt;Tool usage&lt;/li&gt;
&lt;li&gt;Latency&lt;/li&gt;
&lt;li&gt;Hallucination frequency&lt;/li&gt;
&lt;li&gt;Human intervention rates&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Without observability, improving AI systems becomes guesswork.&lt;/p&gt;




&lt;h1&gt;
  
  
  Why This Changes Enterprise Software
&lt;/h1&gt;

&lt;p&gt;Enterprise software has evolved through distinct phases:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Manual workflows&lt;/li&gt;
&lt;li&gt;Digitized applications&lt;/li&gt;
&lt;li&gt;Cloud-native platforms&lt;/li&gt;
&lt;li&gt;AI copilots&lt;/li&gt;
&lt;li&gt;Agentic enterprises&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The next generation of software won't simply help employees work faster.&lt;/p&gt;

&lt;p&gt;It will delegate meaningful work to autonomous, governed AI agents that collaborate across business functions.&lt;/p&gt;

&lt;p&gt;This isn't about replacing humans.&lt;/p&gt;

&lt;p&gt;It's about enabling people to focus on creativity, strategy, and innovation while AI handles repetitive, structured work at scale.&lt;/p&gt;




&lt;h1&gt;
  
  
  Final Thoughts
&lt;/h1&gt;

&lt;p&gt;The conversation around AI is rapidly shifting.&lt;/p&gt;

&lt;p&gt;Building a single AI chatbot is no longer enough.&lt;/p&gt;

&lt;p&gt;The organizations that gain the greatest advantage will be those that can orchestrate thousands of specialized agents, connect them to enterprise knowledge, govern their behavior, and continuously monitor their performance.&lt;/p&gt;

&lt;p&gt;The future belongs not to the company with the smartest individual agent—but to the one with the most effective &lt;strong&gt;Agentic Stack&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The next enterprise operating system won't just run applications.&lt;/p&gt;

&lt;p&gt;It will coordinate an intelligent workforce of AI agents working together toward a common goal.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The age of autonomous enterprises has begun.&lt;/strong&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Scaling Real-Time Applications</title>
      <dc:creator>Neweraofcoding</dc:creator>
      <pubDate>Wed, 24 Jun 2026 03:00:55 +0000</pubDate>
      <link>https://dev.to/sunny7899/scaling-real-time-applications-1g0</link>
      <guid>https://dev.to/sunny7899/scaling-real-time-applications-1g0</guid>
      <description>&lt;p&gt;The Tech Behind Uber &amp;amp; WhatsApp A discussion on real-time messaging, WebSockets, Firebase, and high-performance APIs.&lt;/p&gt;

&lt;p&gt;Today's most successful products—ride-sharing platforms, messaging apps, live collaboration tools, gaming platforms, and financial systems—all share one thing in common: &lt;strong&gt;they're real-time&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;When you book a cab, send a WhatsApp message, or collaborate on a Google Doc, you're not refreshing the page every few seconds. Data flows instantly between users and servers with minimal latency.&lt;/p&gt;

&lt;p&gt;But building these applications isn't as simple as opening a WebSocket connection.&lt;/p&gt;

&lt;p&gt;As someone who has designed distributed systems and real-time platforms, I've learned that the real challenge isn't making something work for &lt;strong&gt;100 users&lt;/strong&gt;—it's making it work reliably for &lt;strong&gt;10 million concurrent users&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Let's dive into the architecture behind modern real-time applications.&lt;/p&gt;




&lt;h1&gt;
  
  
  Scaling Real-Time Applications: The Tech Behind Uber &amp;amp; WhatsApp
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Real-Time Isn't Magic—It's Engineering
&lt;/h2&gt;

&lt;p&gt;Imagine ordering an Uber.&lt;/p&gt;

&lt;p&gt;Within seconds:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your location updates continuously&lt;/li&gt;
&lt;li&gt;Nearby drivers receive your request&lt;/li&gt;
&lt;li&gt;One driver accepts it&lt;/li&gt;
&lt;li&gt;The driver's location updates every few seconds&lt;/li&gt;
&lt;li&gt;ETA changes in real time&lt;/li&gt;
&lt;li&gt;Notifications arrive instantly&lt;/li&gt;
&lt;li&gt;Payment status syncs immediately&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All of this happens across thousands of servers while millions of users perform the same actions simultaneously.&lt;/p&gt;

&lt;p&gt;The same applies to WhatsApp.&lt;/p&gt;

&lt;p&gt;Every message needs to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reach the recipient instantly&lt;/li&gt;
&lt;li&gt;Be delivered exactly once&lt;/li&gt;
&lt;li&gt;Work on unstable mobile networks&lt;/li&gt;
&lt;li&gt;Synchronize across multiple devices&lt;/li&gt;
&lt;li&gt;Preserve message order&lt;/li&gt;
&lt;li&gt;Scale globally&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Achieving this requires a carefully designed architecture rather than a single technology.&lt;/p&gt;




&lt;h1&gt;
  
  
  Understanding Real-Time Communication
&lt;/h1&gt;

&lt;p&gt;Traditional web applications operate on a request-response model.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Client → Request
Server → Response
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The browser asks.&lt;/p&gt;

&lt;p&gt;The server answers.&lt;/p&gt;

&lt;p&gt;Conversation ends.&lt;/p&gt;

&lt;p&gt;This works well for websites but not for live systems.&lt;/p&gt;

&lt;p&gt;Imagine refreshing WhatsApp every second to check for new messages.&lt;/p&gt;

&lt;p&gt;That would be incredibly inefficient.&lt;/p&gt;

&lt;p&gt;Instead, modern applications maintain an &lt;strong&gt;always-open communication channel&lt;/strong&gt; between client and server.&lt;/p&gt;

&lt;p&gt;This is where &lt;strong&gt;WebSockets&lt;/strong&gt; come into play.&lt;/p&gt;




&lt;h1&gt;
  
  
  Why WebSockets Changed Everything
&lt;/h1&gt;

&lt;p&gt;HTTP connections are short-lived.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Client -----&amp;gt; Server
       Request

Server -----&amp;gt; Client
       Response
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A WebSocket connection stays open.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Client &amp;lt;=====================&amp;gt; Server
         Persistent Connection
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now both sides can communicate whenever necessary.&lt;/p&gt;

&lt;p&gt;The server no longer waits for the client to ask.&lt;/p&gt;

&lt;p&gt;It pushes updates instantly.&lt;/p&gt;

&lt;p&gt;Benefits include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Lower latency&lt;/li&gt;
&lt;li&gt;Reduced bandwidth usage&lt;/li&gt;
&lt;li&gt;Instant notifications&lt;/li&gt;
&lt;li&gt;Live dashboards&lt;/li&gt;
&lt;li&gt;Multiplayer gaming&lt;/li&gt;
&lt;li&gt;Chat applications&lt;/li&gt;
&lt;li&gt;Real-time collaboration&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  The Lifecycle of a Chat Message
&lt;/h1&gt;

&lt;p&gt;Suppose Alice sends:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Hey, are you free?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here's what actually happens behind the scenes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Alice

↓
WebSocket

↓
API Gateway

↓
Authentication

↓
Message Queue

↓
Message Service

↓
Database

↓
Notification Service

↓
Recipient WebSocket

↓
Bob
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each step serves a specific purpose.&lt;/p&gt;

&lt;p&gt;Authentication verifies the sender.&lt;/p&gt;

&lt;p&gt;Queues absorb traffic spikes.&lt;/p&gt;

&lt;p&gt;Databases store message history.&lt;/p&gt;

&lt;p&gt;Notification services wake offline devices.&lt;/p&gt;

&lt;p&gt;This modular architecture keeps the platform resilient under heavy load.&lt;/p&gt;




&lt;h1&gt;
  
  
  Why Polling Doesn't Scale
&lt;/h1&gt;

&lt;p&gt;Some beginners implement chat applications using polling.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Every second

Client
   ↓
"Any new messages?"

Server
   ↓
"No."

Repeat forever.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Multiply this by one million users.&lt;/p&gt;

&lt;p&gt;Now your servers process millions of unnecessary requests every second.&lt;/p&gt;

&lt;p&gt;Most of them return nothing.&lt;/p&gt;

&lt;p&gt;That's wasted CPU, bandwidth, and infrastructure cost.&lt;/p&gt;

&lt;p&gt;WebSockets eliminate this problem by sending data only when something changes.&lt;/p&gt;




&lt;h1&gt;
  
  
  Building a High-Performance API
&lt;/h1&gt;

&lt;p&gt;Real-time applications still depend heavily on APIs.&lt;/p&gt;

&lt;p&gt;Good API design focuses on:&lt;/p&gt;

&lt;h3&gt;
  
  
  Fast responses
&lt;/h3&gt;

&lt;p&gt;Keep endpoints lightweight.&lt;/p&gt;

&lt;p&gt;Avoid unnecessary database joins.&lt;/p&gt;

&lt;p&gt;Cache wherever possible.&lt;/p&gt;




&lt;h3&gt;
  
  
  Stateless servers
&lt;/h3&gt;

&lt;p&gt;Never store user session data inside server memory.&lt;/p&gt;

&lt;p&gt;Instead, use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;JWT tokens&lt;/li&gt;
&lt;li&gt;Redis&lt;/li&gt;
&lt;li&gt;Distributed session stores&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Stateless services scale horizontally with ease.&lt;/p&gt;




&lt;h3&gt;
  
  
  Compression
&lt;/h3&gt;

&lt;p&gt;Enable:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Gzip&lt;/li&gt;
&lt;li&gt;Brotli&lt;/li&gt;
&lt;li&gt;Binary protocols&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Every byte matters when millions of users communicate simultaneously.&lt;/p&gt;




&lt;h3&gt;
  
  
  Pagination
&lt;/h3&gt;

&lt;p&gt;Never return:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;GET /messages
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Return:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;GET /messages?page=1&amp;amp;limit=20
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Small payloads improve performance dramatically.&lt;/p&gt;




&lt;h1&gt;
  
  
  Firebase: Real-Time Without Managing Servers
&lt;/h1&gt;

&lt;p&gt;Not every startup needs to build Uber's infrastructure from scratch.&lt;/p&gt;

&lt;p&gt;That's where Firebase shines.&lt;/p&gt;

&lt;p&gt;Firebase provides:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Authentication&lt;/li&gt;
&lt;li&gt;Real-time database&lt;/li&gt;
&lt;li&gt;Firestore&lt;/li&gt;
&lt;li&gt;Push notifications&lt;/li&gt;
&lt;li&gt;Cloud Functions&lt;/li&gt;
&lt;li&gt;Storage&lt;/li&gt;
&lt;li&gt;Analytics&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A client simply listens for updates.&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="nx"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;collection&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;messages&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="nf"&gt;onSnapshot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;snapshot&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="nx"&gt;snapshot&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;docs&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Whenever the database changes, connected clients receive updates automatically.&lt;/p&gt;

&lt;p&gt;No WebSocket management required.&lt;/p&gt;




&lt;h1&gt;
  
  
  But Firebase Isn't Always the Answer
&lt;/h1&gt;

&lt;p&gt;Firebase works wonderfully for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;MVPs&lt;/li&gt;
&lt;li&gt;Hackathons&lt;/li&gt;
&lt;li&gt;Startup prototypes&lt;/li&gt;
&lt;li&gt;Internal tools&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;However, very large applications often outgrow it.&lt;/p&gt;

&lt;p&gt;Common reasons include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Vendor lock-in&lt;/li&gt;
&lt;li&gt;Expensive reads at scale&lt;/li&gt;
&lt;li&gt;Complex querying limitations&lt;/li&gt;
&lt;li&gt;Multi-region architecture challenges&lt;/li&gt;
&lt;li&gt;Custom infrastructure requirements&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Large organizations usually combine multiple technologies instead.&lt;/p&gt;




&lt;h1&gt;
  
  
  Scaling Beyond One Server
&lt;/h1&gt;

&lt;p&gt;Imagine your chat server receives:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;100,000 WebSocket connections
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One server won't survive.&lt;/p&gt;

&lt;p&gt;Instead:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Load Balancer

      │
 ┌────┼────┐
 │    │    │
Server A
Server B
Server C
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Connections spread across multiple servers.&lt;/p&gt;

&lt;p&gt;This is called &lt;strong&gt;horizontal scaling&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;But now another challenge appears.&lt;/p&gt;

&lt;p&gt;What if Alice connects to Server A while Bob connects to Server C?&lt;/p&gt;

&lt;p&gt;How does Server C know Alice sent a message?&lt;/p&gt;

&lt;p&gt;The answer is a distributed messaging system.&lt;/p&gt;




&lt;h1&gt;
  
  
  Enter Message Brokers
&lt;/h1&gt;

&lt;p&gt;Systems like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Kafka&lt;/li&gt;
&lt;li&gt;RabbitMQ&lt;/li&gt;
&lt;li&gt;Redis Pub/Sub&lt;/li&gt;
&lt;li&gt;NATS&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;act as communication layers between services.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Alice

↓

Server A

↓

Kafka

↓

Server C

↓

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

&lt;/div&gt;



&lt;p&gt;No matter which server users connect to, every message reaches its destination.&lt;/p&gt;




&lt;h1&gt;
  
  
  Caching: Your Secret Performance Weapon
&lt;/h1&gt;

&lt;p&gt;Databases are slow compared to memory.&lt;/p&gt;

&lt;p&gt;Instead of querying the database repeatedly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Database
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;store frequently accessed data in:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Redis
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Examples include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;User profiles&lt;/li&gt;
&lt;li&gt;Online status&lt;/li&gt;
&lt;li&gt;Session tokens&lt;/li&gt;
&lt;li&gt;Recent chats&lt;/li&gt;
&lt;li&gt;Driver locations&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Caching reduces latency from hundreds of milliseconds to just a few milliseconds.&lt;/p&gt;




&lt;h1&gt;
  
  
  Handling Millions of Concurrent Connections
&lt;/h1&gt;

&lt;p&gt;Keeping millions of WebSockets open requires careful optimization.&lt;/p&gt;

&lt;p&gt;Best practices include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Event-driven servers&lt;/li&gt;
&lt;li&gt;Non-blocking I/O&lt;/li&gt;
&lt;li&gt;Connection pooling&lt;/li&gt;
&lt;li&gt;Heartbeat monitoring&lt;/li&gt;
&lt;li&gt;Idle connection cleanup&lt;/li&gt;
&lt;li&gt;Efficient serialization&lt;/li&gt;
&lt;li&gt;Rate limiting&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Languages commonly used include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go&lt;/li&gt;
&lt;li&gt;Node.js&lt;/li&gt;
&lt;li&gt;Java&lt;/li&gt;
&lt;li&gt;Rust&lt;/li&gt;
&lt;li&gt;Erlang&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each offers different strengths for high-concurrency workloads.&lt;/p&gt;




&lt;h1&gt;
  
  
  Reliability Matters More Than Speed
&lt;/h1&gt;

&lt;p&gt;Real-time systems must also handle failures gracefully.&lt;/p&gt;

&lt;p&gt;Questions every engineer should ask:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What happens if a server crashes?&lt;/li&gt;
&lt;li&gt;How are messages retried?&lt;/li&gt;
&lt;li&gt;Can duplicate messages occur?&lt;/li&gt;
&lt;li&gt;What if a user reconnects?&lt;/li&gt;
&lt;li&gt;How are offline users synchronized?&lt;/li&gt;
&lt;li&gt;What happens during network partitions?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Building a system that recovers automatically is often more valuable than making it slightly faster.&lt;/p&gt;




&lt;h1&gt;
  
  
  Monitoring Is Non-Negotiable
&lt;/h1&gt;

&lt;p&gt;You can't improve what you can't measure.&lt;/p&gt;

&lt;p&gt;Track metrics such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Active WebSocket connections&lt;/li&gt;
&lt;li&gt;API latency&lt;/li&gt;
&lt;li&gt;Error rates&lt;/li&gt;
&lt;li&gt;Queue depth&lt;/li&gt;
&lt;li&gt;Message delivery time&lt;/li&gt;
&lt;li&gt;CPU and memory usage&lt;/li&gt;
&lt;li&gt;Network throughput&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Tools like Prometheus, Grafana, OpenTelemetry, and distributed tracing help identify bottlenecks before users notice them.&lt;/p&gt;




&lt;h1&gt;
  
  
  Common Mistakes Engineers Make
&lt;/h1&gt;

&lt;p&gt;I've seen these issues repeatedly in production systems:&lt;/p&gt;

&lt;p&gt;❌ Using polling instead of WebSockets for real-time features.&lt;/p&gt;

&lt;p&gt;❌ Storing sessions in server memory, making horizontal scaling difficult.&lt;/p&gt;

&lt;p&gt;❌ Querying the database for every incoming message instead of caching.&lt;/p&gt;

&lt;p&gt;❌ Ignoring backpressure, causing queues to grow uncontrollably during traffic spikes.&lt;/p&gt;

&lt;p&gt;❌ Sending oversized JSON payloads when compact formats or selective updates would suffice.&lt;/p&gt;

&lt;p&gt;❌ Skipping monitoring until production issues arise.&lt;/p&gt;

&lt;p&gt;These mistakes may not appear during development but become painfully obvious as traffic grows.&lt;/p&gt;




&lt;h1&gt;
  
  
  A Reference Architecture
&lt;/h1&gt;

&lt;p&gt;A scalable real-time platform often looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;               Clients
                  │
          CDN / Load Balancer
                  │
          API Gateway / Auth
                  │
      ┌───────────┴───────────┐
      │                       │
 REST APIs             WebSocket Gateway
      │                       │
      └───────────┬───────────┘
                  │
           Message Broker
        (Kafka / RabbitMQ)
                  │
     ┌────────────┼────────────┐
     │            │            │
 Chat Service  Notification  Presence
     │            │            │
     └────────────┼────────────┘
                  │
        Redis Cache + Database
                  │
     Monitoring &amp;amp; Observability
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This architecture separates responsibilities, making the system easier to scale, maintain, and evolve independently.&lt;/p&gt;




&lt;h1&gt;
  
  
  Final Thoughts
&lt;/h1&gt;

&lt;p&gt;Building a real-time application isn't about choosing WebSockets over HTTP or Firebase over a custom backend. It's about designing a system that remains &lt;strong&gt;fast, reliable, and resilient&lt;/strong&gt; as your user base grows.&lt;/p&gt;

&lt;p&gt;Companies like Uber and WhatsApp didn't achieve scale through a single technology. They invested in solid architectural principles: stateless services, message brokers, caching, observability, fault tolerance, and horizontal scalability.&lt;/p&gt;

&lt;p&gt;Whether you're building a chat application, a live dashboard, a collaborative editor, or a ride-sharing platform, the same lesson applies:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Real-time systems aren't built by making servers faster—they're built by designing architectures that distribute work efficiently, recover gracefully from failures, and continue performing under massive scale.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The next time you see a message appear instantly or watch a driver's location move across a map in real time, remember that behind that seamless experience lies a carefully orchestrated ecosystem of WebSockets, distributed services, caches, queues, and APIs—all working together to make "instant" feel effortless.&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>backend</category>
      <category>distributedsystems</category>
      <category>systemdesign</category>
    </item>
    <item>
      <title>Beyond CRUD: Architecting Event-Driven Systems</title>
      <dc:creator>Neweraofcoding</dc:creator>
      <pubDate>Mon, 22 Jun 2026 07:42:45 +0000</pubDate>
      <link>https://dev.to/sunny7899/beyond-crud-architecting-event-driven-systems-4ia5</link>
      <guid>https://dev.to/sunny7899/beyond-crud-architecting-event-driven-systems-4ia5</guid>
      <description>&lt;p&gt;For years, &lt;strong&gt;CRUD (Create, Read, Update, Delete)&lt;/strong&gt; has been the foundation of backend application development. Most business applications revolve around storing, retrieving, updating, and deleting data in relational databases. While CRUD works exceptionally well for many use cases, modern distributed applications demand something more.&lt;/p&gt;

&lt;p&gt;Today's systems power millions of users, process real-time events, integrate with dozens of services, and require resilience even when components fail. This is where &lt;strong&gt;Event-Driven Architecture (EDA)&lt;/strong&gt; changes the game.&lt;/p&gt;

&lt;p&gt;In this session, we'll explore how technologies like &lt;strong&gt;Apache Kafka&lt;/strong&gt;, &lt;strong&gt;Google Cloud Pub/Sub&lt;/strong&gt;, and &lt;strong&gt;Event Sourcing&lt;/strong&gt; help backend engineers build scalable, loosely coupled, and fault-tolerant systems that go far beyond traditional CRUD operations.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why CRUD Isn't Enough
&lt;/h2&gt;

&lt;p&gt;Imagine an e-commerce platform.&lt;/p&gt;

&lt;p&gt;When a customer places an order, several things happen:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Inventory should decrease.&lt;/li&gt;
&lt;li&gt;Payment should be processed.&lt;/li&gt;
&lt;li&gt;Shipping should be scheduled.&lt;/li&gt;
&lt;li&gt;Notification emails should be sent.&lt;/li&gt;
&lt;li&gt;Analytics should capture the purchase.&lt;/li&gt;
&lt;li&gt;Loyalty points should be updated.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In a CRUD-based monolith, a single service often performs all these actions sequentially. As the application grows, this leads to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tight coupling between services&lt;/li&gt;
&lt;li&gt;Complex deployments&lt;/li&gt;
&lt;li&gt;Difficult scaling&lt;/li&gt;
&lt;li&gt;Cascading failures&lt;/li&gt;
&lt;li&gt;Slow feature development&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Every new feature means modifying existing business logic.&lt;/p&gt;

&lt;p&gt;There is a better way.&lt;/p&gt;




&lt;h1&gt;
  
  
  Thinking in Events Instead of Database Operations
&lt;/h1&gt;

&lt;p&gt;An &lt;strong&gt;event&lt;/strong&gt; represents something that has already happened.&lt;/p&gt;

&lt;p&gt;Examples include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;OrderPlaced&lt;/li&gt;
&lt;li&gt;PaymentCompleted&lt;/li&gt;
&lt;li&gt;UserRegistered&lt;/li&gt;
&lt;li&gt;ProductUpdated&lt;/li&gt;
&lt;li&gt;ShipmentDelivered&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead of directly calling every downstream service, an application simply publishes an event.&lt;/p&gt;

&lt;p&gt;Other services subscribe to the events they care about.&lt;/p&gt;

&lt;p&gt;This creates a system where producers and consumers are completely independent.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Customer Places Order

        │
        ▼

 Order Service
        │
 Publishes Event
        │
        ▼

+----------------------+
|   Event Broker       |
+----------------------+
   │      │      │
   ▼      ▼      ▼

Inventory   Payment   Notification
 Service     Service      Service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This simple architectural shift dramatically improves scalability and maintainability.&lt;/p&gt;




&lt;h1&gt;
  
  
  Apache Kafka: The Distributed Event Backbone
&lt;/h1&gt;

&lt;p&gt;Apache Kafka is one of the most widely adopted platforms for event streaming.&lt;/p&gt;

&lt;p&gt;Instead of treating data as rows in a database, Kafka treats everything as an immutable stream of events.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Concepts
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Topics&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Logical channels where events are stored.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;orders
payments
shipments
users
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;Producers&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Applications that publish events.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Order Service
        │
        ▼
Kafka Topic: orders
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;Consumers&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Applications that listen to events.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Inventory Service
Payment Service
Email Service
Analytics Service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each service independently processes the same event.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Kafka Works So Well
&lt;/h2&gt;

&lt;p&gt;Kafka provides:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;High throughput&lt;/li&gt;
&lt;li&gt;Horizontal scalability&lt;/li&gt;
&lt;li&gt;Fault tolerance&lt;/li&gt;
&lt;li&gt;Event replay&lt;/li&gt;
&lt;li&gt;Persistent storage&lt;/li&gt;
&lt;li&gt;Consumer independence&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Unlike traditional message queues, Kafka retains events for configurable periods, allowing systems to replay historical events whenever needed.&lt;/p&gt;




&lt;h1&gt;
  
  
  Google Cloud Pub/Sub
&lt;/h1&gt;

&lt;p&gt;While Kafka often requires infrastructure management, &lt;strong&gt;Google Cloud Pub/Sub&lt;/strong&gt; provides a fully managed messaging service.&lt;/p&gt;

&lt;p&gt;It offers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Automatic scaling&lt;/li&gt;
&lt;li&gt;Serverless architecture&lt;/li&gt;
&lt;li&gt;Global availability&lt;/li&gt;
&lt;li&gt;Push and pull subscriptions&lt;/li&gt;
&lt;li&gt;Integration with cloud-native services&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For organizations already on Google Cloud Platform, Pub/Sub significantly reduces operational overhead while providing reliable event delivery.&lt;/p&gt;




&lt;h1&gt;
  
  
  Event Sourcing: Storing Events Instead of State
&lt;/h1&gt;

&lt;p&gt;Traditional databases only store the current state.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Account Balance = $850
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But how did it become $850?&lt;/p&gt;

&lt;p&gt;That history is lost.&lt;/p&gt;

&lt;p&gt;Event Sourcing takes a completely different approach.&lt;/p&gt;

&lt;p&gt;Instead of storing the latest value, it stores every change.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Account Created
+$1000 Deposit
-$200 Withdrawal
+$50 Cashback

Current Balance = $850
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The application's state is reconstructed by replaying all events.&lt;/p&gt;




&lt;h2&gt;
  
  
  Benefits of Event Sourcing
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Complete Audit Trail
&lt;/h3&gt;

&lt;p&gt;Every business action is permanently recorded.&lt;/p&gt;

&lt;p&gt;Perfect for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Banking&lt;/li&gt;
&lt;li&gt;Healthcare&lt;/li&gt;
&lt;li&gt;Financial systems&lt;/li&gt;
&lt;li&gt;Compliance-heavy applications&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Time Travel
&lt;/h3&gt;

&lt;p&gt;Need to know what the system looked like yesterday?&lt;/p&gt;

&lt;p&gt;Replay events until yesterday.&lt;/p&gt;

&lt;p&gt;Need to investigate a bug?&lt;/p&gt;

&lt;p&gt;Replay historical events.&lt;/p&gt;




&lt;h3&gt;
  
  
  Easy Debugging
&lt;/h3&gt;

&lt;p&gt;Instead of asking:&lt;/p&gt;

&lt;p&gt;"What happened?"&lt;/p&gt;

&lt;p&gt;You already know.&lt;/p&gt;

&lt;p&gt;Every change exists as an event.&lt;/p&gt;




&lt;h3&gt;
  
  
  Multiple Read Models
&lt;/h3&gt;

&lt;p&gt;The same event stream can power different projections:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Customer dashboards&lt;/li&gt;
&lt;li&gt;Reporting databases&lt;/li&gt;
&lt;li&gt;Search indexes&lt;/li&gt;
&lt;li&gt;Analytics platforms&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each optimized for different workloads.&lt;/p&gt;




&lt;h1&gt;
  
  
  The CQRS Pattern
&lt;/h1&gt;

&lt;p&gt;Event-driven systems often pair Event Sourcing with &lt;strong&gt;Command Query Responsibility Segregation (CQRS).&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;CQRS separates:&lt;/p&gt;

&lt;p&gt;Commands&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Create Order
Update User
Cancel Booking
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;from Queries&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Get Order History
Search Products
View Dashboard
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Commands write events.&lt;/p&gt;

&lt;p&gt;Queries read optimized views built from those events.&lt;/p&gt;

&lt;p&gt;This separation allows each side to scale independently.&lt;/p&gt;




&lt;h1&gt;
  
  
  Real-World Example
&lt;/h1&gt;

&lt;p&gt;Consider an online food delivery platform.&lt;/p&gt;

&lt;p&gt;When an order is placed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;OrderPlaced
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This single event triggers:&lt;/p&gt;

&lt;p&gt;Inventory Service&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reserve ingredients&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Payment Service&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Charge customer&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Delivery Service&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Assign rider&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Notification Service&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Send SMS&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Analytics Service&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Update dashboard&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Recommendation Engine&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Learn customer preferences&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No service directly calls another.&lt;/p&gt;

&lt;p&gt;Each reacts independently.&lt;/p&gt;

&lt;p&gt;Adding a new service later doesn't require modifying existing code—simply subscribe to the relevant events.&lt;/p&gt;




&lt;h1&gt;
  
  
  Challenges of Event-Driven Systems
&lt;/h1&gt;

&lt;p&gt;Like any architectural style, event-driven systems introduce their own complexities.&lt;/p&gt;

&lt;h3&gt;
  
  
  Eventual Consistency
&lt;/h3&gt;

&lt;p&gt;Data isn't instantly synchronized across services.&lt;/p&gt;

&lt;p&gt;Developers must design systems that tolerate temporary inconsistencies.&lt;/p&gt;




&lt;h3&gt;
  
  
  Duplicate Events
&lt;/h3&gt;

&lt;p&gt;Consumers may receive the same event multiple times.&lt;/p&gt;

&lt;p&gt;Services should be idempotent so processing an event twice doesn't produce incorrect results.&lt;/p&gt;




&lt;h3&gt;
  
  
  Ordering
&lt;/h3&gt;

&lt;p&gt;In distributed systems, events may arrive out of sequence.&lt;/p&gt;

&lt;p&gt;Proper partitioning and ordering strategies are critical.&lt;/p&gt;




&lt;h3&gt;
  
  
  Observability
&lt;/h3&gt;

&lt;p&gt;Tracking a request across multiple services becomes more difficult.&lt;/p&gt;

&lt;p&gt;Distributed tracing tools such as OpenTelemetry, Jaeger, and Zipkin become essential.&lt;/p&gt;




&lt;h1&gt;
  
  
  Best Practices
&lt;/h1&gt;

&lt;p&gt;When designing event-driven systems:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Design immutable events.&lt;/li&gt;
&lt;li&gt;Version event schemas carefully.&lt;/li&gt;
&lt;li&gt;Keep events business-focused.&lt;/li&gt;
&lt;li&gt;Build idempotent consumers.&lt;/li&gt;
&lt;li&gt;Avoid excessive event chaining.&lt;/li&gt;
&lt;li&gt;Monitor consumer lag.&lt;/li&gt;
&lt;li&gt;Use dead-letter queues for failures.&lt;/li&gt;
&lt;li&gt;Document event contracts clearly.&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  When Should You Use Event-Driven Architecture?
&lt;/h1&gt;

&lt;p&gt;EDA shines when building:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Microservices&lt;/li&gt;
&lt;li&gt;Real-time analytics&lt;/li&gt;
&lt;li&gt;IoT platforms&lt;/li&gt;
&lt;li&gt;Financial systems&lt;/li&gt;
&lt;li&gt;E-commerce platforms&lt;/li&gt;
&lt;li&gt;Logistics applications&lt;/li&gt;
&lt;li&gt;Streaming platforms&lt;/li&gt;
&lt;li&gt;High-scale SaaS products&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For simple CRUD applications, a relational database may still be the best choice. Event-driven architecture is most valuable when systems require scalability, resilience, and asynchronous communication.&lt;/p&gt;




&lt;h1&gt;
  
  
  Final Thoughts
&lt;/h1&gt;

&lt;p&gt;CRUD isn't obsolete—it remains a fundamental building block for countless applications. However, as systems grow in complexity and scale, relying solely on synchronous database operations can become a bottleneck.&lt;/p&gt;

&lt;p&gt;Event-driven architecture introduces a new mindset: instead of asking &lt;em&gt;"How do I update the database?"&lt;/em&gt;, ask &lt;em&gt;"What business event just occurred?"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Technologies like &lt;strong&gt;Apache Kafka&lt;/strong&gt;, &lt;strong&gt;Google Cloud Pub/Sub&lt;/strong&gt;, and &lt;strong&gt;Event Sourcing&lt;/strong&gt; empower backend engineers to build systems that are more scalable, resilient, and adaptable to change.&lt;/p&gt;

&lt;p&gt;The future of backend engineering isn't just about managing data—it's about designing systems that react to events, evolve independently, and thrive in distributed environments.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Because modern software isn't just CRUD anymore—it's a continuous stream of meaningful events.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>backend</category>
      <category>distributedsystems</category>
      <category>systemdesign</category>
    </item>
    <item>
      <title>Hacking the Cloud: What Every Engineer Should Know About Cloud Security</title>
      <dc:creator>Neweraofcoding</dc:creator>
      <pubDate>Thu, 04 Jun 2026 14:29:08 +0000</pubDate>
      <link>https://dev.to/sunny7899/hacking-the-cloud-what-every-engineer-should-know-about-cloud-security-bnh</link>
      <guid>https://dev.to/sunny7899/hacking-the-cloud-what-every-engineer-should-know-about-cloud-security-bnh</guid>
      <description>&lt;p&gt;Cloud computing has transformed how organizations build, deploy, and scale applications. From startups launching their first products to global enterprises managing millions of users, cloud platforms provide unprecedented flexibility and speed.&lt;/p&gt;

&lt;p&gt;However, with great convenience comes great responsibility.&lt;/p&gt;

&lt;p&gt;Contrary to popular belief, moving workloads to the cloud does not automatically make them secure. In fact, many of the largest cloud security incidents in recent years were caused not by sophisticated hackers exploiting zero-day vulnerabilities, but by simple misconfigurations, excessive permissions, and overlooked security controls.&lt;/p&gt;

&lt;p&gt;As organizations continue their cloud journey, every engineer—not just security professionals—must understand the fundamentals of cloud security.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Shared Responsibility Model
&lt;/h2&gt;

&lt;p&gt;One of the biggest misconceptions about cloud security is assuming that the cloud provider handles everything.&lt;/p&gt;

&lt;p&gt;Major providers such as Amazon Web Services (AWS), Microsoft Azure, and Google Cloud Platform (GCP) operate under a shared responsibility model.&lt;/p&gt;

&lt;p&gt;The cloud provider is responsible for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Physical data center security&lt;/li&gt;
&lt;li&gt;Hardware and networking infrastructure&lt;/li&gt;
&lt;li&gt;Managed service availability&lt;/li&gt;
&lt;li&gt;Hypervisor and platform security&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Customers are responsible for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Identity and access management&lt;/li&gt;
&lt;li&gt;Application security&lt;/li&gt;
&lt;li&gt;Data protection&lt;/li&gt;
&lt;li&gt;Network configurations&lt;/li&gt;
&lt;li&gt;Operating system security (for self-managed workloads)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A cloud provider secures the cloud, but customers must secure what they put in the cloud.&lt;/p&gt;

&lt;h2&gt;
  
  
  Real-World Cloud Vulnerabilities
&lt;/h2&gt;

&lt;p&gt;Let's examine some of the most common cloud security issues that attackers exploit.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Misconfigured Storage Buckets
&lt;/h3&gt;

&lt;p&gt;One of the most frequent causes of cloud data breaches is publicly accessible storage.&lt;/p&gt;

&lt;p&gt;Engineers often create storage buckets for testing or temporary file sharing and accidentally leave them exposed to the internet.&lt;/p&gt;

&lt;p&gt;Common mistakes include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Public read permissions&lt;/li&gt;
&lt;li&gt;Public write permissions&lt;/li&gt;
&lt;li&gt;Missing encryption policies&lt;/li&gt;
&lt;li&gt;Lack of access logging&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Attackers continuously scan cloud environments searching for exposed storage containing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Customer records&lt;/li&gt;
&lt;li&gt;Source code&lt;/li&gt;
&lt;li&gt;API keys&lt;/li&gt;
&lt;li&gt;Internal documents&lt;/li&gt;
&lt;li&gt;Database backups&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A single misconfigured bucket can expose millions of sensitive records.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Overly Permissive IAM Roles
&lt;/h3&gt;

&lt;p&gt;Identity and Access Management (IAM) is the backbone of cloud security.&lt;/p&gt;

&lt;p&gt;Unfortunately, many organizations grant broad permissions simply because it is faster than implementing least-privilege access.&lt;/p&gt;

&lt;p&gt;Examples include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Using administrator privileges for applications&lt;/li&gt;
&lt;li&gt;Sharing service accounts across environments&lt;/li&gt;
&lt;li&gt;Granting wildcard permissions (*)&lt;/li&gt;
&lt;li&gt;Long-lived credentials without rotation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If attackers compromise a single account with excessive permissions, they may gain access to an entire cloud environment.&lt;/p&gt;

&lt;p&gt;The principle of least privilege should always be the default approach.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Exposed Secrets and Credentials
&lt;/h3&gt;

&lt;p&gt;Cloud environments rely heavily on secrets such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;API keys&lt;/li&gt;
&lt;li&gt;Database passwords&lt;/li&gt;
&lt;li&gt;SSH keys&lt;/li&gt;
&lt;li&gt;OAuth tokens&lt;/li&gt;
&lt;li&gt;Service account credentials&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A common mistake is storing these secrets in:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Git repositories&lt;/li&gt;
&lt;li&gt;Container images&lt;/li&gt;
&lt;li&gt;Configuration files&lt;/li&gt;
&lt;li&gt;CI/CD pipelines&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Attackers frequently scan public repositories for exposed credentials. Once discovered, they can use those credentials to move laterally across cloud systems.&lt;/p&gt;

&lt;p&gt;Engineers should leverage dedicated secret management services and implement automatic credential rotation whenever possible.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Insecure Containers and Kubernetes Deployments
&lt;/h3&gt;

&lt;p&gt;Containers have become the standard deployment model for modern applications, but they introduce unique security challenges.&lt;/p&gt;

&lt;p&gt;Common vulnerabilities include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Running containers as root&lt;/li&gt;
&lt;li&gt;Using outdated base images&lt;/li&gt;
&lt;li&gt;Exposing management interfaces&lt;/li&gt;
&lt;li&gt;Weak Kubernetes RBAC policies&lt;/li&gt;
&lt;li&gt;Unrestricted pod communication&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A vulnerable container can become an entry point into a larger cloud environment.&lt;/p&gt;

&lt;p&gt;Security scanning should be integrated into every container build process.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Unpatched Cloud Workloads
&lt;/h3&gt;

&lt;p&gt;While cloud providers maintain infrastructure security, customers remain responsible for patching operating systems and applications running on virtual machines.&lt;/p&gt;

&lt;p&gt;Attackers actively exploit:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Unpatched Linux servers&lt;/li&gt;
&lt;li&gt;Outdated web frameworks&lt;/li&gt;
&lt;li&gt;Legacy software components&lt;/li&gt;
&lt;li&gt;Known CVEs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Automated patch management and vulnerability scanning are essential components of cloud security.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Rise of Cloud-Native Attacks
&lt;/h2&gt;

&lt;p&gt;Modern attackers no longer focus solely on traditional network attacks.&lt;/p&gt;

&lt;p&gt;Today's threat actors target cloud-native resources such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Kubernetes clusters&lt;/li&gt;
&lt;li&gt;Serverless functions&lt;/li&gt;
&lt;li&gt;Cloud APIs&lt;/li&gt;
&lt;li&gt;CI/CD pipelines&lt;/li&gt;
&lt;li&gt;Infrastructure-as-Code repositories&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, an attacker who gains access to a poorly secured CI/CD pipeline may inject malicious code into production systems without ever touching a server.&lt;/p&gt;

&lt;p&gt;This shift requires engineers to think beyond firewalls and embrace security throughout the software delivery lifecycle.&lt;/p&gt;

&lt;h2&gt;
  
  
  Security Misconfigurations Engineers Should Watch For
&lt;/h2&gt;

&lt;p&gt;During cloud security assessments, the following issues appear repeatedly:&lt;/p&gt;

&lt;h3&gt;
  
  
  Networking
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Open security groups&lt;/li&gt;
&lt;li&gt;Publicly accessible databases&lt;/li&gt;
&lt;li&gt;Unrestricted inbound traffic&lt;/li&gt;
&lt;li&gt;Flat network architectures&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Identity
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Shared accounts&lt;/li&gt;
&lt;li&gt;Excessive privileges&lt;/li&gt;
&lt;li&gt;Lack of multi-factor authentication&lt;/li&gt;
&lt;li&gt;Dormant accounts&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Data Protection
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Unencrypted storage&lt;/li&gt;
&lt;li&gt;Missing backup policies&lt;/li&gt;
&lt;li&gt;Weak key management&lt;/li&gt;
&lt;li&gt;Lack of data classification&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Monitoring
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Disabled audit logs&lt;/li&gt;
&lt;li&gt;Insufficient alerting&lt;/li&gt;
&lt;li&gt;Missing threat detection&lt;/li&gt;
&lt;li&gt;Incomplete visibility across cloud accounts&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Most cloud breaches occur because these basic controls were overlooked.&lt;/p&gt;

&lt;h2&gt;
  
  
  Building a Secure Cloud Environment
&lt;/h2&gt;

&lt;p&gt;Security should be integrated from the beginning rather than added later.&lt;/p&gt;

&lt;h3&gt;
  
  
  Adopt Infrastructure as Code
&lt;/h3&gt;

&lt;p&gt;Tools like Terraform and CloudFormation allow organizations to define infrastructure consistently and securely.&lt;/p&gt;

&lt;p&gt;Benefits include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Repeatable deployments&lt;/li&gt;
&lt;li&gt;Version-controlled infrastructure&lt;/li&gt;
&lt;li&gt;Automated security checks&lt;/li&gt;
&lt;li&gt;Reduced configuration drift&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Implement Zero Trust Principles
&lt;/h3&gt;

&lt;p&gt;Never assume trust based on network location.&lt;/p&gt;

&lt;p&gt;Instead:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Verify every identity&lt;/li&gt;
&lt;li&gt;Authenticate every request&lt;/li&gt;
&lt;li&gt;Continuously validate access&lt;/li&gt;
&lt;li&gt;Restrict permissions aggressively&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Enable Continuous Monitoring
&lt;/h3&gt;

&lt;p&gt;Cloud environments change constantly.&lt;/p&gt;

&lt;p&gt;Security teams should continuously monitor:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Access patterns&lt;/li&gt;
&lt;li&gt;Configuration changes&lt;/li&gt;
&lt;li&gt;Privilege escalations&lt;/li&gt;
&lt;li&gt;Suspicious API activity&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The faster anomalies are detected, the faster they can be contained.&lt;/p&gt;

&lt;h3&gt;
  
  
  Secure the CI/CD Pipeline
&lt;/h3&gt;

&lt;p&gt;Your deployment pipeline is one of the most valuable targets for attackers.&lt;/p&gt;

&lt;p&gt;Protect it through:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Strong authentication&lt;/li&gt;
&lt;li&gt;Signed artifacts&lt;/li&gt;
&lt;li&gt;Secret scanning&lt;/li&gt;
&lt;li&gt;Dependency scanning&lt;/li&gt;
&lt;li&gt;Role separation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A secure application cannot be built from an insecure pipeline.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Future of Cloud Security
&lt;/h2&gt;

&lt;p&gt;Cloud adoption continues to accelerate, and attackers are evolving just as quickly.&lt;/p&gt;

&lt;p&gt;Emerging trends include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AI-driven threat detection&lt;/li&gt;
&lt;li&gt;Automated security remediation&lt;/li&gt;
&lt;li&gt;Cloud Security Posture Management (CSPM)&lt;/li&gt;
&lt;li&gt;Container runtime protection&lt;/li&gt;
&lt;li&gt;Supply chain security validation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Organizations that treat security as a continuous engineering practice rather than a compliance exercise will be better positioned to defend against future threats.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Cloud platforms provide incredible opportunities for innovation, but they also expand the attack surface in ways many organizations underestimate.&lt;/p&gt;

&lt;p&gt;The majority of cloud breaches do not occur because hackers are exceptionally clever. They happen because basic security principles were ignored: excessive permissions, exposed credentials, misconfigured storage, and inadequate monitoring.&lt;/p&gt;

&lt;p&gt;Every engineer who deploys cloud workloads influences an organization's security posture. Understanding common vulnerabilities, adopting secure-by-design practices, and continuously validating configurations are no longer optional skills—they are essential responsibilities.&lt;/p&gt;

&lt;p&gt;In the cloud, security is not a feature. It is an engineering discipline.&lt;/p&gt;

</description>
      <category>cloud</category>
      <category>cloudcomputing</category>
      <category>cybersecurity</category>
      <category>security</category>
    </item>
    <item>
      <title>Getting Started with Unit Testing in a Node.js Project with Jest</title>
      <dc:creator>Neweraofcoding</dc:creator>
      <pubDate>Sun, 03 May 2026 12:55:51 +0000</pubDate>
      <link>https://dev.to/sunny7899/getting-started-with-unit-testing-in-a-nodejs-project-with-jest-3afh</link>
      <guid>https://dev.to/sunny7899/getting-started-with-unit-testing-in-a-nodejs-project-with-jest-3afh</guid>
      <description>&lt;p&gt;When building backend applications with Node.js, most developers focus heavily on APIs, databases, and business logic—but often skip testing until bugs start showing up.&lt;/p&gt;

&lt;p&gt;Unit testing helps you catch bugs early, improve code quality, and refactor with confidence.&lt;/p&gt;

&lt;p&gt;In this blog, we’ll learn how to set up unit testing in a Node.js + TypeScript project using Jest.&lt;/p&gt;




&lt;h2&gt;
  
  
  What is Unit Testing?
&lt;/h2&gt;

&lt;p&gt;Unit testing means testing small isolated pieces of code (functions, services, controllers) to verify they work as expected.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;Instead of testing the full API flow:&lt;/p&gt;

&lt;p&gt;Client → Route → Controller → Database&lt;/p&gt;

&lt;p&gt;We test only:&lt;/p&gt;

&lt;p&gt;Function → Input → Expected Output&lt;/p&gt;

&lt;p&gt;This makes debugging faster and easier.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Use Jest?
&lt;/h2&gt;

&lt;p&gt;Jest is one of the most popular testing frameworks because it provides:&lt;/p&gt;

&lt;p&gt;✅ Zero-config setup&lt;br&gt;
✅ Fast execution&lt;br&gt;
✅ Mocking support&lt;br&gt;
✅ Built-in assertions&lt;br&gt;
✅ TypeScript support&lt;br&gt;
✅ Code coverage reports&lt;/p&gt;


&lt;h2&gt;
  
  
  Step 1: Create a Node.js Project
&lt;/h2&gt;

&lt;p&gt;Initialize a project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm init &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Install TypeScript:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;typescript ts-node @types/node &lt;span class="nt"&gt;-D&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Initialize TypeScript config:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx tsc &lt;span class="nt"&gt;--init&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Step 2: Install Jest
&lt;/h2&gt;

&lt;p&gt;Install Jest and TypeScript support:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;jest ts-jest @types/jest &lt;span class="nt"&gt;-D&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Initialize Jest config:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx ts-jest config:init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This creates:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;jest.config.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Step 3: Configure TypeScript
&lt;/h2&gt;

&lt;p&gt;Update &lt;code&gt;tsconfig.json&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"compilerOptions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"target"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"ES2020"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"module"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"commonjs"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"esModuleInterop"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"strict"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Important settings:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;target&lt;/code&gt; → JavaScript version output&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;module&lt;/code&gt; → module system&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;esModuleInterop&lt;/code&gt; → better import compatibility&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Step 4: Create Sample Code
&lt;/h2&gt;

&lt;p&gt;Project structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;src/
 ├── controllers/
 │   └── itemController.ts
 ├── models/
 │   └── item.ts
tests/
 └── itemController.test.ts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create model:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// src/models/item.ts&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create controller:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// src/controllers/itemController.ts&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Response&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;express&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;items&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../models/item&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;getItems&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Response&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;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;items&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Step 5: Write Your First Test
&lt;/h2&gt;

&lt;p&gt;Create:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// tests/itemController.test.ts&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Response&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;express&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;getItems&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../src/controllers/itemController&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;items&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../src/models/item&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nf"&gt;describe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Item Controller&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="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;should return empty array&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="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;req&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;json&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;jest&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fn&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;unknown&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;Response&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="nx"&gt;items&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="nf"&gt;getItems&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;json&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toHaveBeenCalledWith&lt;/span&gt;&lt;span class="p"&gt;([]);&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Understanding the Test
&lt;/h2&gt;

&lt;h3&gt;
  
  
  describe()
&lt;/h3&gt;

&lt;p&gt;Groups related tests.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nf"&gt;describe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Item Controller&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="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  it()
&lt;/h3&gt;

&lt;p&gt;Defines a single test case.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nf"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;should return empty array&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="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  jest.fn()
&lt;/h3&gt;

&lt;p&gt;Creates a mock function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;json&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;jest&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fn&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Useful for checking:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;was it called?&lt;/li&gt;
&lt;li&gt;how many times?&lt;/li&gt;
&lt;li&gt;what arguments?&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  expect()
&lt;/h3&gt;

&lt;p&gt;Assertion API.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;json&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toHaveBeenCalledWith&lt;/span&gt;&lt;span class="p"&gt;([]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verifies output.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 6: Add Test Script
&lt;/h2&gt;

&lt;p&gt;Update &lt;code&gt;package.json&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"scripts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"test"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"jest"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run tests:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;test&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;PASS tests/itemController.test.ts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Common Jest Matchers
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Check equality
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toBe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Check object equality
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toEqual&lt;/span&gt;&lt;span class="p"&gt;({});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Check if function was called
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;mockFn&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toHaveBeenCalled&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Check call count
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;mockFn&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toHaveBeenCalledTimes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Mocking Dependencies
&lt;/h2&gt;

&lt;p&gt;Suppose your controller calls a service:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;getData&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./service&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;Mock it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;jest&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;mock&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./service&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;Set return value:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;getData&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;jest&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Mock&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;mockReturnValue&lt;/span&gt;&lt;span class="p"&gt;([]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This isolates your unit.&lt;/p&gt;




&lt;h2&gt;
  
  
  Running Coverage
&lt;/h2&gt;

&lt;p&gt;Generate coverage report:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;test&lt;/span&gt; &lt;span class="nt"&gt;--&lt;/span&gt; &lt;span class="nt"&gt;--coverage&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Statements   : 95%
Branches     : 90%
Functions    : 100%
Lines        : 96%
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Aim for good coverage, not just high numbers.&lt;/p&gt;




&lt;h2&gt;
  
  
  Best Practices
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Keep tests isolated
&lt;/h3&gt;

&lt;p&gt;Each test should run independently.&lt;/p&gt;




&lt;h3&gt;
  
  
  Mock external dependencies
&lt;/h3&gt;

&lt;p&gt;Avoid hitting real databases or APIs.&lt;/p&gt;




&lt;h3&gt;
  
  
  Use descriptive test names
&lt;/h3&gt;

&lt;p&gt;Good:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;should&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;empty&lt;/span&gt; &lt;span class="nx"&gt;items&lt;/span&gt; &lt;span class="nx"&gt;array&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Bad:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;test&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Follow AAA Pattern
&lt;/h3&gt;

&lt;p&gt;Arrange → Act → Assert&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Arrange&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;req&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{};&lt;/span&gt;

&lt;span class="c1"&gt;// Act&lt;/span&gt;
&lt;span class="nf"&gt;getItems&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Assert&lt;/span&gt;
&lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;json&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toHaveBeenCalled&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Unit testing is not optional in production-grade applications.&lt;/p&gt;

&lt;p&gt;With Jest, getting started is simple:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install Jest&lt;/li&gt;
&lt;li&gt;Configure TypeScript&lt;/li&gt;
&lt;li&gt;Write tests&lt;/li&gt;
&lt;li&gt;Mock dependencies&lt;/li&gt;
&lt;li&gt;Run coverage&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Start small.&lt;/p&gt;

&lt;p&gt;Test one controller.&lt;/p&gt;

&lt;p&gt;Then one service.&lt;/p&gt;

&lt;p&gt;Then one utility.&lt;/p&gt;

&lt;p&gt;Over time, your project becomes safer, cleaner, and easier to maintain.&lt;/p&gt;

&lt;p&gt;Your future self will thank you.&lt;/p&gt;

</description>
      <category>webdev</category>
    </item>
  </channel>
</rss>
