All Projects

Barcode & QR Generator App

Live Demo
Role
Frontend Utility Engineering
Read
2 min read
Table of Contents
  1. Project Overview
  2. Problem Statement
  3. Solution Architecture
  4. Technical Deep Dives
    1. Standardized Schema Payload Structuring
    2. Canvas Matrix Rendering & Error Correction
    3. Lossless Vector & Raster Export Pipeline
  5. Algorithm & Benchmarks
  6. Architecture Trade-Offs
  7. Project Results

Project Overview

A client-side matrix barcode and QR code synthesis application. It enables instant creation of customized 2D QR codes and 1D barcodes with adjustable error correction, schema-specific payload formatting, and high-resolution multi-format asset exports.

Problem Statement

Many online QR code generators route user inputs through remote servers to log scan parameters, inject advertisement redirects, or impose subscriptions for basic vector downloads. Users and developers need a fast, private, client-side utility that generates production-ready codes directly in the browser without tracking or telemetry.

Solution Architecture

Raw input is shaped by schema-specific formatters, encoded into a module matrix, then split into two render targets (a rasterized canvas and a mathematically generated SVG), each with its own export path.

Live architecture & logic flow
Service Data store External
vCard · Wi-Fi · URL 1× 2× 4× Raw User Input Payload Formatter Matrix Generation Canvas Rasterization SVG Matrix Builder PNG / JPEG Export Lossless SVG Export
Click or focus any node to inspect architectural details.

Technical Deep Dives

Standardized Schema Payload Structuring

  • Wi-Fi: WIFI:T:WPA;S:NetworkName;P:Password;;
  • vCard 3.0: Formatted contact cards containing name, email, telephone, and address keys.
  • Direct URI / Text: Encoded URL strings and plain-text blocks.

Canvas Matrix Rendering & Error Correction

  • Rendered matrices directly to an HTML5 <canvas> context using configurable Reed-Solomon error correction levels (Low 7%, Medium 15%, Quartile 25%, High 30%), keeping codes readable even if partially damaged or obscured by logos.
  • Added dynamic padding, quiet-zone enforcement, and foreground/background contrast verification to guarantee camera decode compliance.

Lossless Vector & Raster Export Pipeline

  • Raster downloads (PNG, JPEG at 1×, 2×, 4× pixel densities) via canvas.toDataURL().
  • Mathematical vector exports (SVG) constructed by looping over active matrix modules and generating discrete <rect> elements.

Algorithm & Complexity Benchmarks

Reed-Solomon & Matrix Encode

sub-10ms local render
Time: O(M + S²) Space: O(S²)

Encodes M payload bytes into an S×S QR error-corrected module matrix.

SVG Vector Construction

lossless at any DPI
Time: O(S²) Space: O(S²)

Direct module-to-rect emission bypasses server image pipelines.

Architecture Trade-Offs

Dual Raster & Vector Output

Chosen: Canvas 2D + Direct SVG Matrix Builder Over: Server-Side Image Rendering Endpoint

Generates both print-ready lossless SVG and 1×/2×/4× PNG/JPEG exports in under 10ms locally—preserving complete user privacy.

Client-Only Execution

Chosen: Zero-Backend Browser Encoding Over: Cloud Upload + Worker Queue

Wi-Fi credentials and vCard payloads never leave the user’s browser, eliminating server latency and data retention risk.

Project Results

Privacy-First

100% of encoding occurs in-browser; zero bytes of user data leave the client.

Instant Generation

Synthesizes codes with sub-10ms render latency.

Export Flexibility

Delivers both web-ready raster assets and print-ready lossless SVG vectors.

Keyboard Shortcuts

Global Navigation

  • Open Command Palette Cmd / CtrlK
  • Toggle Bruce's AI Assistant Shell ~or`
  • Show keyboard shortcuts ?
  • Close active modal or dialog Esc

Case Studies & Diagrams

  • Jump to next article section J
  • Jump to previous article section K
  • Inspect focused architecture node Enter / Space

Interactive Shell

  • Autocomplete commands, routes, & slugs Tab
  • Cycle command history ↑↓