<?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: Kunal Gautam</title>
    <description>The latest articles on DEV Community by Kunal Gautam (@kgautam).</description>
    <link>https://dev.to/kgautam</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3901210%2Fdcbd81ab-ccc3-426c-ac12-1064a86e387b.JPG</url>
      <title>DEV Community: Kunal Gautam</title>
      <link>https://dev.to/kgautam</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kgautam"/>
    <language>en</language>
    <item>
      <title>How I Built a 3D Interactive Portfolio with React, Three.js, and Cloudflare Workers</title>
      <dc:creator>Kunal Gautam</dc:creator>
      <pubDate>Mon, 27 Apr 2026 21:17:01 +0000</pubDate>
      <link>https://dev.to/kgautam/how-i-built-a-3d-interactive-portfolio-with-react-threejs-and-cloudflare-workers-3f9m</link>
      <guid>https://dev.to/kgautam/how-i-built-a-3d-interactive-portfolio-with-react-threejs-and-cloudflare-workers-3f9m</guid>
      <description>&lt;h1&gt;
  
  
  How I Built a 3D Interactive Portfolio with React, Three.js, and Cloudflare Workers
&lt;/h1&gt;

&lt;p&gt;I rebuilt my portfolio as a full WebGL solar system. Here is what I learned about shipping it as a real product instead of a demo.&lt;/p&gt;

&lt;h2&gt;
  
  
  The constraints
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Has to feel 60 FPS even on mid-range devices&lt;/li&gt;
&lt;li&gt;Total payload under 2 MB on first load&lt;/li&gt;
&lt;li&gt;Zero 4xx errors in production&lt;/li&gt;
&lt;li&gt;Indexable by Google despite being a SPA&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What worked
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Lazy audio&lt;/strong&gt;: a 13 MB ambient track was the single biggest bandwidth drain. I deferred loading it until a real user gesture (&lt;code&gt;click&lt;/code&gt;/&lt;code&gt;keydown&lt;/code&gt;/&lt;code&gt;touch&lt;/code&gt;) and set &lt;code&gt;preload="none"&lt;/code&gt;. Bandwidth per bounced visit dropped from ~8.6 MB to ~1.2 MB.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Manual chunking in Vite&lt;/strong&gt;: split &lt;code&gt;react-vendor&lt;/code&gt;, &lt;code&gt;icons&lt;/code&gt;, and &lt;code&gt;noise&lt;/code&gt; into separate hashed bundles so that updates to my own code don't bust the React cache.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cloudflare edge caching&lt;/strong&gt;: hashed &lt;code&gt;/assets/*&lt;/code&gt; files set to &lt;code&gt;Cache-Control: public, max-age=31536000, immutable&lt;/code&gt;. HTML revalidates every load so deploys ship instantly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SEO landing pages&lt;/strong&gt;: I generated a static HTML page per project under &lt;code&gt;/projects/:id&lt;/code&gt; so Google can index every case study, then deep-linked them into the SPA via &lt;code&gt;history.pushState&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GA4 events&lt;/strong&gt;: added &lt;code&gt;section_view&lt;/code&gt;, &lt;code&gt;resume_download&lt;/code&gt;, and &lt;code&gt;outbound_click&lt;/code&gt; events to actually understand engagement instead of guessing from page views.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  What I would do differently next time
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Pre-bake the WebGL shader compile path off the main thread to drop first-frame stutter.&lt;/li&gt;
&lt;li&gt;Switch ambient audio from MP3 to Opus — half the size at the same quality.&lt;/li&gt;
&lt;li&gt;Build the project page generator as a Vite plugin so all routes share the same head/meta logic.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you want to dig deeper into the codebase or see the live build, the full source and demo are linked from my &lt;a href="https://portfolio.kunal-gautam-570.workers.dev/" rel="noopener noreferrer"&gt;portfolio&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>react</category>
      <category>threejs</category>
      <category>webgl</category>
      <category>cloudflare</category>
    </item>
  </channel>
</rss>
