Overview: Dub is a modern, open-source link attribution platform designed to help marketing teams track the performance of short links, measure conversions, and manage affiliate programs. Built with a focus on scalability and real-time analytics, it powers over 100 million clicks monthly for companies like Twilio, Buffer, and Framer. Dub operates on an open-core model—99% of its functionality is fully open source under AGPLv3, while enterprise features like SSO and advanced analytics are available via a commercial license. This makes it ideal for teams seeking full control over their link data without sacrificing enterprise-grade capabilities.
Developed with Next.js, Prisma, and Vercel, Dub is optimized for self-hosting, enabling organizations to deploy the platform internally with full data sovereignty. Its modular architecture supports integration with Upstash for Redis caching, Tinybird for analytics, and PlanetScale for scalable PostgreSQL databases, making it suitable for both small teams and large-scale marketing operations.
What You Get
- Short link management - Create, track, and customize branded short URLs with real-time click analytics and UTM parameter support.
- Conversion tracking - Measure user actions (e.g., sign-ups, purchases) triggered by short links using built-in event tracking and integration with analytics tools like Tinybird.
- Affiliate program support - Generate unique affiliate links, track referrals, and manage commission structures directly within the platform.
- Self-hosting capability - Deploy Dub on your own infrastructure with full control over data, using Prisma for database management and Upstash for Redis caching.
- Enterprise SSO/SAML - Integrate with corporate identity providers via BoxyHQ for secure, centralized authentication (Enterprise Edition only).
- Real-time analytics dashboard - Visualize link performance with metrics like clicks, conversions, and geographic distribution powered by Tinybird and ClickHouse.
Common Use Cases
- Building a branded short link campaign for product launches - Marketing teams at Framer and Vercel use Dub to create trackable, branded short URLs for campaigns while monitoring real-time engagement across email and social channels.
- Managing a multi-channel affiliate program with 10k+ partners - Companies like Perplexity use Dub to generate unique affiliate links, track conversion rates by partner, and automate commission payouts based on tracked actions.
- Problem: Losing link data to third-party URL shorteners → Solution: Self-host Dub for full ownership - Teams concerned about data privacy or vendor lock-in deploy Dub on their own servers to retain complete control over click logs and user behavior analytics.
- DevOps teams managing marketing infrastructure at scale - Engineering teams at Twilio and Buffer use Dub’s monorepo architecture (Turborepo) and Prisma-based database schema to maintain consistent, scalable link tracking across multiple marketing campaigns.
Under The Hood
The Dub monorepo is a comprehensive SaaS platform built with TypeScript and Next.js, designed to manage and analyze link analytics while offering extensible admin and partner dashboard capabilities. It leverages a modular monorepo structure to support scalable development across multiple domains including web applications, CLI tools, and embedded components.
Architecture
This project follows a layered monolithic architecture with well-defined package boundaries and cross-cutting concerns.
- The system is organized into distinct modules for UI, utilities, email, and core logic, promoting separation of concerns
- Component communication is handled through API routes and shared utility packages that ensure loose coupling
- Design patterns such as caching, centralized error handling, and middleware-based authentication enhance reusability
- The architecture supports both frontend and backend integration with a clean division between web, CLI, and embed layers
Tech Stack
Built with modern web technologies and a robust ecosystem of tools and libraries.
- The primary language is TypeScript, with Next.js powering the frontend and backend components
- Key dependencies include Zod for validation, SWR for data fetching, Stripe for payments, and Lucide React for UI icons
- Development is powered by Turbo for monorepo management, Turbopack for fast builds, and Vite for testing and dev environments
- Testing is handled through Vitest with a comprehensive suite covering unit and integration scenarios
Code Quality
Code quality reflects a mature approach to testing and error handling with some architectural trade-offs.
- The codebase includes extensive unit and integration tests, demonstrating a strong commitment to reliability
- Error handling is consistently implemented with custom error classes and try/catch blocks for robustness
- Naming conventions and code patterns are mostly consistent, though some core components show signs of technical debt
- The overall structure balances comprehensive coverage with moderate complexity in component design
What Makes It Unique
Dub stands out through its innovative use of modular architecture and enterprise-grade admin systems.
- The monorepo structure enables seamless integration between SaaS features and customizable admin dashboards
- Its enterprise edition includes a sophisticated partner dashboard with extensible logic that differentiates it from standard link management tools
- The platform’s internal UI components and shared libraries provide a unique blend of reusability and customization
- The combination of modern web frameworks with enterprise-grade admin capabilities creates a distinctive technical approach