How harish2704/upi-qr-code-from-bank-details works
Project type and purpose
• This is a static, single‐page web application (SPA) that runs entirely in the browser.
• Purpose: take user‐entered bank details, build a UPI payment URI, generate a QR code and shareable link—all on the client side.
• No backend or server‐side logic; it is hosted on GitHub Pages and pulls CSS/JS libraries from CDNs.
File structure
• Top level files only:
• index.html – the SPA entry point
• README.md – project description
• LICENSE
• There are no “frontend” vs “backend” folders, since everything is in one HTML file.
• Dependencies are loaded via <script> and <link> tags: unpkg.com (for JS libraries) and Milligram CSS.
Extract key insights from the README
• The tool:
1. Generates a UPI ID from bank account details.
2. Creates a QR code image (using node-qrcode library in the browser).
3. Constructs a shareable URL with all parameters serialized into the URL hash (no data is sent to any server).
4. Uses URL schemes (upi://) to launch UPI apps on mobile.
• No server-side data storage; all processing is client-side.
Main components
a. User’s Web Browser (SPA)
• UI layer (HTML + Milligram CSS)
• JS logic: form parsing → build UPI URI → update URL hash
• QR Code module (node-qrcode loaded from unpkg)
• Hash-based routing/storage (no server calls)
• UPI URL scheme invocation (upi://pay?...)
b. Static Hosting (GitHub Pages)
• Serves index.html, README.md, LICENSE
c. External CDNs
• unpkg.com (node-qrcode, any other packages)
• Milligram.io (CSS)
d. External UPI App
• Invoked by the browser via custom URL scheme
Relationships & Interactions
• Browser requests index.html (and associated CSS/JS) from GitHub Pages.
• Browser also fetches CSS and JS libraries from unpkg.com and milligram.io.
• User enters bank details into the SPA form.
• In-browser JS constructs UPI URI and serializes data into window.location.hash.
• QR generator module produces a canvas/png QR code.
• SPA updates the DOM to show QR and shareable link.
• When the link is clicked on a mobile device, the UPI payment app is launched via the upi:// URI.
Architectural patterns & design principles
• Client-side SPA: all logic runs in the browser.
• Hash-based routing/data storage: no HTTP API calls for user data.
• Dependency injection via CDN: reduces project weight, no local package management.
Final recommendations
• Data flow: user input → UPI URI → hashed URL → QR code.
• Fact that no data ever leaves the browser beyond the UPI app invocation.