<?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: Shubham Chaudhary</title>
    <description>The latest articles on DEV Community by Shubham Chaudhary (@shubham_works).</description>
    <link>https://dev.to/shubham_works</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%2F4221684%2F8687eae6-28b0-4117-b4f4-53ed6e141686.png</url>
      <title>DEV Community: Shubham Chaudhary</title>
      <link>https://dev.to/shubham_works</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shubham_works"/>
    <language>en</language>
    <item>
      <title>🌳 Git is just a few kinds of pointers. Here's a page that lets you watch them move</title>
      <dc:creator>Shubham Chaudhary</dc:creator>
      <pubDate>Sun, 15 Nov 2026 17:13:09 +0000</pubDate>
      <link>https://dev.to/shubham_works/git-is-just-a-few-kinds-of-pointers-heres-a-page-that-lets-you-watch-them-move-mnj</link>
      <guid>https://dev.to/shubham_works/git-is-just-a-few-kinds-of-pointers-heres-a-page-that-lets-you-watch-them-move-mnj</guid>
      <description>&lt;p&gt;Git commands used to feel like spells to me. Say the right words and it works. Say the wrong ones and something breaks, and you have no idea why.&lt;/p&gt;

&lt;p&gt;What finally fixed that wasn't another cheat sheet. It was &lt;strong&gt;seeing what each command does to the picture&lt;/strong&gt;. So I built a page for myself that draws it, and then I made it public:&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;&lt;a href="https://git-drawn-out.vercel.app" rel="noopener noreferrer"&gt;git-drawn-out.vercel.app&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It's free, has no sign-up, and works on a phone. The source is on &lt;a href="https://github.com/chaudharyShub/git-drawn-out" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; under the MIT license.&lt;/p&gt;

&lt;h2&gt;
  
  
  The whole idea: four things
&lt;/h2&gt;

&lt;p&gt;Almost everything in Git is a combination of four ideas:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Commit.&lt;/strong&gt; A snapshot of every tracked file, plus the ID of its parent. Arrows point backwards: a child knows its parent, never the other way round.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Branch.&lt;/strong&gt; A sticky note holding one commit ID. Committing moves the note forward. Creating a branch copies nothing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HEAD.&lt;/strong&gt; "You are here." It normally points at a branch, and that branch is the one that moves when you commit.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;origin/main.&lt;/strong&gt; Your repo's &lt;em&gt;memory&lt;/em&gt; of where the server's main was the last time you talked to it. It goes stale until you fetch.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once you see that, a lot of scary commands turn out to be "move a sticky note". &lt;code&gt;git reset --soft HEAD~1&lt;/code&gt; moves a branch back one commit. &lt;code&gt;git switch&lt;/code&gt; moves HEAD. &lt;code&gt;git branch&lt;/code&gt; adds a note. That's it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The playground
&lt;/h2&gt;

&lt;p&gt;The main part of the site is a playground with 12 scenarios: commits and branches, merge, rebase, amend and squash, reset and reflog, committing to the wrong branch, detached HEAD, cherry-pick and revert, stash, tags, fetch/pull/push, and force pushing.&lt;/p&gt;

&lt;p&gt;You press &lt;strong&gt;Next&lt;/strong&gt; (or →) and watch which pointer moves. Each step shows the real command, what Git prints, and a short explanation.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fe3elyu3pf4fmtr09p4bi.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%2Fe3elyu3pf4fmtr09p4bi.png" alt="The playground in the Rebase scenario: C and D faded out, replaced by new commits C′ and D′ on top of E" width="800" height="433"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A few things I added because they're what made Git click for me:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Faded commits.&lt;/strong&gt; When a commit becomes unreachable (after a reset, rebase or amend), it doesn't vanish. It fades out, because Git still has it and &lt;code&gt;git reflog&lt;/code&gt; can bring it back. Seeing that took away most of my fear of "losing work".&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Predict mode.&lt;/strong&gt; Before each step, you tick what you think the command will change: HEAD, a branch, a new commit. Then you see if you were right. It also catches the most common misunderstanding. When you commit, HEAD doesn't move. The &lt;em&gt;branch&lt;/em&gt; moves, and HEAD comes along with it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjl498eq5936vamseqh2h.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%2Fjl498eq5936vamseqh2h.png" alt="Predict mode after guessing that HEAD moves on a commit: HEAD didn't change, main did" width="800" height="549"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Click any commit to see its names.&lt;/strong&gt; Click a commit and it tells you everything that reaches it, like &lt;code&gt;HEAD~2&lt;/code&gt;, &lt;code&gt;feature~1&lt;/code&gt; or &lt;code&gt;main^2&lt;/code&gt; (the second parent of a merge). There's also a &lt;code&gt;git log A..B&lt;/code&gt; picker that highlights exactly which commits are in a range, which is what &lt;code&gt;main..feature&lt;/code&gt; means.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Merge vs rebase, side by side.&lt;/strong&gt; The same diverged history, combined both ways at once. Merge keeps history as it happened and adds a commit with two parents. Rebase gives a straight line, but replaces your commits with new ones. You can see why "don't rebase what you've already pushed" is a rule.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fu8450vaqmtrlsyur37mg.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%2Fu8450vaqmtrlsyur37mg.png" alt="Merge vs rebase side by side: a merge commit M on the left, a straight line with C′ and D′ on the right" width="800" height="405"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Where your changes actually live
&lt;/h2&gt;

&lt;p&gt;There's a separate demo for the working folder, the staging area and the repository. You edit, &lt;code&gt;git add&lt;/code&gt; and &lt;code&gt;git commit&lt;/code&gt; two files, and watch &lt;code&gt;git status&lt;/code&gt; change.&lt;/p&gt;

&lt;p&gt;One thing I didn't know until I built this: &lt;code&gt;git restore app.js&lt;/code&gt; doesn't take a file back to the last commit. It takes it back to the &lt;strong&gt;staged&lt;/strong&gt; version. If you &lt;code&gt;git add&lt;/code&gt; a change and then keep editing, &lt;code&gt;git restore&lt;/code&gt; throws away only the edits made after the add. The staged change survives.&lt;/p&gt;

&lt;h2&gt;
  
  
  When something goes wrong
&lt;/h2&gt;

&lt;p&gt;The section I'd have wanted most when I started is called &lt;strong&gt;"Oh no, I…"&lt;/strong&gt;. It covers mistakes like these:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;…committed to the wrong branch&lt;/li&gt;
&lt;li&gt;…need to undo a commit that's already pushed&lt;/li&gt;
&lt;li&gt;…lost commits after a reset or rebase&lt;/li&gt;
&lt;li&gt;…got my push rejected&lt;/li&gt;
&lt;li&gt;…committed a password or API key&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each one has the fix and, where possible, a link straight to the playground step that shows it happening.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpl36ozrt5epyhasm3o12.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%2Fpl36ozrt5epyhasm3o12.png" alt="The &amp;quot;Oh no, I…&amp;quot; section with &amp;quot;committed to the wrong branch&amp;quot; open" width="800" height="593"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There's also a merge conflict you resolve yourself. You can try committing too early to see Git's real error, or stage the file with the &lt;code&gt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&lt;/code&gt; markers still in it. Git won't stop you from committing those, by the way, which surprises a lot of people.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpl9gwk0mij8grpy5gx8u.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%2Fpl9gwk0mij8grpy5gx8u.png" alt="The conflict demo after committing too early: Git refuses because of unmerged files" width="800" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  A small real-life example
&lt;/h2&gt;

&lt;p&gt;While publishing the latest version of the site, I merged my pull request with GitHub's &lt;strong&gt;squash and merge&lt;/strong&gt; button. Then, locally:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git branch -d feature/more-interactivity
&lt;span class="c"&gt;# error: The branch 'feature/more-interactivity' is not fully merged.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But it &lt;em&gt;was&lt;/em&gt; merged. The squash created a brand-new commit on main, so none of my branch's commits are in main's history, and Git can't tell they hold the same changes. After checking that &lt;code&gt;git diff main feature/more-interactivity&lt;/code&gt; was empty, I deleted it with &lt;code&gt;git branch -D&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Once you think of branches as sticky notes and commits as snapshots with parents, that error makes sense.&lt;/p&gt;

&lt;h2&gt;
  
  
  Also on the site
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Under the hood:&lt;/strong&gt; blobs, trees and commits, what's inside &lt;code&gt;.git&lt;/code&gt;, and a box that computes a real Git blob hash in your browser (it matches &lt;code&gt;git hash-object&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Commands worth knowing:&lt;/strong&gt; searchable, filterable by what each one does ("moves a pointer", "replaces commits", "changes your files"…), with copy buttons and a printable cheat sheet.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Old &lt;code&gt;checkout&lt;/code&gt; → &lt;code&gt;switch&lt;/code&gt; / &lt;code&gt;restore&lt;/code&gt;&lt;/strong&gt;, for when a tutorial uses the old commands.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Settings worth changing once&lt;/strong&gt;, like &lt;code&gt;pull.rebase&lt;/code&gt;, &lt;code&gt;push.autoSetupRemote&lt;/code&gt; and &lt;code&gt;merge.conflictStyle zdiff3&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A glossary&lt;/strong&gt;, plus light and dark themes.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How it's built
&lt;/h2&gt;

&lt;p&gt;It's a single static page with no framework and no build step: HTML, CSS and plain JavaScript. The commit graph is a small SVG renderer. Each scenario is a list of commands, and each command changes a tiny model of a repository (commits, refs and HEAD). The graph then animates from one state to the next. It's hosted on Vercel.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;👉 &lt;strong&gt;&lt;a href="https://git-drawn-out.vercel.app" rel="noopener noreferrer"&gt;git-drawn-out.vercel.app&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;My suggestion: open the playground, turn on &lt;strong&gt;Predict mode&lt;/strong&gt;, and go through "Reset &amp;amp; reflog" without peeking. If any step surprises you, that's the bit of Git worth learning next.&lt;/p&gt;

&lt;p&gt;If something is unclear or wrong, or there's a scenario you'd like to see, tell me in the comments or open an issue on &lt;a href="https://github.com/chaudharyShub/git-drawn-out" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>webdev</category>
      <category>learning</category>
    </item>
    <item>
      <title>Your Next.js Docker Image Is Probably 1GB. Here's How to Fix It.</title>
      <dc:creator>Shubham Chaudhary</dc:creator>
      <pubDate>Tue, 10 Nov 2026 17:24:41 +0000</pubDate>
      <link>https://dev.to/shubham_works/your-nextjs-docker-image-is-probably-1gb-heres-how-to-fix-it-4opm</link>
      <guid>https://dev.to/shubham_works/your-nextjs-docker-image-is-probably-1gb-heres-how-to-fix-it-4opm</guid>
      <description>&lt;p&gt;You already know what Docker is. You've written a Dockerfile, run &lt;code&gt;docker build&lt;/code&gt;, and shipped something.&lt;/p&gt;

&lt;p&gt;But if your Next.js Dockerfile looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;&lt;span class="k"&gt;FROM&lt;/span&gt; node:20
&lt;span class="k"&gt;WORKDIR&lt;/span&gt; /app
&lt;span class="k"&gt;COPY&lt;/span&gt; . .
&lt;span class="k"&gt;RUN&lt;/span&gt; npm install
&lt;span class="k"&gt;RUN&lt;/span&gt; npm run build
&lt;span class="k"&gt;CMD&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"npm"&lt;/span&gt;, &lt;span class="s2"&gt;"start"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;…then your image is carrying a lot of things production never needs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The full Debian-based Node image&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;All&lt;/strong&gt; &lt;code&gt;devDependencies&lt;/code&gt; (TypeScript, ESLint, testing libraries, etc.)&lt;/li&gt;
&lt;li&gt;Your entire source code, including stuff that's already been compiled&lt;/li&gt;
&lt;li&gt;The npm cache&lt;/li&gt;
&lt;li&gt;And it's running as &lt;code&gt;root&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;An image like this can easily cross &lt;strong&gt;1 GB&lt;/strong&gt;. That means slower CI pipelines, slower deploys, higher registry storage costs, and a bigger attack surface.&lt;/p&gt;

