Can I vibecode ReSlug?
price $9/moyou'd save $108/yrbuild time one sittingcategory analyticsreplaced by 0 people
YES
MOATexecution polishscale infra
Short links with click analytics, routing rules, QR codes, and bio pages
The Build Prompt
copy it and go buildready to paste · 1,652 chars
Build me a link shortener with click analytics and QR codes to replace ReSlug. Requirements:
- Cloudflare Workers via wrangler: KV for the slug lookup, D1 for the click
log. Free tier, and it runs on my own domain.
- A worker on go.mydomain.com/{slug} reads KV and 302s, writing the click to
D1 inside ctx.waitUntil so the redirect never waits on the database.
- Slugs are random 6-character base62 by default, but I can set a custom
back-half, and creating one that already exists fails loudly instead of
overwriting it.
- Log per click: slug, timestamp, country and city from request.cf, device
type parsed from the user-agent, and referer. Drop clicks whose user-agent
matches a known bot list before they reach the stats.
- Per-link routing rules: an optional country-to-URL and device-to-URL map
checked before the default destination.
- Optional expiry date, click cap, and password per link · expired or capped
links 302 to a fallback URL I set, password links show a minimal form first.
- Generate a PNG QR code for any link with the qrcode npm package, served at
/qr/{slug} and cached, so print material points at the same tracked link.
- An /admin page behind one password (wrangler secret) listing links with
clicks per day, top countries, top referrers, and device split per link.
- Secrets via wrangler secret, never in wrangler.toml. No accounts, no
third-party analytics, no telemetry.
- Out of scope: bio pages, teams, and a public API.
- README: wrangler setup, the KV namespace and D1 database, the DNS record,
and a warning that these links die with the domain, so use a domain you
intend to keep renewing.What you lose
- ✕links that outlive your own infrastructure · a domain you stop renewing takes every link with it
- ✕bot filtering that actually works · the heuristics take iteration you will not do for one project
- ✕geo and device routing rules, scheduled links, and click caps behind a dashboard instead of a config file
- ✕bio pages and branded QR codes
- ✕a REST API and webhooks other tools can call
Prior art / alternatives
Why it still works
generous free tier · the hosted product undercuts the DIY build at personal scale