<?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: Jay Prajapati</title>
    <description>The latest articles on DEV Community by Jay Prajapati (@jayprajapati-dev).</description>
    <link>https://dev.to/jayprajapati-dev</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%2F3953506%2Fbaea1786-9936-4bd1-ade4-c7a748914458.png</url>
      <title>DEV Community: Jay Prajapati</title>
      <link>https://dev.to/jayprajapati-dev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jayprajapati-dev"/>
    <language>en</language>
    <item>
      <title>Engineering a 100% Client-Side, $0 Server-Cost Document</title>
      <dc:creator>Jay Prajapati</dc:creator>
      <pubDate>Wed, 27 May 2026 04:11:23 +0000</pubDate>
      <link>https://dev.to/jayprajapati-dev/engineering-a-100-client-side-0-server-cost-document-58k7</link>
      <guid>https://dev.to/jayprajapati-dev/engineering-a-100-client-side-0-server-cost-document-58k7</guid>
      <description>&lt;h2&gt;
  
  
  `
&lt;/h2&gt;

&lt;p&gt;description: "How I built PasteDocs using React, Zustand, and background Web Workers to auto-resize government application documents locally with absolute privacy."&lt;br&gt;
tags: react, typescript, webdev, privacy&lt;/p&gt;

&lt;h2&gt;
  
  
  cover_image: &lt;a href="https://unsplash.com" rel="noopener noreferrer"&gt;https://unsplash.com&lt;/a&gt;
&lt;/h2&gt;

&lt;h1&gt;
  
  
  PasteDocs 📄✨
&lt;/h1&gt;

&lt;h3&gt;
  
  
  The Zero-Cost, Absolute Privacy Client-Side Document Formatter
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://pastedocs.vercel.app/" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fshields.io" alt="Hosted on Vercel" width="" height=""&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://vercel.app" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fshields.io" alt="Privacy Audit" width="" height=""&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://pastedocs.vercel.app/" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fshields.io" alt="Tech Stack" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  ⚡ Instant Sizing Hub (Click to Open Tool)
&lt;/h2&gt;

&lt;p&gt;Aapko jis format ya exam ke liye document resize karna hai, niche diye gaye direct layout links par click karein:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;📸 Competitive Exams&lt;/th&gt;
&lt;th&gt;🪪 Government ID Docs&lt;/th&gt;
&lt;th&gt;🛂 Global Visa Photos&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;🔥 &lt;a href="https://vercel.app" rel="noopener noreferrer"&gt;NEET Photo Formatter&lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;🪪 &lt;a href="https://vercel.app" rel="noopener noreferrer"&gt;Aadhaar Card Specs&lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;🇺🇸 &lt;a href="https://vercel.app" rel="noopener noreferrer"&gt;US Visa Photo (600x600)&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;🚀 &lt;a href="https://vercel.app" rel="noopener noreferrer"&gt;SSC CGL Photo Adjuster&lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;💳 &lt;a href="https://vercel.app" rel="noopener noreferrer"&gt;PAN Card Standard&lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;🇪🇺 &lt;a href="https://vercel.app" rel="noopener noreferrer"&gt;Schengen Visa Standard&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;✍️ &lt;a href="https://vercel.app" rel="noopener noreferrer"&gt;Signature Resize (&amp;lt; 20KB)&lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;🎓 &lt;a href="https://vercel.app" rel="noopener noreferrer"&gt;Marksheet Image to PDF&lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;🇮🇳 &lt;a href="https://vercel.app" rel="noopener noreferrer"&gt;Passport India Compliant&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  💎 Core Highlights That Drive 100% CTR &amp;amp; Trust
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Absolute Privacy Sandbox:&lt;/strong&gt; Aapka sensitive document (Aadhaar, PAN, Photo) kabhi kisi server par upload nahi hota. Saari processing asynchronous background Web Workers (&lt;code&gt;docWorker.ts&lt;/code&gt;) ke zariye aapke local device browser RAM mein hoti hai.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Smart NLP Requirement Parser:&lt;/strong&gt; Kisi bhi government notification text ko direct copy-paste kijiye. Hamara engine pixel bounds, dimensions, aur target maximum KB constraints (jaise &lt;strong&gt;Compress to 50KB/20KB&lt;/strong&gt;) automatic detect kar leta hai.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Modern OS Optimization:&lt;/strong&gt; Low-end Android devices par smooth 60fps performance chalti hai, aur iPhone users ke liye in-browser &lt;strong&gt;HEIC to JPG&lt;/strong&gt; local conversion supported hai.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;👉 &lt;strong&gt;&lt;a href="https://pastedocs.vercel.app/" rel="noopener noreferrer"&gt;Start Formatting Now — 100% Free &amp;amp; Secure&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Every year, millions of candidates across India apply for competitive exams like NEET, UPSC, SSC, or state-level portals like OJAS and GPSC. If you have ever filled out one of these government forms, you know the ultimate formatting nightmare:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"Upload passport photo: Must be exactly 3.5cm x 4.5cm, under 50KB, with a white background, and saved at a specific DPI/resolution."&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To comply with these unforgiving constraints, desperate applicants blindly upload highly sensitive personal telemetry—Aadhaar cards, PAN cards, Passports, High School Marksheets, and Signatures—to sketchy, ad-ridden online web resizers. &lt;/p&gt;

&lt;p&gt;What they don't realize is that most of these free utilities act as server-side collection nodes. Your files are stored on remote server databases, leaving you highly vulnerable to identity theft, tracking cookies, and severe database leaks.&lt;/p&gt;

&lt;p&gt;As an IT student and indie software builder based in Gujarat, India, I wanted to eliminate this identity exposure entirely. So I built &lt;strong&gt;PasteDocs&lt;/strong&gt; (&lt;code&gt;pastedocs.vercel.app&lt;/code&gt;)—a privacy-first, zero-friction document utility suite engineered with &lt;strong&gt;React, Vite, TypeScript, and Web Workers&lt;/strong&gt; that performs all resizing, compression, and format conversions 100% locally inside the browser's sandbox.&lt;/p&gt;

&lt;p&gt;Here is the deep-dive engineering breakdown of how I designed this zero-overhead frontend system that costs exactly &lt;strong&gt;$0 in server bills&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  🏛️ The Core Philosophy: Local Sandboxing over Cloud Compute
&lt;/h2&gt;

&lt;p&gt;The absolute architectural rule of PasteDocs is simple: &lt;strong&gt;Zero Data Exfiltration.&lt;/strong&gt; Files must never touch a backend server. &lt;/p&gt;

&lt;p&gt;Instead of paying for expensive backend GPU cores or cloud databases to process images via Node.js or Python, PasteDocs shifts the entire computing workload directly onto the user's client-side device CPU using standard web assembly and browser canvas layers.&lt;/p&gt;




&lt;h2&gt;
  
  
  🚀 Deep-Dive into the Technical Architecture
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Multithreaded Background Compression (&lt;code&gt;docWorker.ts&lt;/code&gt;)
&lt;/h3&gt;

&lt;p&gt;Running recursive scaling math, pixel rendering, and image encoder loops over high-resolution mobile camera assets will immediately choke the browser's main UI thread, dropping the layout frames to 0 and freezing the app.&lt;/p&gt;

&lt;p&gt;To maintain a crisp 60fps experience even on low-end Android mobile devices with rural coverage, PasteDocs offloads heavy compression mathematics to asynchronous background &lt;strong&gt;Web Workers&lt;/strong&gt; (&lt;code&gt;docWorker.ts&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;Here is a look at how the worker thread loops through quality factors recursively to hit strict maximum constraints (like &lt;code&gt;Compress to 50KB&lt;/code&gt; or &lt;code&gt;20KB&lt;/code&gt;) without relying on network speed:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;`typescript&lt;br&gt;
// src/workers/docWorker.ts&lt;br&gt;
// Offloading direct-memory calculations from the main UI thread&lt;/p&gt;