&lt;p&gt;Let's fix it step by step.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 1: Turn on Next.js Standalone Output
&lt;/h2&gt;

&lt;p&gt;This is the single biggest win, and most people don't know it exists.&lt;/p&gt;

&lt;p&gt;In &lt;code&gt;next.config.js&lt;/code&gt; (or &lt;code&gt;next.config.ts&lt;/code&gt;):&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="cm"&gt;/** @type {import('next').NextConfig} */&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;nextConfig&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;output&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"standalone"&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;span class="kd"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;nextConfig&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With &lt;code&gt;output: "standalone"&lt;/code&gt;, &lt;code&gt;next build&lt;/code&gt; traces which files your app &lt;strong&gt;actually imports at runtime&lt;/strong&gt; and copies only those into &lt;code&gt;.next/standalone&lt;/code&gt; — including a minimal &lt;code&gt;node_modules&lt;/code&gt; and a ready-to-run &lt;code&gt;server.js&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;So instead of shipping your whole &lt;code&gt;node_modules&lt;/code&gt; folder, you ship only what the server really needs.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;⚠️ Standalone output does &lt;strong&gt;not&lt;/strong&gt; copy &lt;code&gt;public/&lt;/code&gt; or &lt;code&gt;.next/static&lt;/code&gt; for you. We'll handle that in the Dockerfile.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Step 2: Use a Multi-Stage Build
&lt;/h2&gt;

&lt;p&gt;A multi-stage build lets you use one stage to &lt;strong&gt;build&lt;/strong&gt; your app (with all the heavy tooling) and a separate, clean stage to &lt;strong&gt;run&lt;/strong&gt; it. Only what you explicitly copy makes it into the final image.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;&lt;span class="c"&gt;# syntax=docker/dockerfile:1&lt;/span&gt;

&lt;span class="c"&gt;# ---------- Stage 1: Install dependencies ----------&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; node:20-alpine AS deps
&lt;span class="k"&gt;WORKDIR&lt;/span&gt; /app
&lt;span class="k"&gt;COPY&lt;/span&gt; package.json package-lock.json ./
&lt;span class="k"&gt;RUN&lt;/span&gt; --mount=type=cache,target=/root/.npm \
    npm ci

&lt;span class="c"&gt;# ---------- Stage 2: Build the app ----------&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; node:20-alpine AS builder
&lt;span class="k"&gt;WORKDIR&lt;/span&gt; /app
&lt;span class="k"&gt;COPY&lt;/span&gt; --from=deps /app/node_modules ./node_modules
&lt;span class="k"&gt;COPY&lt;/span&gt; . .
&lt;span class="k"&gt;ENV&lt;/span&gt; &lt;span class="nv"&gt;NEXT_TELEMETRY_DISABLED&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1
&lt;span class="k"&gt;RUN&lt;/span&gt; npm run build

&lt;span class="c"&gt;# ---------- Stage 3: Production runner ----------&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; node:20-alpine AS runner
&lt;span class="k"&gt;WORKDIR&lt;/span&gt; /app

&lt;span class="k"&gt;ENV&lt;/span&gt; &lt;span class="nv"&gt;NODE_ENV&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;production
&lt;span class="k"&gt;ENV&lt;/span&gt; &lt;span class="nv"&gt;NEXT_TELEMETRY_DISABLED&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1

&lt;span class="c"&gt;# Create a non-root user&lt;/span&gt;
&lt;span class="k"&gt;RUN&lt;/span&gt; addgroup --system --gid 1001 nodejs \
 &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; adduser --system --uid 1001 nextjs

&lt;span class="c"&gt;# Copy only what's needed to run&lt;/span&gt;
&lt;span class="k"&gt;COPY&lt;/span&gt; --from=builder /app/public ./public
&lt;span class="k"&gt;COPY&lt;/span&gt; --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
&lt;span class="k"&gt;COPY&lt;/span&gt; --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static

&lt;span class="k"&gt;USER&lt;/span&gt; nextjs

&lt;span class="k"&gt;EXPOSE&lt;/span&gt; 3000
&lt;span class="k"&gt;ENV&lt;/span&gt; &lt;span class="nv"&gt;PORT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;3000
&lt;span class="k"&gt;ENV&lt;/span&gt; &lt;span class="nv"&gt;HOSTNAME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"0.0.0.0"&lt;/span&gt;

&lt;span class="k"&gt;CMD&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"node"&lt;/span&gt;, &lt;span class="s2"&gt;"server.js"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  What's happening here
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Stage&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;th&gt;Ends up in final image?&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;deps&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Installs all dependencies&lt;/td&gt;
&lt;td&gt;❌ No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;builder&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Runs &lt;code&gt;next build&lt;/code&gt; with full tooling&lt;/td&gt;
&lt;td&gt;❌ No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;runner&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Runs the compiled standalone server&lt;/td&gt;
&lt;td&gt;✅ Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;TypeScript, ESLint, your raw source files, the npm cache — all of that stays behind in the earlier stages and gets thrown away.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 3: Cache Mounts — Stop Re-downloading the Internet
&lt;/h2&gt;

&lt;p&gt;Notice this line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;&lt;span class="k"&gt;RUN&lt;/span&gt; --mount=type=cache,target=/root/.npm \
    npm ci
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is a &lt;strong&gt;BuildKit cache mount&lt;/strong&gt;. It keeps npm's download cache &lt;strong&gt;between builds&lt;/strong&gt; on your machine (or CI runner), but &lt;strong&gt;never&lt;/strong&gt; writes it into the image.&lt;/p&gt;

&lt;p&gt;The result: when you change one dependency, npm doesn't have to re-download every package from scratch. And your image doesn't carry the cache around either.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💡 BuildKit is the default builder in modern Docker versions, so this works out of the box. The &lt;code&gt;# syntax=docker/dockerfile:1&lt;/code&gt; line at the top ensures you get the latest Dockerfile features.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Step 4: Don't Run as Root
&lt;/h2&gt;

&lt;p&gt;By default, containers run as &lt;code&gt;root&lt;/code&gt;. If someone ever finds a vulnerability in your app, they'd have root inside the container.&lt;/p&gt;

&lt;p&gt;These lines fix that:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;&lt;span class="k"&gt;RUN&lt;/span&gt; addgroup --system --gid 1001 nodejs \
 &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; adduser --system --uid 1001 nextjs

&lt;span class="k"&gt;USER&lt;/span&gt; nextjs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It's a two-line change that closes off an entire class of problems. There's no reason not to do it.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 5: Add a Proper &lt;code&gt;.dockerignore&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Without this, &lt;code&gt;COPY . .&lt;/code&gt; sends your local &lt;code&gt;node_modules&lt;/code&gt;, &lt;code&gt;.next&lt;/code&gt;, and &lt;code&gt;.git&lt;/code&gt; folders into the build context — slowing builds and potentially overwriting the clean dependencies Docker just installed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node_modules
.next
.git
.env*
npm-debug.log
Dockerfile
.dockerignore
README.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Also note &lt;code&gt;.env*&lt;/code&gt; — you never want local secrets baked into an image.&lt;/p&gt;




&lt;h2&gt;
  
  
  Check the Difference Yourself
&lt;/h2&gt;

&lt;p&gt;Build both versions and compare:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker build -t next-naive -f Dockerfile.naive .
docker build -t next-optimized .

docker images &lt;span class="o"&gt;|&lt;/span&gt; grep next-
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The exact numbers depend on your app and dependencies, but the optimized image will be a fraction of the naive one's size.&lt;/p&gt;




&lt;h2&gt;
  
  
  Bonus: Fast Local Development with Compose Watch
&lt;/h2&gt;

&lt;p&gt;Production images are great, but what about local dev? Rebuilding the image every time you edit a component would be painful.&lt;/p&gt;

&lt;p&gt;The old approach was bind-mounting your source folder into the container — which often caused slow file watching (especially on macOS/Windows) and &lt;code&gt;node_modules&lt;/code&gt; conflicts between host and container.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Docker Compose Watch&lt;/strong&gt; solves this. It watches your files and &lt;strong&gt;syncs&lt;/strong&gt; changes into the running container, and can &lt;strong&gt;rebuild&lt;/strong&gt; automatically when something like &lt;code&gt;package.json&lt;/code&gt; changes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;compose.yaml&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;services&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;web&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;build&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;context&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;.&lt;/span&gt;
      &lt;span class="na"&gt;target&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;builder&lt;/span&gt;   &lt;span class="c1"&gt;# use the build stage, which has dev tooling
&lt;/span&gt;    &lt;span class="na"&gt;command&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;npm run dev&lt;/span&gt;
    &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s2"&gt;"3000:3000"&lt;/span&gt;
    &lt;span class="na"&gt;develop&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;watch&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="c1"&gt;# Sync source changes instantly → Next.js hot reload picks them up
&lt;/span&gt;        &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;action&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;sync&lt;/span&gt;
          &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;./src&lt;/span&gt;
          &lt;span class="na"&gt;target&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/app/src&lt;/span&gt;
        &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;action&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;sync&lt;/span&gt;
          &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;./public&lt;/span&gt;
          &lt;span class="na"&gt;target&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/app/public&lt;/span&gt;

        &lt;span class="c1"&gt;# Rebuild the image when dependencies change
&lt;/span&gt;        &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;action&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;rebuild&lt;/span&gt;
          &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;package.json&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Start it with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker compose watch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Edit a file in &lt;code&gt;src/&lt;/code&gt; → it's synced into the container → hot reload kicks in&lt;/li&gt;
&lt;li&gt;Change &lt;code&gt;package.json&lt;/code&gt; → Compose rebuilds the image automatically&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Notice the &lt;code&gt;target: builder&lt;/code&gt; line — we're &lt;strong&gt;reusing the same Dockerfile&lt;/strong&gt; for development by stopping at the &lt;code&gt;builder&lt;/code&gt; stage, which still has all the dev dependencies. One Dockerfile, two use cases.&lt;/p&gt;




&lt;h2&gt;
  
  
  Quick Recap
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Problem&lt;/th&gt;
&lt;th&gt;Fix&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Huge &lt;code&gt;node_modules&lt;/code&gt; in the image&lt;/td&gt;
&lt;td&gt;&lt;code&gt;output: "standalone"&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Build tools shipped to production&lt;/td&gt;
&lt;td&gt;Multi-stage builds&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Slow, repeated dependency installs&lt;/td&gt;
&lt;td&gt;BuildKit cache mounts&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Container running as root&lt;/td&gt;
&lt;td&gt;Non-root &lt;code&gt;USER&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Junk and secrets in build context&lt;/td&gt;
&lt;td&gt;&lt;code&gt;.dockerignore&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Painful local dev in containers&lt;/td&gt;
&lt;td&gt;Docker Compose Watch&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;None of these are hard on their own, but together they turn a bloated, slow, root-running image into something lean and production-ready.&lt;/p&gt;




&lt;p&gt;Have you tried any of these in your own projects? Or is there a Docker trick you swear by that I didn't cover? Let me know in the comments 👇&lt;/p&gt;

