# Build brief — a focused alternative to LnkFlow

> **Verdict:** Partly, if you narrow it · **Buildability:** 53/100 · **Category:** Analytics
> **Source:** https://www.canitbevibecoded.com/lnkflow
> Independent editorial assessment from Can It Be Vibe Coded? Not affiliated with, endorsed by, or derived from LnkFlow. Verify current pricing and capabilities before acting.

## Context

**LnkFlow** — Branded short links with server-side click tracking and conversion attribution back to ad platforms. It currently costs $10/mo.

A short link that 302s, logs the click, and injects UTMs is genuinely straightforward on Cloudflare Workers and KV, and the prompt below builds exactly that. What is not straightforward is the loop back out to the ad platforms. Meta and Google bid against the conversion events you send them, and since ATT the browser pixel misses a large share of purchases, which is the entire reason the Conversions API and offline conversion import exist. Closing that loop means persisting fbclid and gclid at redirect time, carrying that identity to a sale that happens days later on another device, posting a Purchase with a stable event_id so it deduplicates against the pixel, rebuilding fbc in Meta's fb.1.{timestamp}.{fbclid} form, importing offline conversions to Google on gclid, gbraid, or wbraid, and reversing all of it on refund. Every one of those fails silently. That is the expensive part: the dashboard still shows clicks while the bidder optimizes against nothing.

This brief describes a focused, single-operator replacement for the part of LnkFlow that is genuinely reproducible. It is deliberately narrower than the product it replaces, and it says so in writing. Build the useful core; do not pretend to have rebuilt the rest.

## What you are building

Resolve a slug to a destination at the edge, log the click, inject UTMs, pass ad click ids through untouched, and 302.

- Ingest a known data source, calculate a focused metric set, and render a useful dashboard.
- A responsive interface with real empty, loading, success, and error states.

## Requirements

### Functional

- Cloudflare account (Workers, KV, D1).
- A domain you control.
- Wrangler CLI.

### Non-functional

- Accessibility: semantic markup, labelled controls, visible focus, and reduced-motion support.
- Security: server-side secrets, validated input, and no credentials in the client bundle.
- Reliability: retries with backoff on external calls, and a clear failure state when a provider is down.
- Portability: the operator can export their data and leave without losing it.

## Implementation brief

Build me a branded link shortener with click tracking to replace LnkFlow. Requirements:

- Cloudflare Workers via wrangler: KV for the slug lookup, D1 for the click
  log. Free tier, nothing to babysit.
- A worker on lnk.mydomain.com/{slug} reads KV, writes the click to D1 inside
  ctx.waitUntil so the redirect never waits, then 302s with X-Robots-Tag:
  noindex and Cache-Control: no-store.
- Inject UTM params at redirect time from the link's KV record, and pass
  incoming fbclid, gclid, gbraid, wbraid, and msclkid through to the
  destination untouched.
- Log per click: slug, timestamp, country from request.cf, user-agent,
  referer, and those ad click ids. Skip bot user-agents from a pattern list
  in one file.
- An /admin page behind one password (wrangler secret) to create links and
  show clicks per link per day as a plain table.
- Secrets via wrangler secret, never in wrangler.toml. No accounts, no
  third-party analytics, no telemetry.
- Out of scope: posting Purchase events back to Meta CAPI or Google offline
  conversion import · stable event_id for pixel dedup, fbc as
  fb.1.{timestamp_ms}.{fbclid}, and refund reversal. A silently wrong
  conversion feed is worse than none.
- Out of scope: TLS for domains I do not own. My own subdomain is one DNS
  record · a client's domain means Cloudflare for SaaS and DCV renewals.
- README: wrangler setup, the KV namespace and D1 database, the DNS record,
  and adding the first link.

## Delivery standard

- Inspect the repository first, then write a short implementation plan before writing code.
- Deliver the smallest complete end-to-end workflow first; every primary control must work against persisted data.
- Use real validation and storage; never substitute fake dashboards, decorative controls, hard-coded success states, or mock integrations.
- Include responsive layouts plus genuine empty, loading, success, validation, and failure states.
- Keep secrets server-side in environment variables, provide .env.example, and never commit credentials or user data.
- Add structured logs around every external call and return actionable errors without leaking sensitive details.
- Write unit tests for the core logic and one automated test of the main user journey.
- Finish with a README covering setup, architecture, data location, backups, tests, deployment, and known limitations.

## Acceptance criteria

- [ ] A clean install starts the app using only the README and .env.example.
- [ ] The primary journey works from first visit through saved result, reload, edit, export, and deletion where applicable.
- [ ] Invalid input, missing configuration, provider failure, and an empty database each have a usable state.
- [ ] The interface works at 390px and 1440px, is keyboard navigable, and shows visible focus on every control.
- [ ] Tests, type checking, linting, and a production build all pass with no ignored failures.
- [ ] No part of the interface implies a live integration, security guarantee, or scale capability that was not actually built and verified.

## Non-goals

Do not build these, and do not claim to have replaced them:

- Purchase events delivered back to Meta CAPI with stable event_id deduplication against the browser pixel.
- Google offline conversion import keyed on gclid, gbraid, or wbraid.
- Click to lead to sale attribution that survives a multi-day gap, with refund reversal.
- TLS on a customer's branded domain (Cloudflare for SaaS and 90-day DCV renewals, not one DNS record).
- Connectors, OAuth flows, and vendor API changes require constant upkeep.
- Reliability at the vendor's scale is an operations problem, not a prompt.

## What you still own after launch

- Run migrations, backups, restores, and dependency updates.
- Test the critical journey after every model, API, or hosting change.
- Monitor failures and fix the edge cases a first prompt will miss.
- Maintain every third-party integration as APIs and OAuth rules change.

## Risk

**Operational risk.** The code is achievable; dependable data, integrations, and ongoing operations are the real cost.

Editorial confidence in this assessment: high. No independent one-shot implementation is linked yet.

## Prior art

Working open-source software you can read, fork, or borrow from before starting:

- [Dub](https://github.com/dubinc/dub) — The most complete open-source link platform · analytics, custom domains, and a conversion API. Self-hostable
- [Shlink](https://github.com/shlinkio/shlink) — Self-hosted URL shortener with a REST API, click stats, and QR codes
- [YOURLS](https://github.com/YOURLS/YOURLS) — The long-running PHP shortener · drop it on any LAMP host and it works

---

Generated by [Can It Be Vibe Coded?](https://www.canitbevibecoded.com) · Full report: https://www.canitbevibecoded.com/lnkflow
