Build QR Tiger
YESreplaces $7/mosaves $84/yrback to the verdict
A QR code generator you host: live preview, colours, dot styles and a centre logo, PNG and SVG export, plus dynamic codes on your own domain that redirect through /r/:slug so a printed code can be repointed later, with per-code scan counts. The domain is the one thing you must keep forever.
Before step 1
Everything below is assumed from the first step. Tick each one when you actually have it, not when you plan to.
- installfree
Why Everything in this build runs on it: the server, the scripts, the tests.
Get it Download the LTS installer from nodejs.org, or install with your package manager (brew install node, or nvm install 22). Restart the terminal afterwards. open ↗
Verify
node --version prints v22 or higher - installfree
Why Every step below is a command you type or a file you edit.
Get it VS Code (code.visualstudio.com), Cursor or Zed. Open a folder for the project and use the editor's built-in terminal. open ↗
Verify
You can open a folder and run a command in its terminal - installfree
Why History for your code, and the way most hosts deploy.
Get it Install from git-scm.com or with your package manager, then run git init in the project folder once it exists. open ↗
Verify
git --version prints a version - installfree
Why Every check in Phases 1 to 3 is scanning the code with a real camera. Emulators do not count.
Get it Any modern phone; the stock camera app scans QR codes.
- have readyfree
Why Phase 3 tests the centre-logo feature; a real logo shows whether it still scans.
Get it Your logo as PNG or SVG, at least 256x256, ideally with transparent background.
- accountroughly $10 a year
Why Dynamic codes redirect through your domain. If the domain lapses, every printed code becomes dead paper. Do not use a domain you might drop.
Get it Register a short one at Porkbun or Cloudflare Registrar and turn on auto-renew. A subdomain of a domain you already keep is fine. open ↗
- accountabout $5 a month
Why This needs one process running all the time with a public address.
Get it Hetzner Cloud (from about 4 EUR), DigitalOcean or Fly.io. Ubuntu 24.04, the smallest size. You need SSH access and a public IP. Only needed for the deploy phase; develop locally first. open ↗
- installfree
Why Automatic HTTPS in front of the Node process. Without TLS the browser features this relies on (and your visitors' trust) do not work.
Get it On the VPS: follow the install steps at caddyserver.com/docs/install for Ubuntu. One Caddyfile with your domain and a reverse_proxy line is the whole config. open ↗
Verify
caddy version prints a version on the server
Data model
Create these before the first phase that stores anything. Changing a table later is the expensive kind of change.
- `codes`: id, slug (short, unambiguous alphabet, CSPRNG-generated), target_url, label, created_at, updated_at, active (bool) - `scans`: id, code_id, scanned_at, referer, user_agent_class, ip_hash Store a coarse user-agent bucket and a salted IP hash, never the raw values. A `slug` is permanent: rewriting a slug invalidates every printed code that uses it, which is the one unrecoverable mistake this tool can make.
Environment variables
These go in a .env file the app reads at startup. The pack's .env.example is this table as a file · copy it, never commit the filled-in version.
| Variable | Needed | Example | Where the value comes from |
|---|---|---|---|
PORT | required | 3000 | Any free port; Caddy proxies to it. |
DATABASE_PATH | required | ./data/qr.db | SQLite file for codes and scans. |
SITE_URL | required | https://go.yourdomain.com | Public base of the redirect domain. Baked into every dynamic code. |
FALLBACK_URL | required | https://yourdomain.com/this-code-is-inactive | Where a deactivated or unknown code lands. A dead printed code should explain itself. |
IP_SALTsecret | required | hex-from-openssl-rand | openssl rand -hex 32, once. For hashing scanner IPs. |
ADMIN_USER | required | admin | Any username for the basic-auth admin pages. |
ADMIN_PASSsecret | required | change-me-to-a-long-random-string | Generate one: openssl rand -base64 24. Never reuse a real password. |
The build, in order
Static generator
Type text, see a code, scan it.
Install the pinned version and copy its browser bundle into public/vendor so nothing loads from a CDN at runtime.
Files
public/index.htmlpublic/app.jsterminalmkdir qr && cd qr && git init && npm init -y && npm pkg set type=module npm install qr-code-styling@1.5.0 mkdir -p public/vendor data && cp node_modules/qr-code-styling/lib/qr-code-styling.js public/vendor/
new QRCodeStyling({ width: 300, height: 300, type: 'canvas', data }) then .append(container). Re-render on input with a 150 ms debounce.
done when · tick each as it passesCustomization
Colours and styles that update live, with a warning when the result would not scan.
dotsOptions.color and type (square, rounded, classy), cornersSquareOptions, backgroundOptions.color, margin. Every control re-renders immediately; no Apply button.
Compute the contrast ratio between foreground and background; below roughly 3:1 show a warning while still rendering. A beautiful unscannable code is the failure users ship.
done when · tick each as it passesCentre logo
A logo in the middle that does not break scanning.
imageSize around 0.3, margin, hideBackgroundDots true. Read the file locally with FileReader; nothing is uploaded.
qrOptions.errorCorrectionLevel = 'H' with a logo, back to M without. Cap the logo at roughly a quarter of the code.
done when · tick each as it passesExport
PNG and SVG that reopen correctly, and copy to clipboard that works in Safari too.
download({ name, extension: 'png' | 'svg' }) at 512, 1024 or 2048 by re-instantiating at that size.
Always pass a Promise resolving to a Blob into ClipboardItem: Safari requires the promise form and Chromium accepts it, so one code path works everywhere. Call navigator.clipboard.write inside the click handler or the user gesture is lost.
done when · tick each as it passesDynamic codes
Codes that point at /r/:slug so the target can change after printing.
codes (id, slug unique, target_url, label, created_at, updated_at, active). Slugs 6+ characters from an alphabet without 0/O/1/l/I, CSPRNG-generated, or custom.
Files
server.mjs302 to target_url. Unknown or inactive slugs redirect to FALLBACK_URL rather than 404ing.
Editing a target must never change the slug. Deactivating keeps the row. Each row shows its code image and a download button.
done when · tick each as it passeswatch out- A slug is permanent. Rewriting one invalidates every printed code that uses it, which is the one unrecoverable mistake this tool can make.
Scan analytics
Counts you can explain, written after the redirect.
scans (id, code_id, scanned_at, referer, user_agent_class, ip_hash). Never before the 302.
Link scanners and chat previewers inflate counts otherwise.
done when · tick each as it passesDeploy
Live on the domain you will keep, backed up, documented.
Files
deploy/qr.serviceCaddyfileREADME: the domain-is-forever warning stated once plainly, which error-correction level is used and why it changes with a logo, and when to use static instead of dynamic.
Files
README.md
done when · tick each as it passesOperate it like a productproduct builder
Only for the product-builder path: know when the redirect is down, never lose the database, and keep the server patched.
Answer 200 with the build id and a quick database read. Point a free uptime monitor (or your own, from the Healthchecks entry on this site) at it so an outage is noticed before a user notices.
One JSON line per request: method, path, status, duration, no raw IPs. Rotate weekly with logrotate, keep eight.
SQLite's .backup command makes a consistent copy while the app runs. Copy it to object storage or a second machine; then, once, restore it into a fresh checkout and confirm the app reads it.
terminalsqlite3 data/app.db ".backup '/tmp/app-$(date +%F).db'" rclone copy /tmp/app-$(date +%F).db remote:backups/
Firewall allowing only 22, 80 and 443; unattended security updates on; the app running as an unprivileged user under systemd with Restart=on-failure.
done when · tick each as it passes
That is the whole plan for QR Tiger. What it deliberately does not cover is below · check the gaps before you call it a replacement.
- Hosted redirects on someone else's short domain. Yours must be a domain you will keep.
- Their scan-analytics product and bulk generation UI.
- hosted dynamic-QR redirects on their domain
- their scan-analytics dashboard
- bulk generation UI
- Bulk creation from a CSV with a ZIP of PNGs
- Per-code UTM parameters appended on redirect
Need the files? The project pack on the verdict page hands your agent the whole brief · more qr codes.