</description>
      <category>docker</category>
      <category>nextjs</category>
      <category>devops</category>
      <category>webdev</category>
    </item>
    <item>
      <title>CloudPrep Now Covers AWS Solutions Architect (SAA-C03) and Developer (DVA-C03): 1,000 Free Practice Questions Each</title>
      <dc:creator>Shubham Chaudhary</dc:creator>
      <pubDate>Mon, 09 Nov 2026 13:04:43 +0000</pubDate>
      <link>https://dev.to/shubham_works/cloudprep-now-covers-aws-solutions-architect-saa-c03-and-developer-dva-c03-1000-free-practice-5fei</link>
      <guid>https://dev.to/shubham_works/cloudprep-now-covers-aws-solutions-architect-saa-c03-and-developer-dva-c03-1000-free-practice-5fei</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; &lt;a href="https://aws-cloud-prepare.vercel.app/" rel="noopener noreferrer"&gt;&lt;strong&gt;CloudPrep&lt;/strong&gt;&lt;/a&gt;, my free AWS exam simulator, now covers &lt;strong&gt;two Associate exams&lt;/strong&gt;: &lt;strong&gt;Solutions Architect – Associate (SAA-C03)&lt;/strong&gt; and &lt;strong&gt;Developer – Associate (DVA-C03)&lt;/strong&gt;, with &lt;strong&gt;1,000 original questions each&lt;/strong&gt;. Everything the Cloud Practitioner (CLF-C02) side had comes with them: Learning mode, Review due, timed mock exams, the AI proctor, results, history and sync. Still free, no ads, no paywall.&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;Try it:&lt;/strong&gt; &lt;a href="https://aws-cloud-prepare.vercel.app/" rel="noopener noreferrer"&gt;aws-cloud-prepare.vercel.app&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  👋 Quick recap
&lt;/h2&gt;

&lt;p&gt;A while ago I wrote about &lt;a href="https://shubham-works.hashnode.dev/i-built-a-free-aws-exam-simulator-for-clf-c02-saa-c03-and-dva-c03-4-000-questions-timed-mocks-and-an-ai-proctor" rel="noopener noreferrer"&gt;building CloudPrep&lt;/a&gt;, a free practice simulator for the AWS Cloud Practitioner exam: 2,000 original questions, real-format mock exams, and an optional AI proctor that runs entirely in your browser.&lt;/p&gt;

&lt;p&gt;The natural next step after Cloud Practitioner is an &lt;strong&gt;Associate&lt;/strong&gt; exam, so that's what I built next.&lt;/p&gt;




&lt;h2&gt;
  
  
  🆕 What's new
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Cloud Practitioner&lt;/th&gt;
&lt;th&gt;Solutions Architect&lt;/th&gt;
&lt;th&gt;Developer&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Exam code&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;CLF-C02&lt;/td&gt;
&lt;td&gt;SAA-C03&lt;/td&gt;
&lt;td&gt;DVA-C03&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Questions in CloudPrep&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;2,000&lt;/td&gt;
&lt;td&gt;1,000&lt;/td&gt;
&lt;td&gt;1,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Mock exam&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;65 questions, 90 min&lt;/td&gt;
&lt;td&gt;65 questions, 130 min&lt;/td&gt;
&lt;td&gt;65 questions, 130 min&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Passing score shown&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;700&lt;/td&gt;
&lt;td&gt;720&lt;/td&gt;
&lt;td&gt;720&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;That's &lt;strong&gt;4,000 questions&lt;/strong&gt; across three exams, every option explained, every question linked to the AWS pages it's based on.&lt;/p&gt;

&lt;h3&gt;
  
  
  🏗️ Solutions Architect – Associate (SAA-C03)
&lt;/h3&gt;

&lt;p&gt;The questions follow the four domains and weights in the official exam guide (revised in October 2026):&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Domain&lt;/th&gt;
&lt;th&gt;Exam weight&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1. Design Secure Architectures&lt;/td&gt;
&lt;td&gt;30%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2. Design Resilient Architectures&lt;/td&gt;
&lt;td&gt;26%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3. Design High-Performing Architectures&lt;/td&gt;
&lt;td&gt;24%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4. Design Cost-Optimized Architectures&lt;/td&gt;
&lt;td&gt;20%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  💻 Developer – Associate (DVA-C03)
&lt;/h3&gt;

&lt;p&gt;DVA-C03 is the &lt;strong&gt;new&lt;/strong&gt; version of the Developer exam. It replaces DVA-C02, whose last exam day is &lt;strong&gt;30 November 2026&lt;/strong&gt;, so I built straight for C03 instead of a version that's about to retire.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Domain&lt;/th&gt;
&lt;th&gt;Exam weight&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1. Development with AWS Services&lt;/td&gt;
&lt;td&gt;30%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2. Security&lt;/td&gt;
&lt;td&gt;26%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3. Testing and Deployment&lt;/td&gt;
&lt;td&gt;22%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4. Troubleshooting and Optimization&lt;/td&gt;
&lt;td&gt;22%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;C03 adds &lt;strong&gt;AI-assisted development&lt;/strong&gt; skills to the guide, so the bank covers those too, alongside the classics: Lambda, DynamoDB, API Gateway, SQS, SNS, Step Functions, the CI/CD services, X-Ray and CloudWatch.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧠 What Associate questions look like
&lt;/h2&gt;

&lt;p&gt;Cloud Practitioner questions mostly ask &lt;em&gt;"which service does X?"&lt;/em&gt;. Associate questions are &lt;strong&gt;scenarios&lt;/strong&gt;: a requirement, a constraint (lowest cost, least operational effort, highest availability), and four or five designs that all sound reasonable.&lt;/p&gt;

&lt;p&gt;So every wrong option in CloudPrep is a &lt;strong&gt;real AWS option that fails one stated constraint&lt;/strong&gt;, and its explanation tells you which one. Here's an SAA-C03-style example:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A web application runs on Amazon EC2 instances in one Availability Zone. It must keep serving users if that zone fails, with the least operational effort. Which design meets this?&lt;/p&gt;

&lt;p&gt;A. Take nightly AMI backups of each instance&lt;br&gt;
B. An Auto Scaling group across several Availability Zones behind an Application Load Balancer&lt;br&gt;
C. A larger instance type in the same Availability Zone&lt;br&gt;
D. A second Amazon EBS volume on each instance&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Show the answer&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;B.&lt;/strong&gt; Spreading instances across Availability Zones behind a load balancer keeps the app running when one zone fails, and Auto Scaling replaces failed instances for you. Backups (A) help you recover, but the app is still down while you do. A bigger instance (C) or an extra volume (D) still lives in the one zone that failed.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔍 Checking 2,000 new questions against a moving target
&lt;/h2&gt;

&lt;p&gt;Like the Cloud Practitioner bank, the questions are &lt;strong&gt;original&lt;/strong&gt;: written with AI assistance from public AWS documentation and each exam's official guide, then &lt;strong&gt;checked question by question against the AWS pages they cite&lt;/strong&gt;. Nothing comes from the real exam or from dumps.&lt;/p&gt;

&lt;p&gt;The interesting part was how much &lt;strong&gt;AWS itself had changed&lt;/strong&gt;. The check caught questions whose "correct" answer was no longer correct:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;📦 &lt;strong&gt;Snowball Edge&lt;/strong&gt; is no longer available to new customers, so a large data-migration question now uses DataSync, and Snowball Edge became a wrong option with that reason.&lt;/li&gt;
&lt;li&gt;🌐 &lt;strong&gt;NAT gateways&lt;/strong&gt; can now be &lt;strong&gt;regional&lt;/strong&gt; and span Availability Zones, so "one NAT gateway per zone" is no longer the only right answer.&lt;/li&gt;
&lt;li&gt;🔒 &lt;strong&gt;S3 Block Public Access&lt;/strong&gt; can now be set once for a whole AWS Organization, which changed the "most effective" answer to a multi-account question.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Those questions were rewritten. I also found that when AWS retires a docs page, it often &lt;strong&gt;redirects to the guide's home page with a normal "200 OK"&lt;/strong&gt;, so a plain link checker thinks the link still works. CloudPrep's reference checker now flags those too.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💡 If you study from older material, watch for this. Exam guides and services change; a question bank needs to keep up.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  🧭 How it works in the app
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;An &lt;strong&gt;exam switcher&lt;/strong&gt; at the top of the navigation. Pick an exam and you land on the same section of that exam.&lt;/li&gt;
&lt;li&gt;Each exam has its own address (&lt;code&gt;/saa-c03&lt;/code&gt;, &lt;code&gt;/dva-c03/practice&lt;/code&gt;, …), so you can bookmark or share it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Progress, bookmarks and exam history are kept separately&lt;/strong&gt; for each exam, and all of it syncs to your account when you sign in with Google.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One exam in progress at a time&lt;/strong&gt;, like a real test centre. Start another and CloudPrep asks you to finish the first.&lt;/li&gt;
&lt;li&gt;Learning mode still works &lt;strong&gt;without an account&lt;/strong&gt;, for every exam.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🛠️ For the developers: turning a one-exam app into a multi-exam one
&lt;/h2&gt;

&lt;p&gt;CloudPrep was built around CLF-C02, so adding exams meant pulling every CLF-specific assumption out of the code. The main changes:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Change&lt;/th&gt;
&lt;th&gt;How&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Exam guides as data&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Each exam is one object: code, minutes, question count, passing score, domains, weights and task statements. The exam logic takes the guide as input instead of importing CLF constants.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Exam in the address&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Exam pages moved under &lt;code&gt;/:examId&lt;/code&gt;. Old addresses redirect, so links shared before the update keep working.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;One store, tagged by exam&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Question IDs already carried the exam (&lt;code&gt;clf-&lt;/code&gt;, &lt;code&gt;saa-&lt;/code&gt;, &lt;code&gt;dva-&lt;/code&gt;), so progress and bookmarks needed no change. Sessions and attempts gained an &lt;code&gt;examId&lt;/code&gt;, and anything saved without one is read as CLF-C02. No data migration, nothing lost.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Database&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Every Supabase table carries &lt;code&gt;exam_id&lt;/code&gt;, with Row Level Security unchanged.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Launch switch&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;An exam only appears on the live site once its guide is marked &lt;code&gt;launched&lt;/code&gt;, so visitors never see an exam without questions.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Pre-rendered pages&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;The home page and each exam's page are now written to HTML at build time, so link previews and search engines see the right title and content. React takes over the HTML in the browser. Still a static site, no server.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  🧾 Honest notes
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;⚠️ CloudPrep is &lt;strong&gt;not affiliated with or endorsed by AWS&lt;/strong&gt;. A practice score doesn't predict or guarantee an official result.&lt;/li&gt;
&lt;li&gt;📊 It shows the &lt;strong&gt;percentage you got right&lt;/strong&gt;, against each exam's passing score as a benchmark. It does not estimate AWS's scaled 100–1,000 score.&lt;/li&gt;
&lt;li&gt;✍️ Questions are &lt;strong&gt;original&lt;/strong&gt;, written with AI assistance from public AWS docs and checked against the pages they cite.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🚀 Try it and tell me what you think
&lt;/h2&gt;

&lt;p&gt;Preparing for Solutions Architect, Developer or Cloud Practitioner? Give it a go:&lt;/p&gt;

&lt;h3&gt;
  
  
  👉 &lt;a href="https://aws-cloud-prepare.vercel.app/" rel="noopener noreferrer"&gt;aws-cloud-prepare.vercel.app&lt;/a&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;💬 Found a question that's wrong, unclear or out of date? Tell me in the comments. AWS changes fast, and I'd rather fix it.&lt;/li&gt;
