Dub.co Project Structure
Link management infrastructure for modern teams. A high-performance Next.js application using App Router, featuring deep integration with Vercel Edge and Tinybird for analytics.
Updated 2025-12-30
Project Directory
Repository Info
- Repository-dubinc/dub
- Stars-18k+
- License-AGPL-3.0
- Last Analyzed-December 2025
Tech Stack
- Framework-Next.js (App Router)
- Language-TypeScript
- Database-PostgreSQL with Prisma
- Analytics-Tinybird (ClickHouse)
- Deployment-Vercel Edge Functions
- Styling-Tailwind CSS
Architecture Notes
Dub.co is built for high performance at the edge. It heavily utilizes Vercel Edge Functions for link redirection to ensure minimal latency. For analytics, instead of traditional relational database queries, it uses Tinybird (powered by ClickHouse) to process and serve millions of click events in real-time. The monorepo structure via Turborepo ensures clean separation between the main application logic and reusable packages like ui and utils.
Key Directories
- apps/web/app/-The heart of the application using modern Next.js patterns
- packages/tinybird/-Contains data schemas and API endpoints for analytics
- packages/ui/-A beautifully crafted, reusable component library
- packages/prisma/-Defines the core relational data model (Users, Projects, Links)
Why This Structure?
An absolute masterclass in modern Next.js development. It showcases how to build a scalable, production-ready SaaS with a focus on developer experience and end-user performance. Essential study for anyone interested in Edge Computing and Real-time Analytics.