A self-hosted URL shortener for marketing teams, built with Next.js, TypeScript and PostgreSQL. It covers custom slugs on your own domain, QR codes, privacy-friendly click stats by day, referrer and country, expiry, password links, tags and a REST API with personal API keys.
by Light CloudNewsletters and links


The team's name, website and contact email are edited in the app under Settings, Short domain, the time zone for daily click counts with TZ, what counts as a click in src/lib/links/clicks.ts and the reserved slugs in src/lib/links/slugs.ts; the demo Asheville Coffee Roasters team is in src/lib/demo, and its press kit link's password is blueridge. A click only adds one to a daily counter per link, referrer domain and country, while team members' sign-in sessions keep their IP address and browser, as Better Auth does by default. Countries come only from a header a CDN such as Cloudflare adds, and Light Cloud adds none, so every click counts under Unknown unless a CDN sits in front of the app. The API limit of 120 requests a minute per key and the password-attempt limit are kept in memory per instance, so they are looser when several instances run. Light Cloud apps scale to zero, so the first click after a quiet spell waits while the app starts unless you set a minimum of one instance.
Yes. This link shortener is MIT licensed and built with Next.js 16, PostgreSQL, Drizzle ORM and Better Auth. It shows clicks by day, referrer and country, makes QR codes, and runs with no third-party keys.
Not for clicks. A click only adds one to a daily counter per link, referring domain and country, and no IP address, cookie, user agent or full referrer URL is stored. Team members' sign-in sessions keep their IP address and browser, as Better Auth does by default.
Yes. Point the domain at the app, add it as a custom domain on your host and set APP_URL to it. Copied links, QR codes and API answers then use that domain.
A 301 is cached by browsers, so later clicks would never reach the app: you couldn't change where a link goes and the clicks wouldn't be counted. A 302 keeps both working.
The country comes only from a header the proxy or CDN in front of the app adds, such as Cloudflare's cf-ipcountry, and the app never looks up an IP address itself. Light Cloud adds no such header, so put a CDN in front of the app to see countries.