&lt;li&gt;🗳️ Which AWS exam should come next?&lt;/li&gt;
&lt;li&gt;⭐ If it helps you, share it with someone who's preparing.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Good luck with your exam! ☁️&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Preparing for frontend interviews too? Check out&lt;/em&gt; &lt;a href="https://frontend-interview-prepare.vercel.app/" rel="noopener noreferrer"&gt;&lt;strong&gt;&lt;em&gt;Frontend Interview Prep&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt;&lt;em&gt;, with React and JavaScript interview questions and answers.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Made by Shubham Chaudhary ·&lt;/em&gt; &lt;a href="https://shubhamworks.vercel.app/" rel="noopener noreferrer"&gt;&lt;em&gt;Portfolio&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>cloud</category>
      <category>awscertification</category>
      <category>react</category>
    </item>
    <item>
      <title>I Turned My Portfolio Into a Desktop You Can Actually Use 🖥️</title>
      <dc:creator>Shubham Chaudhary</dc:creator>
      <pubDate>Mon, 09 Nov 2026 10:36:49 +0000</pubDate>
      <link>https://dev.to/shubham_works/i-turned-my-portfolio-into-a-desktop-you-can-actually-use-9gc</link>
      <guid>https://dev.to/shubham_works/i-turned-my-portfolio-into-a-desktop-you-can-actually-use-9gc</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://shubham-works.hashnode.dev/i-turned-my-portfolio-into-a-desktop-you-can-actually-use" rel="noopener noreferrer"&gt;https://shubham-works.hashnode.dev&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Drag windows. Open a Terminal. Travel back to 1995. Beat a global high score.&lt;/strong&gt; It's still my portfolio. You just get to &lt;em&gt;play&lt;/em&gt; with it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;🔗 &lt;strong&gt;Try it live →&lt;/strong&gt; &lt;a href="https://shubhamworks.vercel.app" rel="noopener noreferrer"&gt;&lt;strong&gt;shubhamworks.vercel.app&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  ⚡ TL;DR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A portfolio built as an &lt;strong&gt;interactive desktop&lt;/strong&gt; on computers and a &lt;strong&gt;Home Screen&lt;/strong&gt; on phones&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Next.js App Router + TypeScript (strict) + plain CSS.&lt;/strong&gt; No Tailwind, no UI library&lt;/li&gt;
&lt;li&gt;A real &lt;strong&gt;genie minimize effect&lt;/strong&gt; that I like the most&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;global top score&lt;/strong&gt; you can't fake by sending &lt;code&gt;{ "score": 999999 }&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;like button&lt;/strong&gt; with a shared count that's hard to game&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lighthouse accessibility: 100&lt;/strong&gt; on desktop and phone&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🤔 Why not just another scrolling page?
&lt;/h2&gt;

&lt;p&gt;Most developer portfolios follow the same script:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Hero  →  About  →  Projects  →  Contact
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Mine did too. Then I asked myself one question:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;What would make someone actually spend two minutes on it?&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The answer: &lt;strong&gt;let them use it.&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;💻 On a computer&lt;/th&gt;
&lt;th&gt;📱 On a phone&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A desktop with a Dock&lt;/td&gt;
&lt;td&gt;A Home Screen with app icons&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Windows you can drag, resize, minimize and zoom&lt;/td&gt;
&lt;td&gt;A tab bar&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A menu bar and a few apps&lt;/td&gt;
&lt;td&gt;Bottom sheets&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Underneath, it's still my portfolio: &lt;strong&gt;about, experience, projects, skills and contact, all in one window.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I'm a Full Stack Engineer with 4 years of React, Next.js and Node.js. This project was a good excuse to go deep on the parts of frontend I enjoy most: &lt;strong&gt;rendering, animation and the small details that make an interface feel right.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  🧩 What's inside
&lt;/h2&gt;

&lt;h3&gt;
  
  
  🗂️ The Portfolio Window
&lt;/h3&gt;

&lt;p&gt;One scrolling window with a sidebar (&lt;strong&gt;Home, About, Projects, Skills, Contact&lt;/strong&gt;). It's not a separate window per section. I tried to keep it a portfolio first.&lt;/p&gt;

&lt;h3&gt;
  
  
  ⌨️ Terminal
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;help&lt;/code&gt; · &lt;code&gt;whoami&lt;/code&gt; · &lt;code&gt;skills&lt;/code&gt; · &lt;code&gt;projects&lt;/code&gt; · &lt;code&gt;resume&lt;/code&gt; · &lt;code&gt;links&lt;/code&gt;... and &lt;strong&gt;three hidden commands&lt;/strong&gt;. &lt;code&gt;help&lt;/code&gt; tells you they exist. &lt;code&gt;hint&lt;/code&gt; gives you clues, never the answer. 🕵️&lt;/p&gt;

&lt;h3&gt;
  
  
  🌌 Time Machine
&lt;/h3&gt;

&lt;p&gt;My life as a stack of "desktop snapshots" from &lt;strong&gt;1995 to today&lt;/strong&gt;, in a 3D starfield. Scroll back in time and the stars warp into streaks while you travel. &lt;em&gt;Psst... try going back before 1995.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  📊 Activity Monitor
&lt;/h3&gt;

&lt;p&gt;My skills as &lt;strong&gt;running processes&lt;/strong&gt;, with a live load graph and a "Used in" view that lists the jobs and projects where each skill shows up.&lt;/p&gt;

&lt;h3&gt;
  
  
  🐞 Debug Runner
&lt;/h3&gt;

&lt;p&gt;A small runner game:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🦗 Hop the &lt;strong&gt;bugs&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;🧠 Long-jump the &lt;strong&gt;memory leaks&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;🚫 Stay under the &lt;strong&gt;404s&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;☕ Grab &lt;strong&gt;coffee&lt;/strong&gt; for "hotfix mode"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It has a &lt;strong&gt;top score shared by every visitor&lt;/strong&gt;. 🏆&lt;/p&gt;

&lt;h3&gt;
  
  
  ⚙️ System Settings
&lt;/h3&gt;

&lt;p&gt;Light / Dark / Auto, &lt;strong&gt;8 gradient wallpapers&lt;/strong&gt; I made, and Larger Text.&lt;/p&gt;

&lt;h3&gt;
  
  
  📄 A Resume "Installer"
&lt;/h3&gt;

&lt;p&gt;A four-step wizard (with a license agreement joke 😄) that ends in the PDF download.&lt;/p&gt;

&lt;h3&gt;
  
  
  ❤️ A Like Button
&lt;/h3&gt;

&lt;p&gt;A heart with a &lt;strong&gt;like count shared by every visitor&lt;/strong&gt;: in the status bar on computers, in the title bar on phones.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;😊 Like it and a thank-you notification pops up with a random happy emoji&lt;/li&gt;
&lt;li&gt;💔 Change your mind? Click again to take it back, and a sad face stands in for the heart for a moment&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🛠️ How it's built
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The stack
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Layer&lt;/th&gt;
&lt;th&gt;Choice&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Framework&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Next.js&lt;/strong&gt; (App Router)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Language&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;TypeScript&lt;/strong&gt;, strict mode&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Styling&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Plain CSS&lt;/strong&gt;: no Tailwind, no CSS-in-JS, no UI library&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Runtime deps&lt;/td&gt;
&lt;td&gt;Only Next, React and Vercel's analytics packages&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Backend storage&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Upstash Redis&lt;/strong&gt; via Next.js route handlers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Testing&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Playwright&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h3&gt;
  
  
  1️⃣ Server Components for content, one client component for the desktop
&lt;/h3&gt;

&lt;p&gt;A desktop UI is very interactive, so it's tempting to make &lt;strong&gt;everything&lt;/strong&gt; a client component. But then the content only shows up after JavaScript runs. That's bad for search engines and for slow phones.&lt;/p&gt;

&lt;p&gt;So I split it up:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Server  ──►  Every portfolio section is a React Server Component
              (all the text is in the server HTML)
                        │
                        ▼  passed as props
Client  ──►  One client root that runs the desktop
              (decides which sections a tab shows, and in what order)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;💡 &lt;strong&gt;The server owns the content. The client owns the behavior.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  2️⃣ A real genie effect, without killing the frame rate
&lt;/h3&gt;

&lt;p&gt;Minimizing a window into the Dock with a "genie" effect was &lt;strong&gt;the hardest part&lt;/strong&gt; of the whole project.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How it works:&lt;/strong&gt; the window is copied into &lt;strong&gt;10–16 horizontal strips&lt;/strong&gt;. On every frame, each strip gets a &lt;code&gt;matrix3d&lt;/code&gt; transform that maps its rectangle onto its slice of a curved funnel leading into the Dock icon.&lt;/p&gt;

&lt;p&gt;My first version used &lt;code&gt;clip-path&lt;/code&gt; and kept the sidebar's background blur on the copies. &lt;strong&gt;It lagged badly.&lt;/strong&gt; 🐌&lt;/p&gt;

&lt;p&gt;Here's what fixed it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🎯 &lt;strong&gt;Transform only.&lt;/strong&gt; Nothing changes size or repaints per frame, so the GPU just moves layers.&lt;/li&gt;
&lt;li&gt;🔮 &lt;strong&gt;Prepare before the click.&lt;/strong&gt; When the mouse rests on the window buttons for ~80ms, the copies are already built (invisibly), so the click only has to start the motion.&lt;/li&gt;
&lt;li&gt;✂️ &lt;strong&gt;Do less on click.&lt;/strong&gt; The rest of the desktop (Dock, menu bar) hears about the minimize when the animation &lt;em&gt;lands&lt;/em&gt;, not when it starts.&lt;/li&gt;
&lt;li&gt;🐛 &lt;strong&gt;One surprising CSS bug.&lt;/strong&gt; A selector that ended in a plain tag name (&lt;code&gt;span&lt;/code&gt;) made Chrome restyle &lt;strong&gt;every span on the page&lt;/strong&gt;, including ~870 elements in the copies, on every animation. Switching it to a class fixed it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Zooming a window had a similar story: Chrome was redrawing all the text in the window on every frame. Giving the content its own GPU layers (&lt;code&gt;will-change: transform&lt;/code&gt;) during the glide fixed it.&lt;/p&gt;

&lt;h4&gt;
  
  
  📉 The numbers (measured on my laptop)
&lt;/h4&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;What&lt;/th&gt;
&lt;th&gt;Before&lt;/th&gt;
&lt;th&gt;After&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Pause between click and minimize motion&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;~58ms&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;~9ms&lt;/strong&gt; ✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Drawing time per zoom (integrated graphics)&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;~300ms&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;~90ms&lt;/strong&gt; ✅&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;♿ All of this is skipped under &lt;code&gt;prefers-reduced-motion&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  3️⃣ A game loop that runs the same on every screen
&lt;/h3&gt;

&lt;p&gt;My first version of the game moved things a fixed amount &lt;strong&gt;per frame&lt;/strong&gt;. On a 120Hz screen, it ran &lt;strong&gt;twice as fast&lt;/strong&gt;. 😅&lt;/p&gt;

&lt;p&gt;The fix:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;position += speed × timeSinceLastFrame
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Everything now moves &lt;strong&gt;per second&lt;/strong&gt;, so it plays the same at 60Hz and 120Hz.&lt;/p&gt;




&lt;h3&gt;
  
  
  4️⃣ A global top score that's hard to fake
&lt;/h3&gt;

&lt;p&gt;The site has a tiny backend: a &lt;strong&gt;like counter&lt;/strong&gt; and the &lt;strong&gt;game's top score&lt;/strong&gt;, both in Upstash Redis through Next.js route handlers (plain &lt;code&gt;fetch&lt;/code&gt; to Upstash's REST API, no client library).&lt;/p&gt;

&lt;p&gt;A shared high score is an open invitation to send this:&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="nl"&gt;"score"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;999999&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So instead of trusting the browser:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; 1. Run starts   ──►  Server hands out a TICKET
                      { start time + random id }, signed with HMAC
                      (no database write)

 2. Game over    ──►  Server checks:
                      ✔ the signature is valid
                      ✔ score ≤ what the elapsed time allows
                        (the game earns exactly 10 points/second, plus a little slack)

 3. Submitted    ──►  Each ticket counts once
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;🔒 &lt;strong&gt;Faking a top score now takes as long as playing for it.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And the player never waits: the game shows the new record &lt;strong&gt;the moment you break it&lt;/strong&gt; and saves it in the background. If the server says no, the old score comes back.&lt;/p&gt;




