Edge-native URL shortener with global analytics
LinkScope is a distributed URL shortening platform built on the Cloudflare edge network. It provides fast global redirects, real-time analytics, and a modern SaaS dashboard.
Unlike traditional URL shorteners that rely on centralized servers, LinkScope runs entirely on the edge using Cloudflare Workers, enabling low latency and high scalability.
-
Global Edge Redirects Short links resolve from the nearest Cloudflare edge location.
-
Real-Time Analytics Track link clicks, devices, and geolocation in real time.
-
Secure Authentication User authentication powered by Clerk.
-
Durable Analytics Pipeline Uses Durable Objects to coordinate analytics writes.
-
User Dashboard Manage links and view analytics from a modern SaaS UI.
-
Link Expiration Optional expiry support for temporary links.
-
Device Detection Tracks desktop, mobile, and bot traffic.
┌───────────────┐
│ Next.js UI │
│ (Dashboard) │
└───────┬───────┘
│
│ JWT Auth
▼
┌─────────────────────┐
│ Cloudflare Workers │
│ (Hono API) │
└─────────┬───────────┘
│
┌──────────▼───────────┐
│ Durable Objects │
│ Analytics Engine │
└──────────┬───────────┘
│
┌──────▼───────┐
│ Cloudflare D1│
│ SQL Database│
└──────────────┘
- User creates a short link via the dashboard.
- The request is authenticated with Clerk.
- Cloudflare Worker stores the link in D1.
- When a short link is accessed:
- The Worker retrieves the target URL.
- Analytics are recorded via a Durable Object.
- The user is redirected to the original URL.
- Next.js (App Router)
- React + TypeScript
- Tailwind CSS
- shadcn/ui components
- Clerk authentication
- Cloudflare Workers
- Hono framework
- Durable Objects
- Cloudflare D1 database
- Cloudflare Edge Network
- Wrangler CLI
linkscope/
│
├─ apps/
│ ├─ api/ # Cloudflare Worker backend
│ │
│ └─ web/ # Next.js SaaS dashboard
│
├─ README.md
└─ .gitignore
git clone https://github.com/yourusername/edgelink.git
cd linkscope
cd apps/api
npx wrangler dev
Worker runs at:
http://localhost:8787
cd apps/web
npm run dev
Dashboard runs at:
http://localhost:3000
LinkScope uses Clerk for authentication.
The frontend obtains a JWT session token and sends it with API requests:
Authorization: Bearer <JWT>
The Cloudflare Worker verifies the token using Clerk’s backend SDK before processing requests.
Click analytics are processed using Durable Objects:
- Redirect request hits the Worker.
- The Worker forwards analytics events to a Durable Object.
- The Durable Object batches and writes events to D1.
- The dashboard queries aggregated analytics.
This design prevents race conditions and supports high concurrency.
Traditional URL shorteners rely on centralized servers, which increases latency for global users.
LinkScope instead runs on Cloudflare’s edge network, allowing:
- Global low-latency redirects
- Automatic scaling
- Reduced infrastructure management
- Global caching for faster link resolution
- Rate limiting at the edge
- QR code generation for links
- Aggregated analytics dashboards
- Custom domains for short links
Built by Shriyansh Sharma