惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

L
LangChain Blog
Recent Announcements
Recent Announcements
GbyAI
GbyAI
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Microsoft Azure Blog
Microsoft Azure Blog
N
Netflix TechBlog - Medium
人人都是产品经理
人人都是产品经理
MongoDB | Blog
MongoDB | Blog
D
DataBreaches.Net
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
WordPress大学
WordPress大学
U
Unit 42
腾讯CDC
D
Docker
The GitHub Blog
The GitHub Blog
阮一峰的网络日志
阮一峰的网络日志
Vercel News
Vercel News
I
InfoQ
Jina AI
Jina AI
爱范儿
爱范儿
宝玉的分享
宝玉的分享
博客园 - Franky
G
Google Developers Blog
P
Proofpoint News Feed

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
I scanned Dub's codebase. It's not a link shortener.
Ryan Smith · 2026-05-27 · via DEV Community

I'm scanning one popular open source repo a day and digging into what's underneath. A CLI scanner reads the codebase in seconds, then I use the output to investigate what's actually going on architecturally.

First up: Dub — YC-backed link management. 20K+ stars.

The scan

$ npx anatomia-cli scan .

dub-monorepo                                              web-app
TypeScript · Next.js · Prisma → MySQL (80 models) · 12 packages

Stack
─────
Language     TypeScript
Framework    Next.js
Database     Prisma → MySQL (80 models)
Auth         NextAuth
AI           Vercel AI
Payments     Stripe
Testing      Vitest, Playwright
UI           shadcn/ui (Tailwind)
Services     Nodemailer · Resend · Vercel Edge Config · React Email
             Upstash QStash (+2 more)
Deploy       Vercel · GitHub Actions
Workspace    Turborepo (pnpm)

Surfaces
────────
web   Next.js · Vitest
cli   TypeScript

Enter fullscreen mode Exit fullscreen mode

6 seconds. Here's what I found when I started pulling threads.

Dub has a full fraud detection engine

The scan showed 80 Prisma models. That's a lot for a link shortener. So I looked at what those models actually are. The fraud.prisma schema has 14 @relation references — tied with program.prisma for the most connected models in the entire codebase.

There are 6 fraud rule types baked into the schema:

  • Customer email matching
  • Suspicious email domain detection
  • Banned referral source tracking
  • Paid traffic detection
  • Cross-program partner bans
  • Duplicate partner account detection

On the UI side, there are 18 dedicated fraud components — review sheets, severity indicators, fraud event tables per rule type, cross-program summaries. This isn't a checkbox feature. It's a system.

If you think of Dub as a link shortener, none of this makes sense. But Dub runs an affiliate/partner program (Dub Partners) where they pay commissions on referrals. The fraud layer exists to prevent partners from gaming the commission system. The most complex engineering in a "link shortener" is catching people who cheat.

Dub uses Anthropic to generate partner landing pages

The scan flagged AI: Vercel AI — which I didn't expect on a link management tool. I traced the imports. Three files use @ai-sdk/anthropic:

  1. generate-csv-mapping.ts — Uses Claude Sonnet 4.6 to auto-map CSV columns when bulk-importing links. You upload a spreadsheet, Claude figures out which columns are URLs, titles, tags.

  2. generate-filters.ts — AI-powered analytics filtering. Instead of clicking through dropdowns, describe what you want to see.

  3. generate-lander.ts — This is the interesting one. It uses Anthropic + Firecrawl to scrape a partner's website, then generates a custom landing page for their affiliate program. Automated partner onboarding.

None of this is mentioned in Dub's README or feature list. The scan surfaced it from the dependency tree, and the imports confirmed the usage.

85 environment variables

The .env.example has 85 variables. That's the operational complexity of running Dub yourself. Stripe keys (7 different Stripe-related variables — production, connect, app, sandbox, webhooks). Upstash for Redis, rate limiting, QStash, vector search, AND workflows. Tinybird for analytics. Resend AND SMTP for email. Google and GitHub OAuth. Vercel API keys. Encryption keys. Signing secrets.

If you're evaluating Dub's open source repo for self-hosting, the env file is the real architecture document. 85 variables means 85 external dependencies you need to configure.

447 UI components in a shared package

The @dub/ui package has 447 .tsx files. That's not a component library — it's a full design system built internally. For context, shadcn/ui ships around 50 primitives. Dub built roughly 9x that for their own product.

What I took away

Dub from the outside: link shortener.

Dub from the scan: an affiliate management platform with fraud detection, AI-generated partner landing pages, commission tracking, bounty systems, and a link shortener as the entry point. The Prisma schema tells the story — the most connected models aren't about links. They're about programs, fraud, and money.


Post 1 of "Scanning Open Source" — one repo per day. Tomorrow: Inbox Zero.

npx anatomia-cli scan .GitHub