&lt;p&gt;self.onmessage = async (e: MessageEvent) =&amp;gt; {&lt;br&gt;
  const { fileBlob, targetKB, targetWidth, targetHeight } = e.data;&lt;/p&gt;

&lt;p&gt;try {&lt;br&gt;
    let quality = 0.95;&lt;br&gt;
    let compressedBlob: Blob | null = null;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Recursive compression loop modulating rendering quality vectors inside local RAM
do {
  compressedBlob = await scaleAndEncodeCanvas(fileBlob, targetWidth, targetHeight, quality);
  quality -= 0.05;
} while (compressedBlob &amp;amp;&amp;amp; compressedBlob.size / 1024 &amp;gt; targetKB &amp;amp;&amp;amp; quality &amp;gt; 0.1);

// Posting processed data array back to the React UI thread instantly
self.postMessage({ success: true, processedBlob });
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;} catch (error) {&lt;br&gt;
    self.postMessage({ success: false, error: (error as Error).message });&lt;br&gt;
  }&lt;br&gt;
};&lt;/p&gt;

&lt;p&gt;async function scaleAndEncodeCanvas(blob: Blob, w: number, h: number, q: number): Promise {&lt;br&gt;
  // Direct pixel processing using OffscreenCanvas executing natively&lt;br&gt;
  // Without any backend or database compute costs.&lt;br&gt;
  return blob; &lt;br&gt;
}&lt;br&gt;
`&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Centralized State Machine with Memory Protection
&lt;/h3&gt;

&lt;p&gt;Handling large files locally can easily deplete mobile system RAM, causing the browser tab to crash. PasteDocs utilizes an unopinionated, ultra-fast &lt;strong&gt;Zustand&lt;/strong&gt; store (&lt;code&gt;useDocStore.ts&lt;/code&gt;) instead of heavy React Context layers to implement strict memory safeguards.&lt;/p&gt;

&lt;p&gt;To guarantee high stability, the store instantly rejects files larger than 50MB and aggressively cleans up temporary binary memory using target object revocations:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;`typescript&lt;br&gt;
// src/store/useDocStore.ts&lt;br&gt;
import { create } from 'zustand';&lt;/p&gt;

&lt;p&gt;interface DocState {&lt;br&gt;
  files: File[];&lt;br&gt;
  isProcessing: boolean;&lt;br&gt;
  maxSizeLimit: number; // 50MB strict ceiling&lt;br&gt;
  addFilesToQueue: (incomingFiles: File[]) =&amp;gt; void;&lt;br&gt;
  clearObjectMemory: (url: string) =&amp;gt; void;&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;export const useDocStore = create((set, get) =&amp;gt; ({&lt;br&gt;
  files: [],&lt;br&gt;
  isProcessing: false,&lt;br&gt;
  maxSizeLimit: 50 * 1024 * 1024, &lt;/p&gt;

&lt;p&gt;addFilesToQueue: (incomingFiles) =&amp;gt; {&lt;br&gt;
    const validFiles = incomingFiles.filter(file =&amp;gt; {&lt;br&gt;
      if (file.size &amp;gt; get().maxSizeLimit) {&lt;br&gt;
        // Stateful non-blocking visual feedback overlay replaces thread-freezing window.alert()&lt;br&gt;
        return false;&lt;br&gt;
      }&lt;br&gt;
      return true;&lt;br&gt;
    });&lt;br&gt;
    set((state) =&amp;gt; ({ files: [...state.files, ...validFiles] }));&lt;br&gt;
  },&lt;/p&gt;

&lt;p&gt;clearObjectMemory: (url) =&amp;gt; {&lt;br&gt;
    // Proactive handle cleanup preventing memory leaks during batch conversions&lt;br&gt;
    URL.revokeObjectURL(url);&lt;br&gt;
  }&lt;br&gt;
}));&lt;br&gt;
`&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Dynamic NLP Requirement Parser
&lt;/h3&gt;

&lt;p&gt;A key feature for non-technical users is PasteDocs’ ability to natively read government guidelines. Powered by a &lt;strong&gt;Dynamic RegExp parsing engine&lt;/strong&gt;, applicants can copy text blocks directly from official notification PDFs (supporting structural parsing from English, Hindi, and Gujarati government portals). &lt;/p&gt;

&lt;p&gt;The tool breaks down strings to detect:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Format constraints (&lt;code&gt;JPEG&lt;/code&gt;, &lt;code&gt;PNG&lt;/code&gt;, &lt;code&gt;PDF&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Maximum KB weights (&lt;code&gt;Max KB: 20&lt;/code&gt;, &lt;code&gt;50KB&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Exact dimension targets (&lt;code&gt;DPI&lt;/code&gt;, &lt;code&gt;Resolution&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Dynamic edits (e.g., executing structural scripts to &lt;strong&gt;Add White Background&lt;/strong&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. Dynamic Routing Engine for Seamless SEO
&lt;/h3&gt;

&lt;p&gt;To make 100% client-side React code discoverable by Google and AI indexers, PasteDocs maps over 130+ configurations across static structures (&lt;code&gt;toolData.ts&lt;/code&gt;, &lt;code&gt;examData.ts&lt;/code&gt;, &lt;code&gt;visaData.ts&lt;/code&gt;). &lt;/p&gt;

&lt;p&gt;Using &lt;code&gt;React Router Dom v6&lt;/code&gt;, these parameters are integrated into dynamic programmatic SEO routes (&lt;code&gt;/exam/:slug&lt;/code&gt;, &lt;code&gt;/tool/:slug&lt;/code&gt;, &lt;code&gt;/visa/:slug&lt;/code&gt;). This feeds real-time spec criteria like DPI and aspect configurations into the processing core while exposing clean landing pages for web crawlers.&lt;/p&gt;




&lt;h2&gt;
  
  
  🛠️ Feature Catalog Breakdown
&lt;/h2&gt;

&lt;p&gt;PasteDocs has scaled past simple image optimization into a massive, production-ready &lt;strong&gt;Document Utility Suite&lt;/strong&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Image Utilities:&lt;/strong&gt; Compress to 50KB/20KB, Passport &amp;amp; Stamp sizing, Signature rescaling, and forced White Background insertion.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Advanced Conversion Engine:&lt;/strong&gt; Heavy browser-based iOS decoding for &lt;code&gt;HEIC to JPG&lt;/code&gt;, standard &lt;code&gt;JPG to PNG&lt;/code&gt;, and lossless &lt;code&gt;Image to PDF&lt;/code&gt; packaging.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pre-configured Target Catalogs:&lt;/strong&gt; Integrated matching sets for NEET Photo, SSC CGL, IBPS PO, US Visa, Schengen Visa, and Passport India formats.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;UI Refinements:&lt;/strong&gt; Entirely thread-safe UX that drops synchronous legacy &lt;code&gt;window.alert()&lt;/code&gt; interfaces in favor of Framer Motion non-blocking overlays and micro-interactions.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  💡 Key Takeaway for Developers
&lt;/h2&gt;

&lt;p&gt;Building PasteDocs proved that you do not need expensive cloud hosting, continuous server operations, or intensive API backends to launch scalable software utilities. &lt;/p&gt;

&lt;p&gt;By taking full advantage of modern browser engines, off-screen canvas buffers, background threads, and solid front-end state management, indie developers can craft tools that prioritize absolute user security for a &lt;strong&gt;hosting cost of exactly zero&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Try it out yourself: &lt;a href="https://vercel.app" rel="noopener noreferrer"&gt;pastedocs.vercel.app&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Let me know your thoughts in the comments below! Have you experimented with Web Workers or local Canvas processing layers in your projects?&lt;/em&gt;&lt;br&gt;
`&lt;/p&gt;

</description>
      <category>privacy</category>
      <category>react</category>
      <category>showdev</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