&lt;h3&gt;
  
  
  5️⃣ A like counter that's hard to abuse
&lt;/h3&gt;

&lt;p&gt;The same tiny backend counts likes. A like button sounds trivial until you ask: &lt;em&gt;what stops someone from liking 1,000 times, or "unliking" everyone else's likes?&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; Like     ──►  Server adds one and hands back a random id
              (the browser keeps it, so it knows it liked)

 Unlike   ──►  Browser sends that id back
              ✔ the count only drops if the server handed out
                that id and it wasn't taken back yet

 Spam     ──►  Each network gets up to 5 likes a day
              (offices and mobile networks share one IP, so it isn't 1)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;🔐 The IP is stored only as a &lt;strong&gt;keyed hash&lt;/strong&gt; that expires after a day, &lt;strong&gt;never the raw address&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;⚡ The heart reacts &lt;strong&gt;instantly&lt;/strong&gt; and the count settles on the server's total; if a request fails, the change is undone&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;🙅 &lt;strong&gt;Made-up or repeated requests can't remove anyone else's like.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  6️⃣ No flash of the wrong theme
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Saved settings (theme, wallpaper, larger text) are read through &lt;code&gt;useSyncExternalStore&lt;/code&gt; with a server snapshot, so there are &lt;strong&gt;no hydration mismatches&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;A tiny &lt;strong&gt;inline script&lt;/strong&gt; applies the saved theme before the first paint, so dark mode users never see a white flash. 🌙&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  7️⃣ Accessible, even though it looks like a desktop
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;⌨️ Menus, tabs, dialogs and window buttons all work from the &lt;strong&gt;keyboard&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;🔁 Focus &lt;strong&gt;returns where it came from&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;🎨 Colors pass &lt;strong&gt;WCAG AA&lt;/strong&gt; (the classic system blue fails for small text, so I used a darker one)&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;🏅 &lt;strong&gt;Lighthouse accessibility: 100&lt;/strong&gt; on desktop &lt;em&gt;and&lt;/em&gt; phone.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  8️⃣ Tested in a real browser
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Playwright&lt;/strong&gt; tests run at desktop and phone sizes and cover:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;startup screen&lt;/code&gt; · &lt;code&gt;windows&lt;/code&gt; · &lt;code&gt;Terminal&lt;/code&gt; · &lt;code&gt;Time Machine&lt;/code&gt; · &lt;code&gt;contact form&lt;/code&gt; · &lt;code&gt;likes&lt;/code&gt; · &lt;code&gt;game top score&lt;/code&gt; · &lt;code&gt;phone layout&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The tests point the database at a dead address and stub the APIs, so they can &lt;strong&gt;never change the real like count&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  🤖 Built with AI
&lt;/h2&gt;

&lt;p&gt;I built this with AI coding assistants, and I'm not going to pretend otherwise. An animation like the genie effect gives it away.&lt;/p&gt;

&lt;p&gt;AI helped write much of the code. &lt;strong&gt;My part was the product:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🧭 Deciding what the site should be&lt;/li&gt;
&lt;li&gt;📱 Testing every change on my laptop and phone&lt;/li&gt;
&lt;li&gt;🗣️ Reporting what felt off&lt;/li&gt;
&lt;li&gt;✂️ Cutting whatever didn't earn its place&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It's still a lot of judgment calls, and &lt;strong&gt;every one of them is mine.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  📚 What I learned
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;1. Measure before you optimize.&lt;/strong&gt; The slow parts weren't where they looked. The sidebar blur and the shadow seemed like obvious suspects, but they weren't the cost. Chrome's performance panel showed layout on click and text redraws.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Server Components and rich interactivity mix well&lt;/strong&gt; ...when the server owns the content and the client owns the behavior.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Never trust the client, but don't make it wait either.&lt;/strong&gt; Show the result at once, let the server decide, and undo gracefully.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Cut things.&lt;/strong&gt; I built and removed an achievement system, a music player and a startup chime. The site is better without them.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  🚀 Try it
&lt;/h2&gt;

&lt;h3&gt;
  
  
  👉 &lt;a href="https://shubhamworks.vercel.app" rel="noopener noreferrer"&gt;shubhamworks.vercel.app&lt;/a&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;⌨️ Open the &lt;strong&gt;Terminal&lt;/strong&gt; and type &lt;code&gt;help&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;🌌 Go back to &lt;strong&gt;1995&lt;/strong&gt; in the Time Machine&lt;/li&gt;
&lt;li&gt;🏆 Try to beat the &lt;strong&gt;top score&lt;/strong&gt; in Debug Runner&lt;/li&gt;
&lt;li&gt;❤️ And if you enjoyed it, &lt;strong&gt;leave a like&lt;/strong&gt;: it's the heart at the bottom of the window (top right on phones)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;I'd love to hear what you think, and what you'd add or remove.&lt;/strong&gt; Drop it in the comments 👇&lt;/p&gt;




&lt;p&gt;&lt;em&gt;💼 P.S. If you're hiring: I'm open to&lt;/em&gt; &lt;strong&gt;&lt;em&gt;Full Stack / Frontend roles&lt;/em&gt;&lt;/strong&gt;&lt;em&gt;. Reach me through the Contact section on the site or on LinkedIn.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>react</category>
      <category>typescript</category>
      <category>css</category>
    </item>
    <item>
      <title>I Built a Free AWS Cloud Practitioner (CLF-C02) Exam Simulator: 2,000 Questions, Timed Mocks and an AI Proctor</title>
      <dc:creator>Shubham Chaudhary</dc:creator>
      <pubDate>Wed, 04 Nov 2026 14:07:31 +0000</pubDate>
      <link>https://dev.to/shubham_works/i-built-a-free-aws-cloud-practitioner-clf-c02-exam-simulator-2000-questions-timed-mocks-and-an-2jm9</link>
      <guid>https://dev.to/shubham_works/i-built-a-free-aws-cloud-practitioner-clf-c02-exam-simulator-2000-questions-timed-mocks-and-an-2jm9</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;🆕 &lt;strong&gt;Update (November 2026):&lt;/strong&gt; CloudPrep now covers &lt;strong&gt;three AWS exams&lt;/strong&gt;. Solutions Architect – Associate (SAA-C03) and Developer – Associate (DVA-C03) joined Cloud Practitioner (CLF-C02), with 1,000 questions each.&lt;/p&gt;

&lt;p&gt;👉 Read what's new: &lt;a href="https://dev.to/shubham_works/cloudprep-now-covers-aws-solutions-architect-saa-c03-and-developer-dva-c03-1000-free-practice-5fei"&gt;CloudPrep Now Covers SAA-C03 and DVA-C03&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; &lt;a href="https://aws-cloud-prepare.vercel.app/" rel="noopener noreferrer"&gt;&lt;strong&gt;CloudPrep&lt;/strong&gt;&lt;/a&gt; is a free practice simulator for three AWS certification exams: &lt;strong&gt;Cloud Practitioner (CLF-C02)&lt;/strong&gt;, &lt;strong&gt;Solutions Architect – Associate (SAA-C03)&lt;/strong&gt; and &lt;strong&gt;Developer – Associate (DVA-C03)&lt;/strong&gt;. It has 4,000 original questions, an explanation for every option, real-format 65-question mock exams, and an optional on-device AI proctor. No ads, no paywall.&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;Try it:&lt;/strong&gt; &lt;a href="https://aws-cloud-prepare.vercel.app/" rel="noopener noreferrer"&gt;aws-cloud-prepare.vercel.app&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  🤔 Why I built it
&lt;/h2&gt;

&lt;p&gt;CloudPrep started as my own preparation tool for the CLF-C02 exam. I wanted practice that felt like the &lt;strong&gt;real exam&lt;/strong&gt;: the same length, the same timing, the same pressure. I also wanted every answer explained and backed by an AWS source.&lt;/p&gt;

&lt;p&gt;So I built it, and then made it a free, public product so anyone preparing for the exam can use it too. Since then it has grown to cover the Solutions Architect and Developer Associate exams as well.&lt;/p&gt;




&lt;h2&gt;
  
  
  📊 CloudPrep at a glance
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;📚 4,000&lt;/th&gt;
&lt;th&gt;🎓 3&lt;/th&gt;
&lt;th&gt;⏱️ 65&lt;/th&gt;
&lt;th&gt;💸 Free&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;original questions, each option explained&lt;/td&gt;
&lt;td&gt;AWS exams: CLF-C02, SAA-C03 and DVA-C03&lt;/td&gt;
&lt;td&gt;questions per mock, timed like the real exam (90 or 130 minutes)&lt;/td&gt;
&lt;td&gt;no ads, no paywall&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Exam&lt;/th&gt;
&lt;th&gt;Mock exam&lt;/th&gt;
&lt;th&gt;Questions in CloudPrep&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Cloud Practitioner (CLF-C02)&lt;/td&gt;
&lt;td&gt;65 questions, 90 minutes&lt;/td&gt;
&lt;td&gt;2,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Solutions Architect – Associate (SAA-C03)&lt;/td&gt;
&lt;td&gt;65 questions, 130 minutes&lt;/td&gt;
&lt;td&gt;1,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Developer – Associate (DVA-C03)&lt;/td&gt;
&lt;td&gt;65 questions, 130 minutes&lt;/td&gt;
&lt;td&gt;1,000&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The CLF-C02 questions are split across its four domains:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Domain&lt;/th&gt;
&lt;th&gt;Exam weight&lt;/th&gt;
&lt;th&gt;Questions in CloudPrep&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1. Cloud Concepts&lt;/td&gt;
&lt;td&gt;24%&lt;/td&gt;
&lt;td&gt;400&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2. Security and Compliance&lt;/td&gt;
&lt;td&gt;30%&lt;/td&gt;
&lt;td&gt;600&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3. Cloud Technology and Services&lt;/td&gt;
&lt;td&gt;34%&lt;/td&gt;
&lt;td&gt;753&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4. Billing, Pricing, and Support&lt;/td&gt;
&lt;td&gt;12%&lt;/td&gt;
&lt;td&gt;247&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;SAA-C03 and DVA-C03 each have 1,000 questions across their four domains.&lt;/p&gt;




&lt;h2&gt;
  
  
  ✨ What you can do with it
&lt;/h2&gt;

&lt;p&gt;Pick your exam from the exam switcher at the top. Your progress, bookmarks and exam history are kept separately for each exam.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. 📖 Learning mode: practise at your own pace
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fh0s4pr3ykqyfljh54g8x.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%2Fh0s4pr3ykqyfljh54g8x.png" alt="Learning mode showing a checked answer with its explanation" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Untimed practice&lt;/strong&gt; by domain or topic&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Instant feedback&lt;/strong&gt; with an explanation for &lt;em&gt;every&lt;/em&gt; option, not just the correct one&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Links to the AWS documentation&lt;/strong&gt; each question is based on&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bookmarks&lt;/strong&gt; for questions you want to revisit&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Review due:&lt;/strong&gt; missed questions come back on a schedule so you see them again before you forget them
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Review schedule:  1 day → 3 days → 7 days → 21 days → 60 days
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;💡 Learning mode works &lt;strong&gt;without an account&lt;/strong&gt;. Just open the site and start practising.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  2. ⏱️ Timed mock exams: the real thing, before the real thing
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzuzkg7bxj4wq7149c00h.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%2Fzuzkg7bxj4wq7149c00h.png" alt="A mock exam question with the timer and answer sheet in dark mode" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;65 questions&lt;/strong&gt; per mock: &lt;strong&gt;90 minutes&lt;/strong&gt; for CLF-C02, &lt;strong&gt;130 minutes&lt;/strong&gt; for SAA-C03 and DVA-C03, following each exam's domain weightings&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Flag questions&lt;/strong&gt;, jump around with a &lt;strong&gt;question grid&lt;/strong&gt;, and do a &lt;strong&gt;final review&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Auto-submit&lt;/strong&gt; when the timer runs out&lt;/li&gt;
&lt;li&gt;An &lt;strong&gt;exam-paper style answer sheet&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;The timer counts down to a fixed end time, so it &lt;strong&gt;survives reloads&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. 📈 Results that tell you what to fix
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Practice score with a &lt;strong&gt;per-domain breakdown&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Answer review&lt;/strong&gt; with explanations&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Exam history&lt;/strong&gt; and progress guidance across attempts&lt;/li&gt;
&lt;li&gt;The dashboard &lt;strong&gt;flags your weakest domain&lt;/strong&gt; and shows the time used in recent exams&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. 🤖 AI-proctored exams (opt-in)
&lt;/h3&gt;

&lt;p&gt;Want to train under real exam conditions? Turn on the AI proctor.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A &lt;strong&gt;check-in&lt;/strong&gt;, like an online proctored exam&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MediaPipe face and object models&lt;/strong&gt; plus microphone loudness, all running &lt;strong&gt;on your device&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;It watches your face, head, eyes and mouth, looks for &lt;strong&gt;phones, other people, books and screens&lt;/strong&gt;, and blocks shortcuts&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Two warnings, then the exam ends.&lt;/strong&gt; A phone or another person ends it at once.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;🔒 &lt;strong&gt;Nothing is recorded or uploaded.&lt;/strong&gt; It all runs in your browser.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;There's also a lighter &lt;strong&gt;strict mode&lt;/strong&gt; that asks for fullscreen and logs tab and focus changes, without judging them.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. ☁️ Sync across devices
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Sign in with Google&lt;/strong&gt; to save your progress, bookmarks, exam history, the exam in progress and settings to your account&lt;/li&gt;
&lt;li&gt;Everything &lt;strong&gt;follows you to every device&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;A copy is kept in the browser, so it &lt;strong&gt;stays fast and works offline&lt;/strong&gt;. Changes sync when you're back online.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  6. 🎨 Designed for long study sessions
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Light theme and a &lt;strong&gt;true-black dark theme&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Serif titles, rounded cards and an exam-paper answer sheet&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Add to Home Screen&lt;/strong&gt; support with its own icons&lt;/li&gt;
&lt;li&gt;Automated &lt;strong&gt;axe accessibility checks (WCAG 2.2 AA rules)&lt;/strong&gt; pass on every page, in both themes&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  👥 Guest vs signed in
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;Guest&lt;/th&gt;
&lt;th&gt;Signed in (Google)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Learning mode&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Bookmarks and settings&lt;/td&gt;
&lt;td&gt;✅ (this browser only)&lt;/td&gt;
&lt;td&gt;✅ (synced)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Timed mock exams&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Dashboard, history and progress&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Sync across devices&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  🛠️ Tech stack
&lt;/h2&gt;

&lt;p&gt;For the developers reading this, here's what's under the hood:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Layer&lt;/th&gt;
&lt;th&gt;Tech&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Frontend&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;React 19, TypeScript (strict), Vite 8, Tailwind CSS 4, React Router&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Backend&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Supabase only: Postgres with Row Level Security + Supabase Auth (Google). No separate API server.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Data&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Questions loaded at runtime and cached in &lt;strong&gt;IndexedDB&lt;/strong&gt;; user data in a versioned &lt;code&gt;localStorage&lt;/code&gt; layer, synced to Supabase when signed in&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;AI proctor&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;MediaPipe face and object models, running on-device&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Testing&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Vitest + Testing Library (database schema and security rules run in &lt;strong&gt;PGlite&lt;/strong&gt;), Playwright + axe for E2E and accessibility&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Hosting&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Vercel (static site; the public pages are pre-rendered at build time)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  🧾 Honest notes
&lt;/h2&gt;

&lt;p&gt;I'd rather you trust it for the right reasons, so:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;⚠️ CloudPrep is &lt;strong&gt;not affiliated with or endorsed by AWS&lt;/strong&gt;. A practice score doesn't predict or guarantee an official result.&lt;/li&gt;
&lt;li&gt;📊 It shows the &lt;strong&gt;percentage you got right&lt;/strong&gt;. It does not estimate AWS's scaled 100–1,000 score.&lt;/li&gt;
&lt;li&gt;✍️ The questions are &lt;strong&gt;original&lt;/strong&gt;, written with AI assistance from public AWS documentation and each exam's official guide, then checked against the pages they cite. They are &lt;strong&gt;not&lt;/strong&gt; copied from the real exam or from dumps.&lt;/li&gt;
&lt;li&gt;✅ CLF-C02: 1,995 of the 2,000 questions are checked against their AWS sources; 5 are still marked unverified.&lt;/li&gt;
&lt;li&gt;✅ SAA-C03 and DVA-C03: all 1,000 questions in each are checked against their AWS sources.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🚀 Try it and tell me what you think
&lt;/h2&gt;

&lt;p&gt;If you're preparing for an AWS exam (Cloud Practitioner, Solutions Architect – Associate or Developer – Associate), give it a go:&lt;/p&gt;

&lt;h3&gt;
  
  
  👉 &lt;a href="https://aws-cloud-prepare.vercel.app/" rel="noopener noreferrer"&gt;aws-cloud-prepare.vercel.app&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;I'd love your feedback:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;💬 Found a question that's wrong or unclear? Tell me in the comments.&lt;/li&gt;
&lt;li&gt;🐛 Something broken on your browser or device? Let me know.&lt;/li&gt;
&lt;li&gt;⭐ If it helps you, share it with someone who's preparing for an AWS exam.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Good luck with your exam! ☁️&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Preparing for frontend interviews too? Check out&lt;/em&gt; &lt;a href="https://frontend-interview-prepare.vercel.app/" rel="noopener noreferrer"&gt;&lt;strong&gt;&lt;em&gt;Frontend Interview Prep&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt;&lt;em&gt;, with React and JavaScript interview questions and answers.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Made by Shubham Chaudhary ·&lt;/em&gt; &lt;a href="https://shubhamworks.vercel.app/" rel="noopener noreferrer"&gt;&lt;em&gt;Portfolio&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>cloud</category>
      <category>awscertification</category>
      <category>react</category>
    </item>
    <item>
      <title>Your node_modules Is an Attack Surface: A Practical npm Security Checklist for 2026</title>
      <dc:creator>Shubham Chaudhary</dc:creator>
      <pubDate>Tue, 03 Nov 2026 07:33:47 +0000</pubDate>
      <link>https://dev.to/shubham_works/your-nodemodules-is-an-attack-surface-a-practical-npm-security-checklist-for-2026-4akf</link>
      <guid>https://dev.to/shubham_works/your-nodemodules-is-an-attack-surface-a-practical-npm-security-checklist-for-2026-4akf</guid>
      <description>&lt;p&gt;On March 31, 2026, someone hijacked the npm account of axios's lead maintainer. Axios is an HTTP client with over 100 million weekly downloads. The attacker skipped the project's CI pipeline and published two malicious versions directly from the npm CLI.&lt;/p&gt;

&lt;p&gt;Those versions didn't touch axios's own code. They added one new dependency, &lt;code&gt;plain-crypto-js&lt;/code&gt;, which existed only to run a &lt;code&gt;postinstall&lt;/code&gt; script. That script contacted a command-and-control server and dropped a remote access trojan on the machine.&lt;/p&gt;

&lt;p&gt;All of this happened during &lt;code&gt;npm install&lt;/code&gt;, before any application code ran.&lt;/p&gt;

&lt;p&gt;The malicious versions were live for about four hours. Any fresh install or auto-update in that window could have pulled them.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💀 &lt;strong&gt;You didn't install malware. You ran&lt;/strong&gt; &lt;code&gt;npm install&lt;/code&gt;&lt;strong&gt;.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This post covers what happened in 2026, how these attacks work, and a checklist you can apply to your project in about 30 minutes. 👇&lt;/p&gt;




&lt;h2&gt;
  
  
  📅 2026 So Far: A Quick Recap
&lt;/h2&gt;

&lt;p&gt;Axios wasn't a one-off. Here are some of the year's major incidents:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Date&lt;/th&gt;
&lt;th&gt;Target&lt;/th&gt;
&lt;th&gt;How&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Mar 31&lt;/td&gt;
&lt;td&gt;&lt;code&gt;axios&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Maintainer account hijacked; malicious dependency with a postinstall script&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Apr 22&lt;/td&gt;
&lt;td&gt;&lt;code&gt;@bitwarden/cli&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Preinstall script downloaded the Bun runtime and ran a credential stealer&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Apr 29&lt;/td&gt;
&lt;td&gt;SAP CAP packages (&lt;code&gt;@cap-js/*&lt;/code&gt;, &lt;code&gt;mbt&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;"Mini Shai-Hulud" worm, preinstall hook&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;May 11&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;@tanstack/*&lt;/code&gt; and others&lt;/td&gt;
&lt;td&gt;Abused a &lt;code&gt;pull_request_target&lt;/code&gt; workflow and poisoned the GitHub Actions cache to steal an OIDC token; published with valid provenance&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;May 19&lt;/td&gt;
&lt;td&gt;&lt;code&gt;@antv/*&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Compromised maintainer account; ~639 malicious versions across 323 packages in about an hour&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Jun 1&lt;/td&gt;
&lt;td&gt;&lt;code&gt;@redhat-cloud-services/*&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Compromised employee GitHub account pushed commits that bypassed code review&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Jun 3&lt;/td&gt;
&lt;td&gt;57+ packages&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;binding.gyp&lt;/code&gt; campaign; 286+ malicious versions in under two hours&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Jul 14&lt;/td&gt;
&lt;td&gt;AsyncAPI packages&lt;/td&gt;
&lt;td&gt;Commits pushed to unprotected pre-release branches; CI exposed &lt;code&gt;NPM_TOKEN&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;📈 The pattern is clear: attacks are faster, automated, and increasingly target the CI pipeline instead of just individual developers.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧠 How These Attacks Actually Work
&lt;/h2&gt;

&lt;p&gt;Most incidents combine a few of these techniques.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. 🔓 Account Takeover
&lt;/h3&gt;

&lt;p&gt;A maintainer gets phished or has a token leaked, and the attacker publishes a "new version" of a trusted package.&lt;/p&gt;

&lt;p&gt;Your &lt;code&gt;^1.2.0&lt;/code&gt; range happily accepts it.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. 📜 Install Scripts
&lt;/h3&gt;

&lt;p&gt;npm runs &lt;code&gt;preinstall&lt;/code&gt;, &lt;code&gt;install&lt;/code&gt;, and &lt;code&gt;postinstall&lt;/code&gt; scripts automatically.&lt;/p&gt;

&lt;p&gt;That means arbitrary code on your machine or CI runner, with access to your environment variables, SSH keys, and cloud credentials.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. 🪱 Self-Replication (Worms)
&lt;/h3&gt;

&lt;p&gt;The Shai-Hulud family steals npm tokens and GitHub tokens, then uses them to publish infected versions of other packages the victim maintains.&lt;/p&gt;

&lt;p&gt;One compromised developer becomes dozens of compromised packages.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. 🏭 CI/CD Compromise
&lt;/h3&gt;

&lt;p&gt;The TanStack attack needed no stolen password.&lt;/p&gt;

&lt;p&gt;The attacker abused a GitHub Actions workflow to extract a publishing token from the runner. Because the package was built by the real pipeline, it carried valid provenance.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. 🎭 Typosquatting and Dependency Confusion
&lt;/h3&gt;

&lt;p&gt;Look-alike package names (&lt;code&gt;reacct-dom&lt;/code&gt;), or a public package with the same name as your private one.&lt;/p&gt;

&lt;h3&gt;
  
  
  🕵️ What Do Attackers Steal?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;🔑 npm and GitHub tokens&lt;/li&gt;
&lt;li&gt;☁️ Cloud credentials (AWS, GCP, Azure)&lt;/li&gt;
&lt;li&gt;☸️ Kubernetes tokens&lt;/li&gt;
&lt;li&gt;🗝️ SSH keys&lt;/li&gt;
&lt;li&gt;⚙️ CI/CD secrets&lt;/li&gt;
&lt;li&gt;📄 &lt;code&gt;.env&lt;/code&gt; contents&lt;/li&gt;
&lt;li&gt;🔐 Password manager data&lt;/li&gt;
&lt;li&gt;🤖 AI tool configuration files&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Some of the 2026 attack waves targeted credentials and configuration data beyond traditional development secrets.&lt;/p&gt;




&lt;h2&gt;
  
  
  📋 The Checklist
&lt;/h2&gt;

&lt;p&gt;Here are practical steps you can take to reduce your exposure.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. 💻 Local Development
&lt;/h2&gt;

&lt;h3&gt;
  
  
  🔒 Commit Your Lockfile, and Review It
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;package-lock.json&lt;/code&gt; (or &lt;code&gt;pnpm-lock.yaml&lt;/code&gt; / &lt;code&gt;yarn.lock&lt;/code&gt;) pins exact versions of your whole dependency tree.&lt;/p&gt;

&lt;p&gt;Treat lockfile changes in a PR as code changes.&lt;/p&gt;

&lt;p&gt;A new, unfamiliar transitive dependency (like &lt;code&gt;plain-crypto-js&lt;/code&gt;) is a red flag. 🚩&lt;/p&gt;

&lt;h3&gt;
  
  
  🚫 Turn Off Install Scripts by Default
&lt;/h3&gt;

&lt;p&gt;Most attacks this year relied on &lt;code&gt;preinstall&lt;/code&gt; or &lt;code&gt;postinstall&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Disable them:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;.npmrc&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;&lt;span class="na"&gt;ignore-scripts&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Some packages genuinely need build scripts (native modules like &lt;code&gt;sharp&lt;/code&gt; or &lt;code&gt;bcrypt&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;Run their scripts explicitly after install:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm rebuild sharp --ignore-scripts=false
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you use pnpm, it already doesn't run dependency build scripts by default (since v10). Approve only the ones you trust with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pnpm approve-builds
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Bun also skips lifecycle scripts unless a package is in &lt;code&gt;trustedDependencies&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  ⏳ Add a Release Cooldown
&lt;/h3&gt;

&lt;p&gt;Malicious versions are usually caught within hours.&lt;/p&gt;

&lt;p&gt;The axios versions were flagged about six minutes after publishing and contained within roughly four hours.&lt;/p&gt;

&lt;p&gt;If your package manager refuses versions newer than a day or two, you skip most of that window.&lt;/p&gt;

&lt;p&gt;All major package managers now support this, but each uses a different unit:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;📦 npm 11.10+ (&lt;/strong&gt;&lt;code&gt;.npmrc&lt;/code&gt;&lt;strong&gt;) — value in DAYS&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;&lt;span class="na"&gt;min-release-age&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;📦 pnpm 10.16+ (&lt;/strong&gt;&lt;code&gt;pnpm-workspace.yaml&lt;/code&gt;&lt;strong&gt;) — value in MINUTES&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;# pnpm 11 defaults to 1440 (24 hours)
&lt;/span&gt;&lt;span class="na"&gt;minimumReleaseAge&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2880&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;📦 Yarn 4.10+ (&lt;/strong&gt;&lt;code&gt;.yarnrc.yml&lt;/code&gt;&lt;strong&gt;) — value in MINUTES&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;npmMinimalAgeGate&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2880&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;📦 Bun (&lt;/strong&gt;&lt;code&gt;bunfig.toml&lt;/code&gt;&lt;strong&gt;) — value in SECONDS&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="k"&gt;[install]&lt;/span&gt;
&lt;span class="na"&gt;minimumReleaseAge&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;172800&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Need an urgent hotfix? 🔥&lt;/p&gt;

&lt;p&gt;Override for one install, e.g.:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm i --min-release-age 0 package@version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🎯 Be Deliberate With Version Ranges
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;^&lt;/code&gt; and &lt;code&gt;~&lt;/code&gt; let new versions in automatically.&lt;/p&gt;

&lt;p&gt;For critical or high-privilege dependencies, consider exact versions and upgrade on purpose.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. 🔍 Auditing
&lt;/h2&gt;

&lt;h3&gt;
  
  
  🩺 Run &lt;code&gt;npm audit&lt;/code&gt; Regularly
&lt;/h3&gt;

&lt;p&gt;It catches known vulnerabilities, not fresh malware, but it's still a baseline.&lt;/p&gt;

&lt;h3&gt;
  
  
  ✍️ Verify Signatures and Provenance
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm audit signatures
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This checks registry signatures and provenance attestations for your installed packages.&lt;/p&gt;

&lt;p&gt;The axios malicious releases were missing the GitHub Actions provenance that legitimate releases had, which was a key signal.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;🚨 But don't treat provenance as proof of safety.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The TanStack and Red Hat packages had valid provenance because the attackers compromised the real build pipeline.&lt;/p&gt;

&lt;h3&gt;
  
  
  📡 Add a Dependency Scanner
&lt;/h3&gt;

&lt;p&gt;Tools like Socket, Snyk, or GitHub's Dependabot alerts watch for suspicious behavior (new install scripts, network calls, obfuscated code) and known-malicious packages.&lt;/p&gt;

&lt;p&gt;Socket flagged the axios release within minutes.&lt;/p&gt;

&lt;h3&gt;
  
  
  🤖 Make Your Update Bots Wait Too
&lt;/h3&gt;

&lt;p&gt;Dependabot and Renovate can open PRs, and trigger CI installs, before a human looks.&lt;/p&gt;

&lt;p&gt;Give them a cooldown:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;.github/dependabot.yml&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;version&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
&lt;span class="na"&gt;updates&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;package-ecosystem&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"npm"&lt;/span&gt;
    &lt;span class="na"&gt;directory&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"/"&lt;/span&gt;
    &lt;span class="na"&gt;schedule&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;interval&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"weekly"&lt;/span&gt;
    &lt;span class="na"&gt;cooldown&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;default-days&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;renovate.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="nl"&gt;"minimumReleaseAge"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"2 days"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Both still let security updates through without the delay.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. 🏗️ CI/CD Security
&lt;/h2&gt;

&lt;h3&gt;
  
  
  🧊 Use Deterministic Installs
&lt;/h3&gt;

&lt;p&gt;Use the appropriate install command for your package manager:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm ci                              &lt;span class="c"&gt;# npm&lt;/span&gt;
pnpm install --frozen-lockfile      &lt;span class="c"&gt;# pnpm&lt;/span&gt;
yarn install --immutable            &lt;span class="c"&gt;# yarn&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These fail if the lockfile and &lt;code&gt;package.json&lt;/code&gt; disagree, instead of silently resolving new versions.&lt;/p&gt;

&lt;h3&gt;
  
  
  🙈 Keep Secrets Away From the Install Step
&lt;/h3&gt;

&lt;p&gt;Don't expose deploy keys or cloud credentials as environment variables during &lt;code&gt;npm ci&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Inject them only into the steps that need them.&lt;/p&gt;

&lt;h3&gt;
  
  
  ⏱️ Use Short-Lived, Least-Privilege Tokens
&lt;/h3&gt;

&lt;p&gt;Avoid long-lived npm tokens in CI.&lt;/p&gt;

&lt;p&gt;If you publish packages, use npm Trusted Publishing (OIDC) and enable 2FA on your npm account.&lt;/p&gt;

&lt;h3&gt;
  
  
  🧱 Harden GitHub Actions
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;⚡ Be very careful with &lt;code&gt;pull_request_target&lt;/code&gt;. It runs with your repo's secrets, and checking out PR code inside it is how the TanStack attack started.&lt;/li&gt;
&lt;li&gt;📌 Pin third-party actions to a full commit SHA, not a tag.&lt;/li&gt;
&lt;li&gt;🌿 Protect all branches that can trigger publishing, including &lt;code&gt;next&lt;/code&gt; or pre-release branches (the AsyncAPI attack used one).&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🌐 Restrict Outbound Network Access
&lt;/h3&gt;

&lt;p&gt;Restrict outbound network access from CI runners where you can, so a payload can't reach its command-and-control server.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. 🚑 Have a Response Plan
&lt;/h2&gt;

&lt;p&gt;If a package you use is compromised:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;🔎 &lt;strong&gt;Identify exposure.&lt;/strong&gt; Check whether any lockfile in your projects resolved to an affected version, and when your machines or CI ran an install.&lt;/li&gt;
&lt;li&gt;🧯 &lt;strong&gt;Isolate before rotating.&lt;/strong&gt; Some 2026 payloads (the TanStack wave) installed a background service that deletes your home directory if it detects the stolen GitHub token was revoked. Clean or reimage affected machines first, then rotate.&lt;/li&gt;
&lt;li&gt;🔄 &lt;strong&gt;Rotate everything the install could see:&lt;/strong&gt; npm tokens, GitHub tokens, cloud keys, SSH keys, and CI/CD secrets.&lt;/li&gt;
&lt;li&gt;🧹 &lt;strong&gt;Rebuild from a clean lockfile&lt;/strong&gt; pinned to a known-good version.&lt;/li&gt;
&lt;li&gt;🎣 &lt;strong&gt;Hunt for unexpected repos, workflows, or package versions&lt;/strong&gt; published from your accounts.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  🧰 Putting It Together: A Hardened Starter Setup
&lt;/h2&gt;

&lt;p&gt;Here's a minimal setup you can drop into a project today.&lt;/p&gt;

&lt;h3&gt;
  
  
  ⚙️ &lt;code&gt;.npmrc&lt;/code&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;&lt;span class="na"&gt;ignore-scripts&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="na"&gt;min-release-age&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;
&lt;span class="na"&gt;save-exact&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🔁 &lt;code&gt;.github/workflows/ci.yml&lt;/code&gt; (Relevant Parts)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;CI&lt;/span&gt;

&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;pull_request&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;        &lt;span class="c1"&gt;# not pull_request_target
&lt;/span&gt;  &lt;span class="na"&gt;push&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;branches&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;main&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="na"&gt;permissions&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;contents&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;read&lt;/span&gt;       &lt;span class="c1"&gt;# least privilege by default
&lt;/span&gt;
&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;build&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@&amp;lt;full-commit-sha&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/setup-node@&amp;lt;full-commit-sha&amp;gt;&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;node-version&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;22&lt;/span&gt;
          &lt;span class="na"&gt;cache&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;npm&lt;/span&gt;

      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Install (no secrets in this step)&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;npm ci&lt;/span&gt;

      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Verify signatures&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;npm audit signatures&lt;/span&gt;

      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Rebuild trusted native deps&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;npm rebuild sharp --ignore-scripts=false&lt;/span&gt;

      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Build &amp;amp; test&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;npm run build &amp;amp;&amp;amp; npm test&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It isn't bulletproof. Nothing is.&lt;/p&gt;

&lt;p&gt;But it closes the paths that most 2026 attacks actually used: install scripts, brand-new malicious versions, silent version drift, and over-privileged CI. 💪&lt;/p&gt;




&lt;h2&gt;
  
  
  🏁 Key Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;🚪 &lt;strong&gt;Install scripts are the #1 entry point.&lt;/strong&gt; Disable them by default and allowlist the few you need.&lt;/li&gt;
&lt;li&gt;⌛ &lt;strong&gt;Time is your cheapest defense.&lt;/strong&gt; A 1–2 day cooldown would have skipped most of this year's malicious releases.&lt;/li&gt;
&lt;li&gt;🔐 &lt;strong&gt;Lockfiles plus&lt;/strong&gt; &lt;code&gt;npm ci&lt;/code&gt; &lt;strong&gt;stop silent changes&lt;/strong&gt; to your dependency tree.&lt;/li&gt;
&lt;li&gt;🧾 &lt;strong&gt;Provenance helps, but it isn't proof.&lt;/strong&gt; Compromised pipelines can produce validly signed malware.&lt;/li&gt;
&lt;li&gt;🎯 &lt;strong&gt;Your CI is a target.&lt;/strong&gt; Least-privilege tokens, careful workflow triggers, and SHA-pinned actions matter.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;The next time you run &lt;code&gt;npm install&lt;/code&gt;, remember: you're not just installing code. You're trusting every package in your dependency tree to execute safely.&lt;/p&gt;

&lt;p&gt;🛡️ &lt;strong&gt;Secure your dependencies before attackers turn them into your weakest link.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>cybersecurity</category>
      <category>javascript</category>
      <category>node</category>
      <category>security</category>
    </item>
    <item>
      <title>A must-read for every Next.js developer! Understanding Server Components, Client Components, and the RSC rendering pipeline makes a huge difference in building performant applications. 🚀</title>
      <dc:creator>Shubham Chaudhary</dc:creator>
      <pubDate>Tue, 03 Nov 2026 06:31:14 +0000</pubDate>
      <link>https://dev.to/shubham_works/-23oo</link>
      <guid>https://dev.to/shubham_works/-23oo</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/smtahosin/nextjs-doesnt-render-pages-anymore-it-streams-something-stranger-11ij" class="crayons-story__hidden-navigation-link"&gt;Next.js Doesn't Render Pages Anymore. It Streams Something Stranger.&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/smtahosin" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4126369%2Fe2b7c44b-92cf-47ae-a628-32599bd06777.webp" alt="smtahosin profile" class="crayons-avatar__image"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/smtahosin" class="crayons-story__secondary fw-medium m:hidden"&gt;
              S M Tahosin
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                S M Tahosin
                
                
              
              &lt;div id="story-author-preview-content-4825846" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/smtahosin" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4126369%2Fe2b7c44b-92cf-47ae-a628-32599bd06777.webp" class="crayons-avatar__image" alt=""&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;S M Tahosin&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/smtahosin/nextjs-doesnt-render-pages-anymore-it-streams-something-stranger-11ij" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Nov 2&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/smtahosin/nextjs-doesnt-render-pages-anymore-it-streams-something-stranger-11ij" id="article-link-4825846"&gt;
          Next.js Doesn't Render Pages Anymore. It Streams Something Stranger.
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/nextjs"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;nextjs&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/react"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;react&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/webdev"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;webdev&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/java"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;java&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
          &lt;a href="https://dev.to/smtahosin/nextjs-doesnt-render-pages-anymore-it-streams-something-stranger-11ij" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left"&gt;
            &lt;div class="multiple_reactions_aggregate"&gt;
              &lt;span class="multiple_reactions_icons_container"&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/exploding-head-daceb38d627e6ae9b730f36a1e390fca556a4289d5a41abb2c35068ad3e2c4b5.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/multi-unicorn-b44d6f8c23cdd00964192bedc38af3e82463978aa611b4365bd33a0f1f4f3e97.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/sparkle-heart-5f9bee3767e18deb1bb725290cb151c25234768a0e9a2bd39370c382d02920cf.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
              &lt;/span&gt;
              &lt;span class="aggregate_reactions_counter"&gt;23&lt;span class="hidden s:inline"&gt;&amp;nbsp;reactions&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/a&gt;
            &lt;span class="crayons-story__favorited"&gt;
              &lt;span class="favorited-marker"&gt;
                &lt;span&gt;
                  

                &lt;/span&gt;
                &lt;span class="hidden"&gt;
                  

                &lt;/span&gt;
              &lt;/span&gt;
            &lt;/span&gt;
            &lt;a href="https://dev.to/smtahosin/nextjs-doesnt-render-pages-anymore-it-streams-something-stranger-11ij#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              

              16&lt;span class="hidden s:inline"&gt;&amp;nbsp;comments&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            9 min read
          &lt;/small&gt;
          
          &lt;div class="only-sidebar-menu-item trusted-visible-block print-hidden align-center"&gt;
                
                    
                
          &lt;/div&gt;

        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;/div&gt;


</description>
      <category>javascript</category>
      <category>nextjs</category>
      <category>react</category>
      <category>webdev</category>
    </item>
    <item>
      <title>JavaScript: The Only Language Where [] + [] Feels Like a Philosophical Question 😂</title>
      <dc:creator>Shubham Chaudhary</dc:creator>
      <pubDate>Mon, 02 Nov 2026 10:39:26 +0000</pubDate>
      <link>https://dev.to/shubham_works/javascript-the-only-language-where-feels-like-a-philosophical-question-53cp</link>
      <guid>https://dev.to/shubham_works/javascript-the-only-language-where-feels-like-a-philosophical-question-53cp</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%2Favx5x5hcbfmhf3q3mp9q.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%2Favx5x5hcbfmhf3q3mp9q.png" alt="A frustrated developer trying to make sense of JavaScript's weird behaviour, surrounded by confusing code snippets and unexpected outputs. Because sometimes, JavaScript keeps developers humble! 😂" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Every developer has that one moment when JavaScript makes them question their career choices and life.&lt;/p&gt;

&lt;p&gt;You write a simple expression, expect a reasonable result, and JavaScript responds like it has its own interpretation of reality.&lt;/p&gt;

&lt;p&gt;Let's look at some JavaScript moments that feel less like programming and more like negotiating with a very unpredictable roommate.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Empty arrays are apparently very social
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nb"&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="p"&gt;[&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;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// ""&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two empty arrays meet.&lt;/p&gt;

&lt;p&gt;They have nothing to say.&lt;/p&gt;

&lt;p&gt;A completely silent conversation.&lt;/p&gt;

&lt;p&gt;But wait...&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="nb"&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="p"&gt;[&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;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// "[object Object]"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now the array meets an object, and suddenly JavaScript starts introducing people by their full legal names.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. The famous equality crisis
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nb"&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="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// true&lt;/span&gt;

&lt;span class="nb"&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="s2"&gt;""&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// true&lt;/span&gt;

&lt;span class="nb"&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="kc"&gt;null&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="kc"&gt;undefined&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// true&lt;/span&gt;

&lt;span class="nb"&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="kc"&gt;null&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="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;JavaScript's loose equality operator is basically a matchmaking service.&lt;/p&gt;

&lt;p&gt;It can find relationships between values that have absolutely nothing in common.&lt;/p&gt;

&lt;p&gt;But apparently, &lt;code&gt;null&lt;/code&gt; and &lt;code&gt;0&lt;/code&gt; have decided to remain strangers.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Developer&lt;/em&gt;: Why?&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This article was prepared with&lt;/em&gt;: It's complicated.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. NaN is not even equal to itself
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nb"&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="kc"&gt;NaN&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="kc"&gt;NaN&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Imagine introducing yourself to yourself and getting rejected.&lt;/p&gt;

&lt;p&gt;That's &lt;code&gt;NaN&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Thankfully, JavaScript gives us a way to check it:&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="nb"&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="nb"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;isNaN&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;NaN&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;span class="c1"&gt;// true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At least someone understands NaN.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. The array that refuses to be empty
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;items&lt;/span&gt; &lt;span class="o"&gt;=&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;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nb"&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="s2"&gt;"We have items!"&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;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;We have items!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But there are no items!&lt;/p&gt;

&lt;p&gt;JavaScript treats empty arrays as truthy.&lt;/p&gt;

&lt;p&gt;Remember:&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="nb"&gt;Boolean&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;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// true&lt;/span&gt;
&lt;span class="nb"&gt;Boolean&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;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// true&lt;/span&gt;
&lt;span class="nb"&gt;Boolean&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// false&lt;/span&gt;
&lt;span class="nb"&gt;Boolean&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  &lt;span class="c1"&gt;// false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;An empty shopping cart is apparently full of confidence.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Addition has an identity crisis
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nb"&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="s2"&gt;"5"&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// 3&lt;/span&gt;

&lt;span class="nb"&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="s2"&gt;"5"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// "52"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Subtraction&lt;/em&gt;: Let's do some mathematics.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Addition&lt;/em&gt;: Let's start a string concatenation business.&lt;/p&gt;

&lt;p&gt;Same language. Different personalities.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. Floating-point mathematics: A tiny betrayal
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nb"&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="mf"&gt;0.1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mf"&gt;0.2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// 0.30000000000000004&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I asked for 0.3.&lt;/p&gt;

&lt;p&gt;JavaScript delivered 0.30000000000000004.&lt;/p&gt;

&lt;p&gt;That extra number wasn't in the requirements.&lt;/p&gt;

&lt;p&gt;This happens because JavaScript uses IEEE 754 binary floating-point numbers for ordinary numeric calculations. Some decimal fractions cannot be represented exactly in binary.&lt;/p&gt;

&lt;p&gt;For money calculations, use integer minor units (like paise or cents), or an appropriate decimal arithmetic library.&lt;/p&gt;

&lt;h3&gt;
  
  
  7. Bonus: The classic typeof surprise
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nb"&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="k"&gt;typeof&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// "object"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is a historical quirk in JavaScript.&lt;/p&gt;

&lt;p&gt;It isn't a useful way to check for null. Use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nb"&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="n"&gt;value&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Sometimes the best solution is simply to be explicit.&lt;/p&gt;

&lt;h3&gt;
  
  
  So, is JavaScript actually bad?
&lt;/h3&gt;

&lt;p&gt;Not really.&lt;/p&gt;

&lt;p&gt;JavaScript is incredibly useful, flexible, and powerful. These behaviors are mostly consequences of its history, design decisions, and type-coercion rules.&lt;/p&gt;

&lt;p&gt;But understanding them can save us from some very confusing debugging sessions.&lt;/p&gt;

&lt;p&gt;A few habits worth keeping:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Prefer &lt;code&gt;===&lt;/code&gt; over &lt;code&gt;==&lt;/code&gt; unless you intentionally need coercion.&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;Number.isNaN()&lt;/code&gt; to check for NaN.&lt;/li&gt;
&lt;li&gt;Remember that empty arrays and objects are truthy.&lt;/li&gt;
&lt;li&gt;Be careful with floating-point calculations.&lt;/li&gt;
&lt;li&gt;Use explicit type conversions when working with external data.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Final thoughts
&lt;/h3&gt;

&lt;p&gt;JavaScript isn't necessarily trying to confuse us.&lt;/p&gt;

&lt;p&gt;It's just a language with a very interesting sense of humor.&lt;/p&gt;

&lt;p&gt;And somewhere, a developer is still debugging why &lt;code&gt;[] + {}&lt;/code&gt; returned something that looks like an object introducing itself at a networking event.&lt;/p&gt;

&lt;p&gt;What's your favorite JavaScript WTF moment?&lt;/p&gt;

&lt;p&gt;Share it in the comments. Let's laugh, learn, and debug together. 😂&lt;/p&gt;




&lt;p&gt;&lt;em&gt;P.S. This is my first post here on dev.to. I thought there couldn't be a better way to start than talking about the language that has given me both a career and countless debugging headaches. 🚀&lt;/em&gt;&lt;/p&gt;

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