<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Waqar Hussain on Medium]]></title>
        <description><![CDATA[Stories by Waqar Hussain on Medium]]></description>
        <link>https://medium.com/@waqar105lgu.edu?source=rss-3f87dafa6426------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*jJZvrHdWmFyfBQAKlBkonw.png</url>
            <title>Stories by Waqar Hussain on Medium</title>
            <link>https://medium.com/@waqar105lgu.edu?source=rss-3f87dafa6426------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 02:59:56 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@waqar105lgu.edu/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[ Why middleware.ts is one of the most underrated files in Next.js]]></title>
            <link>https://medium.com/@waqar105lgu.edu/why-middleware-ts-is-one-of-the-most-underrated-files-in-next-js-131524e2e931?source=rss-3f87dafa6426------2</link>
            <guid isPermaLink="false">https://medium.com/p/131524e2e931</guid>
            <category><![CDATA[middleware]]></category>
            <category><![CDATA[clean-architecture]]></category>
            <category><![CDATA[nextjs-tutorial]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[optimization]]></category>
            <dc:creator><![CDATA[Waqar Hussain]]></dc:creator>
            <pubDate>Tue, 19 May 2026 08:21:58 GMT</pubDate>
            <atom:updated>2026-05-19T08:21:58.567Z</atom:updated>
            <content:encoded><![CDATA[<p>Most Next.js apps check authentication in five different places. There’s a better way.</p><p><strong>The problem no one talks about:</strong></p><p>When you start a Next.js project, protecting routes feels simple.</p><p>You add a session check to your:</p><ul><li>dashboard page</li><li>profile page</li><li>settings page</li></ul><p>Before long, you have auth <strong>logic scattered across your entire codebase</strong> - all doing the same thing, all slightly differently.</p><p>The <strong>problems </strong>compound quickly:</p><ul><li>client-side redirects can be bypassed</li><li>forgetting one page creates a security gap</li><li>changing requirements means updating a dozen files</li></ul><p>middleware.ts was built to solve exactly this.</p><p>🧠<strong>What does middleware actually do?</strong></p><p>Think of middleware.ts as a <strong>gatekeeper</strong> that sits between every incoming request and your application.</p><p>Before any page loads or any API route runs, the middleware <strong>executes first</strong>.</p><p>From there, you can:</p><ul><li>allow the request</li><li>redirect the user</li><li>block access entirely</li></ul><p>Instead of handling logic separately across pages or APIs, middleware <strong>centralises </strong>request handling in a single place.</p><p>💻 <strong>Practical Example</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gkdfUHiKtNArTzMzfo-73A.png" /></figure><p>The matcher config is key - it tells Next.js exactly which routes your middleware should intercept. This keeps performance clean and avoids running auth logic on public pages.</p><p>🔐 <strong>Working with NextAuth</strong></p><p>If you’re already using NextAuth, middleware integrates naturally.</p><p>Instead of checking session state inside each individual page component, you <strong>centralise</strong> that logic in one file.</p><p>The middleware runs first, and unauthenticated users never reach your protected routes at all.</p><p>⚡ <strong>What does “running at the edge” mean?</strong></p><p>You’ll often hear that middleware runs “at the edge.”</p><p>In practice, this means the request is intercepted and evaluated before it reaches your actual application server, making route protection faster and more efficient.</p><p>This is one of the reasons middleware works so well for:</p><ul><li>authentication</li><li>redirects</li><li>request filtering</li><li>access control</li></ul><p>🏗️ <strong>Why this matters for your architecture</strong></p><p>The real value of middleware.ts isn’t just convenience - it’s <strong>clarity</strong>.</p><p>When route protection lives in <strong>one place</strong>, it becomes:</p><ul><li>easier to reason about</li><li>easier to audit</li><li>much harder to miss</li></ul><p><strong>Good architecture is often about centralising decisions.</strong></p><p>One file. One place. Every request, every time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=131524e2e931" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ I stopped creating API routes for simple forms in Next.js]]></title>
            <link>https://medium.com/@waqar105lgu.edu/i-stopped-creating-api-routes-for-simple-forms-in-next-js-5dacf5d31ff1?source=rss-3f87dafa6426------2</link>
            <guid isPermaLink="false">https://medium.com/p/5dacf5d31ff1</guid>
            <category><![CDATA[nextjs-tutorial]]></category>
            <category><![CDATA[nextjs-server-action]]></category>
            <category><![CDATA[performance-optimization]]></category>
            <category><![CDATA[mern-stack-development]]></category>
            <category><![CDATA[nextjs]]></category>
            <dc:creator><![CDATA[Waqar Hussain]]></dc:creator>
            <pubDate>Fri, 15 May 2026 11:20:53 GMT</pubDate>
            <atom:updated>2026-05-15T11:20:53.055Z</atom:updated>
            <content:encoded><![CDATA[<p>And honestly, <strong>Server Actions</strong> are a big reason why.</p><p><strong>Before </strong>Server Actions, even a basic form submission usually required:</p><ul><li>A frontend form</li><li>A separate API route</li><li>A fetch() request</li><li>Request parsing</li><li>Loading/error handling</li><li>Validation in multiple places</li></ul><p>For something as simple as creating a user or updating a profile, this often felt like <strong>unnecessary boilerplate</strong>.</p><p>Example flow <strong>before Server Actions</strong>:</p><pre>Form → fetch() → API Route → Database</pre><p><strong>Now with Server Actions</strong>, the flow becomes:</p><pre>Form → Server Function → Database</pre><p>That’s a huge simplification for many internal app features.</p><p>💻 <strong>Here’s a simple example:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*xexBGVF_U9y96qhQfBE1pA.png" /></figure><p>✅ No custom API endpoint.<br>✅ No manual fetch().<br>✅ Less code to maintain.</p><p>What I like about Server Actions is that they encourage a <strong>cleaner, server-first architecture</strong> rather than turning every interaction into an API call.</p><p>That said, <strong>I don’t think they completely replace APIs</strong>.</p><p>If you’re building:</p><ul><li>public APIs</li><li>mobile backends</li><li>third-party integrations</li></ul><p>…traditional API routes still make <strong>perfect sense</strong>.</p><p>But for <strong>internal </strong>mutations?<br>Server Actions can <strong>remove a surprising amount of complexity</strong> from your Next.js apps.</p><p>Are you using Server Actions yet, or still sticking with API routes?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5dacf5d31ff1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Your API is slow because you’re waiting… unnecessarily.]]></title>
            <link>https://medium.com/@waqar105lgu.edu/your-api-is-slow-because-youre-waiting-unnecessarily-fdd3ce47c5d4?source=rss-3f87dafa6426------2</link>
            <guid isPermaLink="false">https://medium.com/p/fdd3ce47c5d4</guid>
            <category><![CDATA[performance-optimization]]></category>
            <category><![CDATA[javascript-tips]]></category>
            <category><![CDATA[promises-in-javascript]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Waqar Hussain]]></dc:creator>
            <pubDate>Tue, 12 May 2026 13:59:04 GMT</pubDate>
            <atom:updated>2026-05-12T13:59:04.239Z</atom:updated>
            <content:encoded><![CDATA[<p>Ever wondered why your API feels slow even when each service call is “fast”?</p><p>Most backend developers still do this:</p><p>👉 Run async calls <strong>one by one</strong></p><p>When they could run them <strong>in parallel</strong>.</p><p>Let’s fix that using one of the simplest yet most powerful JavaScript tools: <strong>Promise.all()</strong></p><p>⚡ <strong>What is </strong><strong>Promise.all()?</strong></p><p>It runs multiple async operations <strong>in parallel</strong> and waits for all to finish.</p><p>Instead of waiting for each promise individually, it runs them in parallel and waits for all to complete.</p><blockquote><em>💡</em> <strong><em>Why it matters?</em></strong></blockquote><ul><li>🚀 Faster API response time</li><li>⚡ Parallel execution of independent services</li><li>📉 Reduced latency in backend workflows</li><li>🧠 Cleaner and more readable async code</li></ul><p>💡 <strong>Use it when:</strong></p><ul><li>Multiple independent DB calls</li><li>Calling external APIs</li><li>Fetching dashboard data</li><li>Aggregating service responses</li></ul><p>🧾 <strong>Real World Example</strong></p><p>Let’s say we are building a transaction service.</p><p>We need to fetch the <strong>User</strong> and <strong>Category</strong></p><p>Then create a transaction with amount, type, date, userId, categoryId</p><p>❌ <strong>Before </strong><strong>Promise.all() (Sequential — Slow Execution)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o1tSbxvVixLK98FDj6Iv2w.png" /></figure><blockquote>⛔ <strong><em>Problem</em></strong>:</blockquote><ul><li>userService.findById() waits first</li><li>then categoryService.findById() starts</li><li><strong>total time = sum of both calls</strong></li></ul><p>✅ <strong>After </strong><strong>Promise.all() (Parallel — Fast Execution)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YYgqkLEE3ANmztrfu8x2Sg.png" /></figure><p>Even with just 2 calls, you reduce latency significantly. Imagine the impact with 5–10 service calls.</p><p>💭 <strong>Final Thought</strong></p><p>Most backend performance issues aren’t about heavy computation…</p><p>They’re about <strong>unnecessary waiting.</strong></p><p>And Promise.all() is one of the easiest wins you can implement today.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fdd3ce47c5d4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Stop Managing Auth Manually — NextAuth Already Solved It (Next.js)]]></title>
            <link>https://medium.com/@waqar105lgu.edu/stop-managing-auth-manually-nextauth-already-solved-it-next-js-6b73a3c942d9?source=rss-3f87dafa6426------2</link>
            <guid isPermaLink="false">https://medium.com/p/6b73a3c942d9</guid>
            <category><![CDATA[authentication]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[nextauth]]></category>
            <category><![CDATA[nextjs-app-router]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Waqar Hussain]]></dc:creator>
            <pubDate>Wed, 22 Apr 2026 08:42:08 GMT</pubDate>
            <atom:updated>2026-04-22T08:42:08.734Z</atom:updated>
            <content:encoded><![CDATA[<p>Most Next.js devs are solving auth the hard way. Here’s the better approach. 🧵</p><p>Tools like Redux store state on the <strong>CLIENT</strong>. But Next.js App Router is built around <strong>SERVER components</strong>. These two worlds don’t naturally talk — so developers end up converting everything &quot;use client&quot; just to answer one simple question: &quot;who is logged in?&quot;</p><p>Every time I needed the logged-in user’s data, I’d slap &quot;use client&quot;at the top of the page.</p><p>Dashboard? Client component.<br>Profile page? Client component.<br>Navbar with user avatar? Client component.</p><blockquote><em>My </em><strong><em>Server Components</em></strong><em> app was basically a </em><strong><em>React SPA</em></strong><em> in disguise. All that SSR performance? </em><strong><em>Gone</em></strong><em>.</em></blockquote><p>😤 The painful reality of auth <strong>without NextAuth</strong>:</p><p>❌ You store user state in Redux or Context<br>❌ Redux lives on the client — so every page that needs the user becomes a Client Component<br>❌ You lose Server Component benefits: SSR, direct DB access, no hydration cost<br>❌ Pages flicker while user data loads from a `/api/me` endpoint<br>❌ You write custom auth guards in every layout and route</p><p>This is the trap: Next.js App Router is designed around Server Components. Auth state stored on the client forces you to <strong>abandon that architecture</strong> entirely.</p><p>🧠 <strong>NextAuth (Auth.js)</strong></p><p>NextAuth is a complete authentication solution built for Next.js that works <strong>natively with server + client components</strong>.</p><p>⚡ <strong>Why it’s a big deal</strong></p><p>✅ Get current user on the <strong>server (no extra API call)</strong></p><p>✅ Also, access it on the <strong>client when needed</strong></p><p>✅ No need for &quot;use client&quot;<strong> just for auth</strong></p><p>✅ Centralized auth logic</p><p>✅ Secure session handling (JWT / DB sessions)</p><p>✅ 40+ <strong>OAuth providers</strong> (Google, GitHub, Discord…) out of the box</p><p>🔥 <strong>The Real Upgrade</strong></p><p>Instead of:</p><blockquote><em>“Let’s fetch and store the user globally”</em></blockquote><p>You switch to:</p><blockquote><em>“Let’s ask for the session wherever we are”</em></blockquote><p>That’s a <strong>clean, scalable pattern</strong>.</p><p>🔐 <strong>Route Protection (This is where it gets powerful)</strong></p><p>With NextAuth, you don’t just protect UI…</p><p>You protect routes at the <strong>framework level</strong>.</p><p><strong>Protect routes using</strong> proxy.ts</p><pre>export { auth as middleware } from &quot;@/auth&quot;;<br><br>export const config = {<br>  matcher: [&quot;/dashboard/:path*&quot;, &quot;/profile&quot;],<br>};</pre><p>🔍 <strong>What this does</strong></p><ul><li>Any route matching /dashboard or /profile</li><li>Automatically checks the session</li><li>Redirects unauthenticated users</li></ul><p>✅ No manual checks inside every component<br>✅ No client-side hacks<br>✅ Centralized protection</p><p>🧠 <strong>Why this is better than client-side guards</strong></p><p>Client-side protection:</p><ul><li>Runs <strong>after page loads</strong></li><li>Can expose sensitive data briefly</li></ul><p>NextAuth middleware:</p><ul><li>Runs <strong>before the response is sent</strong></li><li>Fully secure at the request level</li></ul><p>💻 <strong>Practical Example</strong></p><p>✅ Server Component (No &quot;use client&quot;)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yVTT0hHdFN7eP7dD1IiAkQ.png" /></figure><p>✅ Client Component (when needed)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1002/1*CawISLlEDAroZvDTdHy68A.png" /></figure><p>🎯 <strong>Final Thought</strong></p><p>Most devs think auth is just about <strong>login/signup</strong>…</p><p>But in reality, it’s about:</p><blockquote><strong><em>Where and how you access the user securely</em></strong></blockquote><p>If you’re building with Next.js App Router and still fighting auth — this is worth 30 minutes of your time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6b73a3c942d9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Next.js Streaming — Stop Waiting for the Whole Page]]></title>
            <link>https://medium.com/@waqar105lgu.edu/next-js-streaming-stop-waiting-for-the-whole-page-aa7299ce78bb?source=rss-3f87dafa6426------2</link>
            <guid isPermaLink="false">https://medium.com/p/aa7299ce78bb</guid>
            <category><![CDATA[website-development]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[nextjs-tutorial]]></category>
            <category><![CDATA[performance-optimization]]></category>
            <dc:creator><![CDATA[Waqar Hussain]]></dc:creator>
            <pubDate>Tue, 21 Apr 2026 09:28:10 GMT</pubDate>
            <atom:updated>2026-04-21T09:28:10.777Z</atom:updated>
            <content:encoded><![CDATA[<p>Most MERN devs are used to this flow:</p><blockquote><em>Request → Wait → Full Response → Render UI</em></blockquote><p>That’s fine… until your <strong>app starts slowing down</strong>.</p><p>Now imagine this instead:</p><blockquote><em>Request → Send what’s ready → Stream the rest → UI updates progressively</em></blockquote><p>That’s <strong>Streaming</strong> in Next.js.</p><p>🧠 What is <strong>Streaming</strong> (in simple terms)?</p><p>In traditional SSR, the server waits until ALL the data is fetched, renders the full HTML, and then sends it to the browser. One big chunk. <strong>All or nothing</strong>.</p><p>Streaming lets your server send parts of the UI as soon as they’re ready, instead of waiting for everything to finish. Instead of blocking the whole page, you <strong>progressively render content</strong>.</p><p>⚡ Why it actually matters</p><ul><li><strong>Faster perceived performance</strong><br> Users see content instantly instead of staring at a blank screen</li><li><strong>Better UX</strong><br> You can show meaningful loading states instead of global spinners</li><li><strong>Parallel data fetching</strong><br> No more waterfall requests killing performance</li><li><strong>Feels like real-time without WebSockets</strong><br> Perfect for dashboards, feeds, and analytics</li></ul><p>🧩 <strong>Real-world use cases</strong></p><ul><li>Dashboards where some widgets are slow (DB aggregations, third-party APIs)</li><li>E-commerce pages with fast static content but slow personalized sections</li><li>Any page where one slow query shouldn’t hold up everything else</li></ul><p>🧠 <strong>Key idea most devs miss</strong></p><p>Streaming is not just about speed.</p><p>It’s about <strong>prioritization</strong>.</p><blockquote><em>What should the user see </em>first<em>?</em></blockquote><p>Once you start thinking like this, your UI architecture changes completely.</p><p>💻 <strong>Code Snippet (Practical Example)</strong></p><p>Here’s a simple example using <strong>React Suspense + Server Components</strong> in Next.js:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FUtHoASLmQb_KLCa1K4C_g.png" /></figure><p>🔍 <strong>What’s happening here?</strong></p><ul><li>RecentOrders resolves fast → streams to the browser first</li><li>RevenueChart takes longer → the fallback renders immediately, then gets <strong>swapped</strong> when data is ready</li><li>Zero client-side useEffect. Zero extra API routes. The data fetching lives inside the component itself.</li><li>UI doesn’t block → user stays engaged</li></ul><p>Streaming isn’t a fancy optimization for teams. It’s a practical tool that makes your app feel faster with less code than what you’re probably writing today.</p><p>If you’re building with Next.js App Router and you’re not using Suspense boundaries yet, this is the first thing worth adding.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aa7299ce78bb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Stop Using Next.js Like This — You’re Killing Its Real Power]]></title>
            <link>https://medium.com/@waqar105lgu.edu/stop-using-next-js-like-this-youre-killing-its-real-power-a36454ba74d4?source=rss-3f87dafa6426------2</link>
            <guid isPermaLink="false">https://medium.com/p/a36454ba74d4</guid>
            <category><![CDATA[nextjs-tutorial]]></category>
            <category><![CDATA[nextjs-15]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[website-speed]]></category>
            <dc:creator><![CDATA[Waqar Hussain]]></dc:creator>
            <pubDate>Fri, 17 Apr 2026 11:13:36 GMT</pubDate>
            <atom:updated>2026-04-17T12:16:59.673Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vcv__g9cSZ5DGJPzLK7Y2w.png" /></figure><blockquote><em>If most of your pages start like this…<br>You’re not really using Next.js — you’re just building a React SPA with routing.</em></blockquote><p>🧠 <strong>The Real Problem</strong></p><p>A lot of developers (especially beginners) fall into this trap:</p><ul><li>Everything is client-rendered</li><li>Data is fetched with useEffect</li><li><strong><em>Pages load → then fetch → then render</em></strong></li></ul><p>👉 This leads to:</p><ul><li>slower initial load</li><li>poor SEO</li><li>larger JS bundles</li><li>unnecessary complexity</li></ul><p>⚡ <strong>The Solution?</strong></p><p>Next.js already solved this.</p><blockquote><em>It gives you </em><strong><em>4 rendering strategies</em></strong><em> — and you’re supposed to </em><strong><em>mix them</em></strong><em>, not ignore them.</em></blockquote><h3>🔍 The 4 Rendering Strategies (With Real Use Cases)</h3><blockquote><strong><em>1- SSR — Server-Side Rendering</em></strong></blockquote><p>👉 Use when data is dynamic per request</p><p>Perfect for:</p><ul><li>dashboards</li><li>user-specific data</li><li>authenticated pages</li></ul><p>✔ Fresh data on every request<br>✔ Better SEO than CSR</p><blockquote><strong>2- SSG — Static Site Generation</strong></blockquote><p>👉 Use when content rarely changes</p><p>Perfect for:</p><ul><li>landing pages</li><li>blogs</li><li>documentation</li></ul><p>✔ Pre-rendered at build time<br>✔ Extremely fast performance</p><blockquote><strong>3- ISR — Incremental Static Regeneration</strong></blockquote><p>👉 Use when content changes occasionally</p><p>Perfect for:</p><ul><li>product listings</li><li>blogs with updates</li><li>news feeds</li></ul><p>✔ Static speed ⚡<br>✔ Auto updates without rebuild 🔄</p><blockquote><strong>4- CSR — Client-Side Rendering (</strong><strong>&#39;use client&#39;)</strong></blockquote><p>👉 Use for interactivity only</p><p>Perfect for:</p><ul><li>forms</li><li>modals</li><li>dropdowns</li><li>UI state</li></ul><p>✔ Great UX<br>❌ Not for entire pages</p><p>🧩 <strong>Practical Example (This is how you should think)</strong></p><p>Instead of this ❌</p><pre>&#39;use client&#39;<br><br>export default function Page() {<br>  const [data, setData] = useState(null)<br><br>  useEffect(() =&gt; {<br>    fetch(&#39;/api/data&#39;).then(res =&gt; res.json()).then(setData)<br>  }, [])<br><br>  return &lt;div&gt;{data}&lt;/div&gt;<br>}</pre><p>Think like this ✅</p><ul><li>🏠 Home → SSG</li><li>📰 Feed → ISR</li><li>📊 Dashboard → SSR</li><li>🎯 Form / Modal → CSR</li></ul><p>👉 One app. Multiple strategies. Better performance.</p><pre>// SSR Example<br>export default async function DashboardPage() {<br>  const data = await getDashboardData()<br>  return &lt;Dashboard data={data} /&gt;<br>}<br><br>// ISR Example<br>await fetch(&#39;/api/posts&#39;, {<br>  next: { revalidate: 60 }<br>})<br><br>// CSR Example<br>&#39;use client&#39;<br>const [open, setOpen] = useState(false)</pre><p>🚀<em>The difference between an average app and a high-performance one is:</em></p><p><strong><em>how you combine these strategies — not which one you pick</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a36454ba74d4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[after() API in Next.js 15+]]></title>
            <link>https://medium.com/@waqar105lgu.edu/after-api-in-next-js-15-73b8192625b5?source=rss-3f87dafa6426------2</link>
            <guid isPermaLink="false">https://medium.com/p/73b8192625b5</guid>
            <category><![CDATA[nextjs-tutorial]]></category>
            <category><![CDATA[mern-stack]]></category>
            <category><![CDATA[nextjs-15]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Waqar Hussain]]></dc:creator>
            <pubDate>Tue, 14 Apr 2026 08:52:05 GMT</pubDate>
            <atom:updated>2026-04-14T08:52:05.902Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JeRS01IFiBjK2FdsX853aw.png" /></figure><p>🚀 Most devs reach for Redis or BullMQ too early.<br>And honestly… most of the time, it’s overkill.</p><p>If you’re using Next.js 15+, you might not need them at all.</p><p>There’s a built-in API called 𝗮𝗳𝘁𝗲𝗿() — and it handles a huge chunk of background work.</p><p>What does 𝗮𝗳𝘁𝗲𝗿() actually do?<br>It lets you run code after the response is sent.</p><p>👉 User gets instant response<br>👉 Your side-effects still execute in the background</p><p>No queues.<br>No extra infra.<br>No latency hit.</p><p>💡 Real-world use cases<br>𝗧𝗿𝗮𝗻𝘀𝗮𝗰𝘁𝗶𝗼𝗻𝗮𝗹 𝗲𝗺𝗮𝗶𝗹𝘀<br>User signs up → response returns → email sends in background<br> No spinner. No waiting.</p><p>𝗔𝗻𝗮𝗹𝘆𝘁𝗶𝗰𝘀 &amp; 𝗮𝘂𝗱𝗶𝘁 𝗹𝗼𝗴𝗴𝗶𝗻𝗴<br>Track everything without slowing down the request.</p><pre>after(() =&gt; logEvent({ userId, action: &#39;purchase&#39; }))</pre><p>𝗖𝗮𝗰𝗵𝗲 𝗿𝗲𝘃𝗮𝗹𝗶𝗱𝗮𝘁𝗶𝗼𝗻<br>Keep UI fresh without blocking the user.</p><pre>after(() =&gt; revalidatePath(&#39;/dashboard&#39;))</pre><p>𝗪𝗲𝗯𝗵𝗼𝗼𝗸 𝗻𝗼𝘁𝗶𝗳𝗶𝗰𝗮𝘁𝗶𝗼𝗻𝘀<br>Trigger external systems asynchronously.</p><pre>after(() =&gt; notifySlack(&#39;New order placed!&#39;))</pre><p>𝗖𝗼𝘂𝗻𝘁𝗲𝗿𝘀 &amp; 𝗱𝗲𝗻𝗼𝗿𝗺𝗮𝗹𝗶𝘇𝗲𝗱 𝗱𝗮𝘁𝗮<br>Update non-critical fields without affecting UX.</p><pre>after(() =&gt; db.user.update({ lastActive: new Date() }))</pre><p>𝗖𝗹𝗲𝗮𝗻𝘂𝗽 𝘁𝗮𝘀𝗸𝘀<br>Revoke tokens, delete temp files, post-process data — all safely after response.</p><p>⚠️ 𝗞𝗻𝗼𝘄 𝘁𝗵𝗲 𝗹𝗶𝗺𝗶𝘁𝘀:<br>after() is NOT a queue</p><p>• No retries — if the task fails, it fails silently<br>• Serverless timeouts can kill execution<br>• Not for critical workflows</p><p>👉 If it must succeed → use a queue<br>👉 If it’s nice to have → use after()</p><p>💬 𝗙𝗶𝗻𝗮𝗹 𝘁𝗵𝗼𝘂𝗴𝗵𝘁<br>You probably don’t need a queue for your next feature.<br>Start simple. Add complexity only when it’s actually needed. And scale when it hurts.</p><p>🔖 Save this — you’ll use it more than you think.</p><p>#nextjs #after() #reactjs #javascript #webapp #fullstack #merndeveloper</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=73b8192625b5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Level Up Your API Dev Workflow: Interactive Docs Made Easy with Nest JS & Swagger UI]]></title>
            <link>https://medium.com/@waqar105lgu.edu/level-up-your-api-dev-workflow-interactive-docs-made-easy-with-nest-js-swagger-ui-f756d84934bf?source=rss-3f87dafa6426------2</link>
            <guid isPermaLink="false">https://medium.com/p/f756d84934bf</guid>
            <dc:creator><![CDATA[Waqar Hussain]]></dc:creator>
            <pubDate>Sat, 01 Jun 2024 08:47:02 GMT</pubDate>
            <atom:updated>2024-06-01T08:47:02.950Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bGwJSVfgjRAbqX37wFMcQg.png" /></figure><p>🚀 Level Up Your API Dev Workflow: Interactive Docs Made Easy with Nest JS &amp; Swagger UI</p><p>I’m excited to share my latest project: a NestJS application that harnesses the power of Swagger UI for comprehensive API documentation. This project simplifies API development by offering developers a user-friendly interface to explore, understand, and test API functionalities directly through Swagger UI.</p><p>Empower developers to:</p><p>1️⃣ Visualize endpoints for a clear understanding of API structure.</p><p>2️⃣ Test API operations directly from the interface, streamlining development.</p><p>3️⃣ Explore request/response payloads for seamless integration.</p><p>Want to learn more about building well-documented APIs with NestJS and Swagger UI?</p><p>Check out the project on my GitHub repository</p><p>🔗 <a href="https://github.com/WaqarHussain0/swaggerui_nestjs">https://github.com/WaqarHussain0/swaggerui_nestjs</a></p><p>Feel free to ask any questions!</p><p>#NestJS #SwaggerUI #APIDocumentation #Nodejs #API #MERN #fullstackdev #react #mongodb #javascript #typescript</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f756d84934bf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to implement JSON Web Token (JWT) and encrypt password in Node Js?]]></title>
            <link>https://medium.com/@waqar105lgu.edu/how-to-implement-json-web-token-jwt-and-encrypt-password-in-node-js-1449b9b77a5f?source=rss-3f87dafa6426------2</link>
            <guid isPermaLink="false">https://medium.com/p/1449b9b77a5f</guid>
            <dc:creator><![CDATA[Waqar Hussain]]></dc:creator>
            <pubDate>Sat, 11 May 2024 11:13:39 GMT</pubDate>
            <atom:updated>2024-05-11T11:13:39.057Z</atom:updated>
            <content:encoded><![CDATA[<p>🔒 Excited to share my latest project: a secure user authentication and management system built with Node.js, Express.js, and PostgreSQL!</p><p>This project showcases my skills in building secure and scalable applications.</p><p>Here’s what it offers:<br>➡ Secure Logins: Utilizes JWT (JSON Web Tokens) for secure user authentication.<br>➡ Strong Password Encryption: Employs bcrypt to encrypt user passwords before saving them in the PostgreSQL database.<br>➡ Flexible User Management: Implements CRUD operations (Create, Read, Update, Delete) for managing user data effectively.</p><p>🔗 Check out the code on <a href="https://github.com/WaqarHussain0/jwt_bcrpyt">GitHub</a>:<br><a href="https://lnkd.in/dhbhW6-j">https://lnkd.in/dhbhW6-j</a> ↗</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tr-HczgUXU3cct8Jk1bCsw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1449b9b77a5f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>