<?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: Lavjeet Rai</title>
    <description>The latest articles on DEV Community by Lavjeet Rai (@lavjeetrai).</description>
    <link>https://dev.to/lavjeetrai</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%2F3565182%2Fbbb8244d-bd94-4532-800a-61700bee0a75.png</url>
      <title>DEV Community: Lavjeet Rai</title>
      <link>https://dev.to/lavjeetrai</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lavjeetrai"/>
    <language>en</language>
    <item>
      <title>SecureScan</title>
      <dc:creator>Lavjeet Rai</dc:creator>
      <pubDate>Sat, 23 May 2026 17:19:44 +0000</pubDate>
      <link>https://dev.to/lavjeetrai/securescan-2hm1</link>
      <guid>https://dev.to/lavjeetrai/securescan-2hm1</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/github-2026-05-21"&gt;GitHub Finish-Up-A-Thon Challenge&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;SecureScan&lt;/strong&gt; is a privacy-first web utility that bridges the gap between physical sharing and ephemeral digital storage. &lt;/p&gt;

&lt;p&gt;At its core, the application converts standard text into secure QR codes. The latest major feature addition is the &lt;strong&gt;Ephemeral Image Vault&lt;/strong&gt;. Instead of relying on permanent cloud hosting for sensitive images, SecureScan allows users to upload an image and generates a QR code linked to that specific file with a strict, mathematically enforced 120-second lifespan.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Architecture:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Frontend:&lt;/strong&gt; Next.js / React &lt;em&gt;(update this to your actual frontend)&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Backend &amp;amp; Database:&lt;/strong&gt; Node.js paired with MongoDB.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Storage &amp;amp; Access Control:&lt;/strong&gt; Supabase Storage.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Logic:&lt;/strong&gt; When an image is uploaded, it is routed to a private Supabase bucket. The backend instantly generates a Pre-Signed URL with &lt;code&gt;expiresIn: 120&lt;/code&gt;. This URL is encoded into the generated QR code. Once 120 seconds pass, cloud-provider authentication mathematically invalidates the link—blocking access completely. To prevent storage bloat, a Node.js cron job runs every 5 minutes in the background, querying MongoDB for expired timestamps and batch-deleting the dead files from the Supabase bucket.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Live Application:&lt;/strong&gt; &lt;a href="https://securescanbylav.vercel.app/" rel="noopener noreferrer"&gt;Insert Live URL here&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitHub Repository:&lt;/strong&gt; &lt;a href="https://github.com/lavjeetrai/SecureScan" rel="noopener noreferrer"&gt;Insert Repo URL here&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&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.amazonaws.com%2Fuploads%2Farticles%2F1z0id82abibdp5m1j2j1.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.amazonaws.com%2Fuploads%2Farticles%2F1z0id82abibdp5m1j2j1.png" alt="SecureScan Application Architecture and Demo" width="800" height="450"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;(Note: Consider adding a GIF or video walkthrough of the 120-second expiration in action right here!)&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Comeback Story
&lt;/h2&gt;

&lt;p&gt;SecureScan initially started as a straightforward client-side utility: converting simple text strings into QR codes. It functioned well, but it was static and lacked a complex backend challenge. &lt;/p&gt;

&lt;p&gt;The turning point was tackling the problem of secure, temporary file sharing. I wanted to allow image uploads, but I refused to build a system where user images sit on a server forever, consuming storage and posing a privacy risk. The technical hurdle was enforcing a strict expiration. My initial thought was to use a basic &lt;code&gt;setTimeout&lt;/code&gt; deletion script, but analyzing that logically revealed it was prone to server lag and race conditions. &lt;/p&gt;

&lt;p&gt;The "comeback" was entirely re-architecting the feature into a two-layer system: relying on Supabase's cryptographic Pre-Signed URLs for exact, to-the-second access control, while offloading the actual file deletion to an asynchronous MongoDB/Node-cron garbage collection cycle. It transformed a basic QR generator into a highly efficient, self-cleaning ephemeral storage engine.&lt;/p&gt;

&lt;h2&gt;
  
  
  My Experience with GitHub Copilot
&lt;/h2&gt;

&lt;p&gt;GitHub Copilot was a massive accelerant during the backend re-architecture, specifically when bridging the different APIs. &lt;/p&gt;

&lt;p&gt;Instead of constantly context-switching to read the Supabase Storage SDK documentation, Copilot accurately generated the boilerplate for uploading the buffer and creating the Pre-Signed URL with the exact expiration parameters. It also handled the tedious syntax of setting up the &lt;code&gt;node-cron&lt;/code&gt; scheduling syntax and scaffolding the Mongoose schema for the &lt;code&gt;EphemeralImage&lt;/code&gt; database models. This allowed me to focus strictly on the system design and the logic of the two-layer access control, rather than hunting down typos in the database queries.&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>githubchallenge</category>
    </item>
  </channel>
</rss>
