Skip to content

hgaddipati1118/linktracker

Repository files navigation

LinkTracker

Track every click. Own your data.

Open-source URL shortener with analytics, file tracking, and click alerts. Runs on Cloudflare Workers — $0 to start, $5/mo for real usage.

What it does

  • Shorten URLs with custom slugs, expiration, password protection, A/B testing, geo/device routing
  • Track clicks in real-time: country, city, device, browser, referrer, UTM — with GDPR-compliant IP hashing
  • Share files like DocSend: page-by-page view analytics, email-gated access, NDA gates, watermarking
  • Get notified via email when someone clicks your link or opens your file
  • Custom domains with automatic SSL — point any domain and start tracking
  • Webhooks with HMAC signatures for Zapier/Make/n8n integration

Quick start

npx create-linktracker

Or manually:

git clone https://github.com/hgaddipati1118/linktracker
cd linktracker/worker
npm install
wrangler login
wrangler d1 create linktracker-db
wrangler d1 execute linktracker-db --file=src/db/schema.sql
wrangler dev

Deploy

One-command setup

bash scripts/setup.sh

This interactive script will:

  • Create all Cloudflare resources (D1 database, R2 bucket, KV namespace, Queues)
  • Prompt for your domain, email, and Resend API key
  • Generate cryptographic secrets automatically
  • Run the database migration
  • Deploy the worker and dashboard

Re-deploy after changes

bash scripts/deploy.sh                # Deploy worker + dashboard
bash scripts/deploy.sh --worker-only  # Deploy only the worker

Manual deploy

cd worker && wrangler deploy
cd dashboard && npm run build && wrangler pages deploy dist --project-name=linktracker-dashboard

Access it 5 ways

Interface Description
Web Dashboard React app with analytics, link management, settings
Chrome Extension Right-click, keyboard shortcut, or floating button to shorten any link
CLI lt link create https://example.com --slug demo
MCP Server AI agents (Claude, ChatGPT) can create and manage links
REST API 64 endpoints, Bearer auth, OpenAPI spec

Tech stack

  • Backend: Cloudflare Workers + Hono + D1 (SQLite) + R2 (files) + KV (cache) + Queues
  • Frontend: React + Vite + Tailwind CSS v4 + Recharts
  • Extension: Chrome Manifest V3, plain JS, shadow DOM
  • CLI: Commander.js + chalk
  • MCP: @modelcontextprotocol/sdk

Project structure

worker/        Cloudflare Worker — 64 API endpoints, 23 source files
dashboard/     React web app — analytics dashboard
extension/     Chrome Extension — 6 interaction modes
cli/           CLI tool — shorten links from terminal
mcp/           MCP server — AI agent integration
docs/          Feature specification documents
landing/       Marketing landing page

Development

# Backend
cd worker && npm install && npm run dev     # localhost:8787

# Frontend
cd dashboard && npm install && npm run dev  # localhost:5173

# Tests
cd worker && npm test                       # 960 test cases

License

AGPL-3.0 — free to self-host, modifications must be open-sourced.

About

Open-source URL shortener with analytics, file tracking, and click alerts. Runs on Cloudflare Workers.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors