{
  "services": [
    {
      "id": "dub-app",
      "name": "Dub Web/API App",
      "kind": "web",
      "framework": "next",
      "entrypoint": "app/",
      "evidence": [
        {
          "file": "middleware.ts",
          "lines": "1-90",
          "note": "central Next.js middleware dispatch"
        },
        {
          "file": "app/api/route.ts",
          "note": "openapi doc route, edge runtime"
        },
        {
          "file": "app/api/auth/[...nextauth]/route.tsx",
          "note": "next-auth handler"
        }
      ]
    },
    {
      "id": "dub-cron",
      "name": "Dub Cron Functions",
      "kind": "cron",
      "framework": "next",
      "entrypoint": "app/(ee)/api/cron/",
      "evidence": [
        {
          "file": "vercel.json",
          "note": "cron routes marked heavy: maxDuration=600s"
        }
      ]
    }
  ],
  "routes": [
    {
      "id": "mw-dispatch",
      "serviceId": "dub-app",
      "method": "ALL",
      "path": "/*",
      "kind": "middleware",
      "auth": "unknown",
      "reads": [],
      "writes": [],
      "externalCallIds": [],
      "work": "light",
      "trafficHint": "hot",
      "evidence": [
        {
          "file": "middleware.ts",
          "lines": "35-90",
          "note": "routes to sub-middlewares by hostname"
        }
      ],
      "confidence": "high"
    },
    {
      "id": "link-redirect",
      "serviceId": "dub-app",
      "method": "GET",
      "path": "/:domain/:key",
      "kind": "middleware",
      "auth": "public",
      "reads": [
        {
          "dataStoreId": "ds-redis",
          "pattern": "point"
        },
        {
          "dataStoreId": "ds-mysql-edge",
          "pattern": "point"
        }
      ],
      "writes": [],
      "externalCallIds": [],
      "work": "db-bound",
      "trafficHint": "hot",
      "evidence": [
        {
          "file": "lib/middleware/link.ts",
          "lines": "36-115",
          "note": "redis cache read, mysql fallback on miss via getLinkViaEdge"
        }
      ],
      "confidence": "high"
    },
    {
      "id": "mw-admin",
      "serviceId": "dub-app",
      "method": "ALL",
      "path": "/admin/*",
      "kind": "middleware",
      "auth": "admin",
      "reads": [
        {
          "dataStoreId": "ds-mysql-edge",
          "pattern": "point"
        }
      ],
      "writes": [],
      "externalCallIds": [],
      "work": "db-bound",
      "trafficHint": "rare",
      "evidence": [
        {
          "file": "lib/middleware/admin.ts",
          "note": "checks projectUsers via prismaEdge"
        }
      ],
      "confidence": "high"
    },
    {
      "id": "mw-app",
      "serviceId": "dub-app",
      "method": "ALL",
      "path": "/app/*",
      "kind": "middleware",
      "auth": "authenticated",
      "reads": [],
      "writes": [],
      "externalCallIds": [],
      "work": "light",
      "trafficHint": "hot",
      "evidence": [
        {
          "file": "lib/middleware/app.ts",
          "note": "token-based session check + redirects"
        }
      ],
      "confidence": "medium"
    },
    {
      "id": "password-link-verify-action",
      "serviceId": "dub-app",
      "method": "POST",
      "path": "/password/[linkId]",
      "kind": "server-action",
      "auth": "public",
      "reads": [
        {
          "dataStoreId": "ds-mysql-edge",
          "pattern": "point"
        }
      ],
      "writes": [],
      "externalCallIds": [],
      "work": "db-bound",
      "trafficHint": "normal",
      "evidence": [
        {
          "file": "app/password/[linkId]/action.ts",
          "note": "prismaEdge.link.findUnique + redis ratelimit on fail"
        }
      ],
      "confidence": "high"
    },
    {
      "id": "nextauth-handler",
      "serviceId": "dub-app",
      "method": "ALL",
      "path": "/api/auth/[...nextauth]",
      "kind": "api",
      "auth": "public",
      "reads": [
        {
          "dataStoreId": "ds-mysql-prisma",
          "pattern": "point"
        }
      ],
      "writes": [
        {
          "dataStoreId": "ds-mysql-prisma"
        }
      ],
      "externalCallIds": [
        "ext-google-github-oauth",
        "ext-resend-email"
      ],
      "work": "db-bound",
      "trafficHint": "hot",
      "evidence": [
        {
          "file": "app/api/auth/[...nextauth]/route.tsx"
        },
        {
          "file": "lib/auth/options.ts",
          "lines": "36-200",
          "note": "prisma adapter, saml profile lookup/create"
        }
      ],
      "confidence": "high"
    },
    {
      "id": "activity-logs-get",
      "serviceId": "dub-app",
      "method": "GET",
      "path": "/api/activity-logs",
      "kind": "api",
      "auth": "authenticated",
      "reads": [
        {
          "dataStoreId": "ds-mysql-prisma",
          "pattern": "list"
        }
      ],
      "writes": [],
      "externalCallIds": [],
      "work": "db-bound",
      "trafficHint": "normal",
      "evidence": [
        {
          "file": "app/api/activity-logs/route.ts",
          "note": "take:100, bounded list"
        }
      ],
      "confidence": "high"
    },
    {
      "id": "ai-completion-post",
      "serviceId": "dub-app",
      "method": "POST",
      "path": "/api/ai/completion",
      "kind": "api",
      "auth": "authenticated",
      "reads": [],
      "writes": [
        {
          "dataStoreId": "ds-mysql-prisma"
        }
      ],
      "externalCallIds": [
        "ext-anthropic"
      ],
      "work": "llm",
      "trafficHint": "normal",
      "evidence": [
        {
          "file": "app/api/ai/completion/route.ts",
          "note": "streamText w/ anthropic; usage increment via waitUntil"
        }
      ],
      "confidence": "high"
    },
    {
      "id": "auth-reset-password-post",
      "serviceId": "dub-app",
      "method": "POST",
      "path": "/api/auth/reset-password",
      "kind": "api",
      "auth": "public",
      "reads": [
        {
          "dataStoreId": "ds-mysql-prisma",
          "pattern": "point"
        }
      ],
      "writes": [
        {
          "dataStoreId": "ds-mysql-prisma"
        }
      ],
      "externalCallIds": [
        "ext-resend-email"
      ],
      "work": "db-bound",
      "trafficHint": "normal",
      "evidence": [
        {
          "file": "app/api/auth/reset-password/route.ts"
        }
      ],
      "confidence": "high"
    },
    {
      "id": "callback-bitly-get",
      "serviceId": "dub-app",
      "method": "GET",
      "path": "/api/callback/bitly",
      "kind": "api",
      "auth": "authenticated",
      "reads": [
        {
          "dataStoreId": "ds-mysql-prisma",
          "pattern": "point"
        }
      ],
      "writes": [
        {
          "dataStoreId": "ds-redis"
        }
      ],
      "externalCallIds": [
        "ext-bitly-oauth"
      ],
      "work": "db-bound",
      "trafficHint": "rare",
      "evidence": [
        {
          "file": "app/api/callback/bitly/route.ts"
        }
      ],
      "confidence": "high"
    },
    {
      "id": "dashboards-patch",
      "serviceId": "dub-app",
      "method": "PATCH",
      "path": "/api/dashboards/[id]",
      "kind": "api",
      "auth": "authenticated",
      "reads": [
        {
          "dataStoreId": "ds-mysql-prisma",
          "pattern": "point"
        }
      ],
      "writes": [
        {
          "dataStoreId": "ds-mysql-prisma"
        }
      ],
      "externalCallIds": [],
      "work": "db-bound",
      "trafficHint": "normal",
      "evidence": [
        {
          "file": "app/api/dashboards/[id]/route.ts"
        }
      ],
      "confidence": "high"
    },
    {
      "id": "dashboards-delete",
      "serviceId": "dub-app",
      "method": "DELETE",
      "path": "/api/dashboards/[id]",
      "kind": "api",
      "auth": "authenticated",
      "reads": [
        {
          "dataStoreId": "ds-mysql-prisma",
          "pattern": "point"
        }
      ],
      "writes": [
        {
          "dataStoreId": "ds-mysql-prisma"
        }
      ],
      "externalCallIds": [],
      "work": "db-bound",
      "trafficHint": "normal",
      "evidence": [
        {
          "file": "app/api/dashboards/[id]/route.ts",
          "note": "waitUntil link.update publicStats=false"
        }
      ],
      "confidence": "high"
    },
    {
      "id": "docs-guides-get",
      "serviceId": "dub-app",
      "method": "GET",
      "path": "/api/docs/guides/[guide]",
      "kind": "api",
      "auth": "authenticated",
      "reads": [],
      "writes": [],
      "externalCallIds": [],
      "work": "light",
      "trafficHint": "rare",
      "evidence": [
        {
          "file": "app/api/docs/guides/[guide]/route.ts"
        }
      ],
      "confidence": "medium"
    },
    {
      "id": "domains-primary-post",
      "serviceId": "dub-app",
      "method": "POST",
      "path": "/api/domains/[domain]/primary",
      "kind": "api",
      "auth": "authenticated",
      "reads": [],
      "writes": [
        {
          "dataStoreId": "ds-mysql-prisma"
        }
      ],
      "externalCallIds": [],
      "work": "db-bound",
      "trafficHint": "rare",
      "evidence": [
        {
          "file": "app/api/domains/[domain]/primary/route.ts"
        }
      ],
      "confidence": "high"
    },
    {
      "id": "dub-webhook-post",
      "serviceId": "dub-app",
      "method": "POST",
      "path": "/api/dub/webhook",
      "kind": "webhook",
      "auth": "public",
      "reads": [],
      "writes": [
        {
          "dataStoreId": "ds-mysql-prisma"
        }
      ],
      "externalCallIds": [],
      "work": "db-bound",
      "trafficHint": "normal",
      "evidence": [
        {
          "file": "app/api/dub/webhook/route.ts",
          "note": "HMAC signature verified; dispatches lead/sale handlers"
        }
      ],
      "confidence": "medium"
    },
    {
      "id": "folders-dashboard-get",
      "serviceId": "dub-app",
      "method": "GET",
      "path": "/api/folders/[folderId]/dashboard",
      "kind": "api",
      "auth": "authenticated",
      "reads": [
        {
          "dataStoreId": "ds-mysql-prisma",
          "pattern": "point"
        }
      ],
      "writes": [],
      "externalCallIds": [],
      "work": "db-bound",
      "trafficHint": "normal",
      "evidence": [
        {
          "file": "app/api/folders/[folderId]/dashboard/route.ts"
        }
      ],
      "confidence": "high"
    },
    {
      "id": "integrations-get",
      "serviceId": "dub-app",
      "method": "GET",
      "path": "/api/integrations",
      "kind": "api",
      "auth": "authenticated",
      "reads": [
        {
          "dataStoreId": "ds-mysql-prisma",
          "pattern": "list"
        }
      ],
      "writes": [],
      "externalCallIds": [],
      "work": "db-bound",
      "trafficHint": "normal",
      "evidence": [
        {
          "file": "app/api/integrations/route.ts"
        }
      ],
      "confidence": "high"
    },
    {
      "id": "links-dashboard-get",
      "serviceId": "dub-app",
      "method": "GET",
      "path": "/api/links/[linkId]/dashboard",
      "kind": "api",
      "auth": "authenticated",
      "reads": [
        {
          "dataStoreId": "ds-mysql-prisma",
          "pattern": "point"
        }
      ],
      "writes": [],
      "externalCallIds": [],
      "work": "db-bound",
      "trafficHint": "normal",
      "evidence": [
        {
          "file": "app/api/links/[linkId]/dashboard/route.ts"
        }
      ],
      "confidence": "high"
    },
    {
      "id": "logs-get",
      "serviceId": "dub-app",
      "method": "GET",
      "path": "/api/logs/[logId]",
      "kind": "api",
      "auth": "authenticated",
      "reads": [
        {
          "dataStoreId": "ds-tinybird",
          "pattern": "point"
        }
      ],
      "writes": [],
      "externalCallIds": [],
      "work": "db-bound",
      "trafficHint": "normal",
      "evidence": [
        {
          "file": "app/api/logs/[logId]/route.ts",
          "note": "getApiLogById likely queries tinybird"
        }
      ],
      "confidence": "medium"
    },
    {
      "id": "me-get",
      "serviceId": "dub-app",
      "method": "GET",
      "path": "/api/me",
      "kind": "api",
      "auth": "authenticated",
      "reads": [
        {
          "dataStoreId": "ds-mysql-prisma",
          "pattern": "point"
        }
      ],
      "writes": [],
      "externalCallIds": [],
      "work": "db-bound",
      "trafficHint": "hot",
      "evidence": [
        {
          "file": "app/api/me/route.ts"
        }
      ],
      "confidence": "high"
    },
    {
      "id": "check-favicon-get",
      "serviceId": "dub-app",
      "method": "GET",
      "path": "/api/misc/check-favicon",
      "kind": "api",
      "auth": "authenticated",
      "reads": [],
      "writes": [],
      "externalCallIds": [
        "ext-google-favicon"
      ],
      "work": "light",
      "trafficHint": "rare",
      "evidence": [
        {
          "file": "app/api/misc/check-favicon/route.ts"
        }
      ],
      "confidence": "high"
    },
    {
      "id": "oauth-apps-get",
      "serviceId": "dub-app",
      "method": "GET",
      "path": "/api/oauth/apps/[appId]",
      "kind": "api",
      "auth": "authenticated",
      "reads": [
        {
          "dataStoreId": "ds-mysql-prisma",
          "pattern": "point"
        }
      ],
      "writes": [],
      "externalCallIds": [],
      "work": "db-bound",
      "trafficHint": "rare",
      "evidence": [
        {
          "file": "app/api/oauth/apps/[appId]/route.ts",
          "lines": "12-45"
        }
      ],
      "confidence": "high"
    },
    {
      "id": "oauth-apps-patch",
      "serviceId": "dub-app",
      "method": "PATCH",
      "path": "/api/oauth/apps/[appId]",
      "kind": "api",
      "auth": "authenticated",
      "reads": [
        {
          "dataStoreId": "ds-mysql-prisma",
          "pattern": "point"
        }
      ],
      "writes": [
        {
          "dataStoreId": "ds-mysql-prisma"
        },
        {
          "dataStoreId": "ds-storage"
        }
      ],
      "externalCallIds": [
        "ext-r2-storage"
      ],
      "work": "db-bound",
      "trafficHint": "rare",
      "evidence": [
        {
          "file": "app/api/oauth/apps/[appId]/route.ts",
          "lines": "50-140",
          "note": "storage.upload for logo change"
        }
      ],
      "confidence": "high"
    },
    {
      "id": "oauth-apps-delete",
      "serviceId": "dub-app",
      "method": "DELETE",
      "path": "/api/oauth/apps/[appId]",
      "kind": "api",
      "auth": "authenticated",
      "reads": [
        {
          "dataStoreId": "ds-mysql-prisma",
          "pattern": "point"
        }
      ],
      "writes": [
        {
          "dataStoreId": "ds-mysql-prisma"
        }
      ],
      "externalCallIds": [
        "ext-r2-storage"
      ],
      "work": "db-bound",
      "trafficHint": "rare",
      "evidence": [
        {
          "file": "app/api/oauth/apps/[appId]/route.ts",
          "lines": "170-216",
          "note": "waitUntil storage.delete of logo"
        }
      ],
      "confidence": "high"
    },
    {
      "id": "postbacks-callback-post",
      "serviceId": "dub-app",
      "method": "POST",
      "path": "/api/postbacks/callback",
      "kind": "webhook",
      "auth": "public",
      "reads": [
        {
          "dataStoreId": "ds-mysql-prisma",
          "pattern": "point"
        }
      ],
      "writes": [
        {
          "dataStoreId": "ds-tinybird"
        }
      ],
      "externalCallIds": [],
      "work": "db-bound",
      "trafficHint": "normal",
      "evidence": [
        {
          "file": "app/api/postbacks/callback/route.ts",
          "note": "qstash-signature verified callback"
        }
      ],
      "confidence": "high"
    },
    {
      "id": "providers-get",
      "serviceId": "dub-app",
      "method": "GET",
      "path": "/api/providers",
      "kind": "api",
      "auth": "public",
      "reads": [],
      "writes": [],
      "externalCallIds": [
        "ext-google-dns"
      ],
      "work": "light",
      "trafficHint": "rare",
      "evidence": [
        {
          "file": "app/api/providers/route.ts",
          "note": "edge runtime, DNS+HEAD fetch"
        }
      ],
      "confidence": "high"
    },
    {
      "id": "resend-webhook-post",
      "serviceId": "dub-app",
      "method": "POST",
      "path": "/api/resend/webhook",
      "kind": "webhook",
      "auth": "public",
      "reads": [],
      "writes": [],
      "externalCallIds": [],
      "work": "db-bound",
      "trafficHint": "normal",
      "evidence": [
        {
          "file": "app/api/resend/webhook/route.ts",
          "note": "svix-verified; delegates to bounced/delivered/opened handlers"
        }
      ],
      "confidence": "medium"
    },
    {
      "id": "resumes-upload-url-post",
      "serviceId": "dub-app",
      "method": "POST",
      "path": "/api/resumes/upload-url",
      "kind": "api",
      "auth": "public",
      "reads": [],
      "writes": [],
      "externalCallIds": [
        "ext-r2-storage"
      ],
      "work": "light",
      "trafficHint": "rare",
      "evidence": [
        {
          "file": "app/api/resumes/upload-url/route.ts",
          "note": "rate limited 5/min per IP"
        }
      ],
      "confidence": "high"
    },
    {
      "id": "openapi-doc-get",
      "serviceId": "dub-app",
      "method": "GET",
      "path": "/api",
      "kind": "api",
      "auth": "public",
      "reads": [],
      "writes": [],
      "externalCallIds": [],
      "work": "light",
      "trafficHint": "rare",
      "evidence": [
        {
          "file": "app/api/route.ts",
          "note": "static openapi doc, edge runtime"
        }
      ],
      "confidence": "high"
    },
    {
      "id": "slack-callback-get",
      "serviceId": "dub-app",
      "method": "GET",
      "path": "/api/slack/callback",
      "kind": "api",
      "auth": "authenticated",
      "reads": [
        {
          "dataStoreId": "ds-mysql-prisma",
          "pattern": "point"
        }
      ],
      "writes": [
        {
          "dataStoreId": "ds-mysql-prisma"
        }
      ],
      "externalCallIds": [
        "ext-slack-oauth"
      ],
      "work": "db-bound",
      "trafficHint": "rare",
      "evidence": [
        {
          "file": "app/api/slack/callback/route.ts"
        }
      ],
      "confidence": "high"
    },
    {
      "id": "supported-countries-get",
      "serviceId": "dub-app",
      "method": "GET",
      "path": "/api/supported-countries",
      "kind": "api",
      "auth": "public",
      "reads": [],
      "writes": [],
      "externalCallIds": [],
      "work": "light",
      "trafficHint": "rare",
      "evidence": [
        {
          "file": "app/api/supported-countries/route.ts",
          "note": "force-static, cached 1yr"
        }
      ],
      "confidence": "high"
    },
    {
      "id": "tags-patch",
      "serviceId": "dub-app",
      "method": "PATCH",
      "path": "/api/tags/[id]",
      "kind": "api",
      "auth": "authenticated",
      "reads": [
        {
          "dataStoreId": "ds-mysql-prisma",
          "pattern": "point"
        }
      ],
      "writes": [
        {
          "dataStoreId": "ds-mysql-prisma"
        }
      ],
      "externalCallIds": [],
      "work": "db-bound",
      "trafficHint": "normal",
      "evidence": [
        {
          "file": "app/api/tags/[id]/route.ts"
        }
      ],
      "confidence": "high"
    },
    {
      "id": "tags-delete",
      "serviceId": "dub-app",
      "method": "DELETE",
      "path": "/api/tags/[id]",
      "kind": "api",
      "auth": "authenticated",
      "reads": [],
      "writes": [
        {
          "dataStoreId": "ds-mysql-prisma"
        }
      ],
      "externalCallIds": [],
      "work": "db-bound",
      "trafficHint": "normal",
      "evidence": [
        {
          "file": "app/api/tags/[id]/route.ts"
        }
      ],
      "confidence": "high"
    },
    {
      "id": "tokens-get",
      "serviceId": "dub-app",
      "method": "GET",
      "path": "/api/tokens/[id]",
      "kind": "api",
      "auth": "authenticated",
      "reads": [
        {
          "dataStoreId": "ds-mysql-prisma",
          "pattern": "point"
        }
      ],
      "writes": [],
      "externalCallIds": [],
      "work": "db-bound",
      "trafficHint": "normal",
      "evidence": [
        {
          "file": "app/api/tokens/[id]/route.ts",
          "lines": "12-40"
        }
      ],
      "confidence": "high"
    },
    {
      "id": "tokens-patch",
      "serviceId": "dub-app",
      "method": "PATCH",
      "path": "/api/tokens/[id]",
      "kind": "api",
      "auth": "authenticated",
      "reads": [
        {
          "dataStoreId": "ds-mysql-prisma",
          "pattern": "point"
        }
      ],
      "writes": [
        {
          "dataStoreId": "ds-mysql-prisma"
        },
        {
          "dataStoreId": "ds-redis"
        }
      ],
      "externalCallIds": [],
      "work": "db-bound",
      "trafficHint": "normal",
      "evidence": [
        {
          "file": "app/api/tokens/[id]/route.ts",
          "lines": "50-100",
          "note": "waitUntil tokenCache.set"
        }
      ],
      "confidence": "high"
    },
    {
      "id": "tokens-delete",
      "serviceId": "dub-app",
      "method": "DELETE",
      "path": "/api/tokens/[id]",
      "kind": "api",
      "auth": "authenticated",
      "reads": [],
      "writes": [
        {
          "dataStoreId": "ds-mysql-prisma"
        },
        {
          "dataStoreId": "ds-redis"
        }
      ],
      "externalCallIds": [],
      "work": "db-bound",
      "trafficHint": "normal",
      "evidence": [
        {
          "file": "app/api/tokens/[id]/route.ts",
          "lines": "105-150",
          "note": "waitUntil tokenCache.delete"
        }
      ],
      "confidence": "high"
    },
    {
      "id": "unsplash-download-post",
      "serviceId": "dub-app",
      "method": "POST",
      "path": "/api/unsplash/download",
      "kind": "api",
      "auth": "unknown",
      "reads": [],
      "writes": [],
      "externalCallIds": [
        "ext-unsplash"
      ],
      "work": "light",
      "trafficHint": "rare",
      "evidence": [
        {
          "file": "app/api/unsplash/download/route.ts",
          "note": "no auth wrapper visible"
        }
      ],
      "confidence": "medium"
    },
    {
      "id": "notification-prefs-get",
      "serviceId": "dub-app",
      "method": "GET",
      "path": "/api/user/notification-preferences",
      "kind": "api",
      "auth": "public",
      "reads": [
        {
          "dataStoreId": "ds-mysql-prisma",
          "pattern": "point"
        }
      ],
      "writes": [],
      "externalCallIds": [],
      "work": "db-bound",
      "trafficHint": "normal",
      "evidence": [
        {
          "file": "app/api/user/notification-preferences/route.ts",
          "note": "token-based, not session auth"
        }
      ],
      "confidence": "high"
    },
    {
      "id": "notification-prefs-post",
      "serviceId": "dub-app",
      "method": "POST",
      "path": "/api/user/notification-preferences",
      "kind": "api",
      "auth": "public",
      "reads": [
        {
          "dataStoreId": "ds-mysql-prisma",
          "pattern": "point"
        }
      ],
      "writes": [
        {
          "dataStoreId": "ds-mysql-prisma"
        }
      ],
      "externalCallIds": [],
      "work": "db-bound",
      "trafficHint": "normal",
      "evidence": [
        {
          "file": "app/api/user/notification-preferences/route.ts"
        }
      ],
      "confidence": "high"
    },
    {
      "id": "utm-patch",
      "serviceId": "dub-app",
      "method": "PATCH",
      "path": "/api/utm/[id]",
      "kind": "api",
      "auth": "authenticated",
      "reads": [
        {
          "dataStoreId": "ds-mysql-prisma",
          "pattern": "point"
        }
      ],
      "writes": [
        {
          "dataStoreId": "ds-mysql-prisma"
        }
      ],
      "externalCallIds": [
        "ext-upstash-qstash"
      ],
      "work": "db-bound",
      "trafficHint": "normal",
      "evidence": [
        {
          "file": "app/api/utm/[id]/route.ts",
          "note": "waitUntil enqueues sync-utm cron via qstash"
        }
      ],
      "confidence": "high"
    },
    {
      "id": "utm-delete",
      "serviceId": "dub-app",
      "method": "DELETE",
      "path": "/api/utm/[id]",
      "kind": "api",
      "auth": "authenticated",
      "reads": [
        {
          "dataStoreId": "ds-mysql-prisma",
          "pattern": "point"
        }
      ],
      "writes": [
        {
          "dataStoreId": "ds-mysql-prisma"
        }
      ],
      "externalCallIds": [],
      "work": "db-bound",
      "trafficHint": "normal",
      "evidence": [
        {
          "file": "app/api/utm/[id]/route.ts"
        }
      ],
      "confidence": "high"
    },
    {
      "id": "veriff-webhook-post",
      "serviceId": "dub-app",
      "method": "POST",
      "path": "/api/veriff/webhook",
      "kind": "webhook",
      "auth": "public",
      "reads": [],
      "writes": [],
      "externalCallIds": [],
      "work": "db-bound",
      "trafficHint": "normal",
      "evidence": [
        {
          "file": "app/api/veriff/webhook/route.ts",
          "note": "HMAC signed; delegates to session/decision handlers"
        }
      ],
      "confidence": "medium"
    },
    {
      "id": "webhooks-events-get",
      "serviceId": "dub-app",
      "method": "GET",
      "path": "/api/webhooks/[webhookId]/events",
      "kind": "api",
      "auth": "authenticated",
      "reads": [
        {
          "dataStoreId": "ds-mysql-prisma",
          "pattern": "point"
        },
        {
          "dataStoreId": "ds-tinybird",
          "pattern": "list"
        }
      ],
      "writes": [],
      "externalCallIds": [],
      "work": "db-bound",
      "trafficHint": "rare",
      "evidence": [
        {
          "file": "app/api/webhooks/[webhookId]/events/route.ts",
          "note": "gated to business+ plans"
        }
      ],
      "confidence": "high"
    },
    {
      "id": "billing-activate-paid-plan-post",
      "serviceId": "dub-app",
      "method": "POST",
      "path": "/api/workspaces/[idOrSlug]/billing/activate-paid-plan",
      "kind": "api",
      "auth": "authenticated",
      "reads": [],
      "writes": [],
      "externalCallIds": [
        "ext-stripe"
      ],
      "work": "light",
      "trafficHint": "rare",
      "evidence": [
        {
          "file": "app/api/workspaces/[idOrSlug]/billing/activate-paid-plan/route.ts"
        }
      ],
      "confidence": "high"
    },
    {
      "id": "share-dashboard-page-get",
      "serviceId": "dub-app",
      "method": "GET",
      "path": "/share/[dashboardId]",
      "kind": "page",
      "auth": "public",
      "reads": [
        {
          "dataStoreId": "ds-mysql-prisma",
          "pattern": "point"
        }
      ],
      "writes": [],
      "externalCallIds": [],
      "work": "db-bound",
      "trafficHint": "normal",
      "evidence": [
        {
          "file": "app/app.dub.co/(share)/share/[dashboardId]/page.tsx"
        }
      ],
      "confidence": "high"
    },
    {
      "id": "share-dashboard-verify-password-action",
      "serviceId": "dub-app",
      "method": "POST",
      "path": "/share/[dashboardId]",
      "kind": "server-action",
      "auth": "public",
      "reads": [
        {
          "dataStoreId": "ds-mysql-prisma",
          "pattern": "point"
        }
      ],
      "writes": [],
      "externalCallIds": [],
      "work": "db-bound",
      "trafficHint": "normal",
      "evidence": [
        {
          "file": "app/app.dub.co/(share)/share/[dashboardId]/action.ts"
        }
      ],
      "confidence": "high"
    },
    {
      "id": "wellknown-get",
      "serviceId": "dub-app",
      "method": "GET",
      "path": "/wellknown/[domain]/[file]",
      "kind": "api",
      "auth": "public",
      "reads": [
        {
          "dataStoreId": "ds-mysql-prisma",
          "pattern": "point"
        }
      ],
      "writes": [],
      "externalCallIds": [],
      "work": "db-bound",
      "trafficHint": "normal",
      "evidence": [
        {
          "file": "app/wellknown/[domain]/[file]/route.ts"
        }
      ],
      "confidence": "high"
    },
    {
      "id": "admin-analytics-get",
      "serviceId": "dub-app",
      "method": "GET",
      "path": "/api/admin/analytics",
      "kind": "api",
      "auth": "admin",
      "reads": [
        {
          "dataStoreId": "ds-tinybird",
          "pattern": "aggregate"
        }
      ],
      "writes": [],
      "externalCallIds": [],
      "work": "cpu",
      "trafficHint": "rare",
      "evidence": [
        {
          "file": "app/(ee)/api/admin/analytics/route.ts"
        }
      ],
      "confidence": "medium"
    }
  ],
  "dataStores": [
    {
      "id": "ds-mysql-prisma",
      "kind": "mysql",
      "provider": "planetscale",
      "orm": "prisma",
      "tableCount": 82,
      "connection": "pool",
      "evidence": [
        {
          "file": "prisma/schema/schema.prisma",
          "lines": "1-9",
          "note": "provider mysql, 36 schema files, 82 models"
        },
        {
          "file": "app/api/me/route.ts",
          "note": "@/lib/prisma used in node runtime routes"
        }
      ]
    },
    {
      "id": "ds-mysql-edge",
      "kind": "mysql",
      "provider": "planetscale (serverless driver)",
      "orm": "prisma",
      "connection": "serverless-driver",
      "evidence": [
        {
          "file": "lib/middleware/admin.ts",
          "note": "prismaEdge used in edge middleware"
        },
        {
          "file": "app/password/[linkId]/action.ts",
          "note": "prismaEdge.link.findUnique"
        },
        {
          "file": "lib/middleware/link.ts",
          "lines": "20-27",
          "note": "getLinkViaEdge, getPartnerEnrollmentInfo via ../planetscale"
        }
      ]
    },
    {
      "id": "ds-redis",
      "kind": "redis",
      "provider": "upstash",
      "connection": "http-api",
      "evidence": [
        {
          "file": "lib/middleware/link.ts",
          "lines": "84-125",
          "note": "linkCache get/set via upstash redis"
        },
        {
          "file": "app/api/callback/bitly/route.ts",
          "note": "redis.set import token"
        },
        {
          "file": "lib/auth/confirm-email-change.ts",
          "note": "redis.set email-change-request"
        }
      ]
    },
    {
      "id": "ds-tinybird",
      "kind": "other",
      "provider": "tinybird",
      "connection": "http-api",
      "evidence": [
        {
          "file": "lib/middleware/link.ts",
          "lines": "1-2",
          "note": "recordClick imported from lib/tinybird"
        },
        {
          "file": "app/api/postbacks/callback/route.ts",
          "note": "recordPostbackEvent writes to tinybird"
        },
        {
          "file": "app/api/webhooks/[webhookId]/events/route.ts",
          "note": "getWebhookEvents reads tinybird"
        }
      ]
    },
    {
      "id": "ds-storage",
      "kind": "object-storage",
      "provider": "cloudflare-r2",
      "connection": "http-api",
      "evidence": [
        {
          "file": "app/api/resumes/upload-url/route.ts",
          "note": "storage.getSignedUploadUrl, R2_URL env"
        },
        {
          "file": "app/api/oauth/apps/[appId]/route.ts",
          "lines": "60-75",
          "note": "storage.upload/delete for logos"
        }
      ]
    }
  ],
  "jobs": [
    {
      "id": "cron-domains-verify",
      "trigger": "cron",
      "schedule": "0 * * * *",
      "description": "Verify domain DNS configuration hourly",
      "evidence": [
        {
          "file": "vercel.json",
          "note": "cron -> /api/cron/domains/verify"
        }
      ],
      "confidence": "medium"
    },
    {
      "id": "cron-email-domains-verify",
      "trigger": "cron",
      "schedule": "0 * * * *",
      "description": "Verify custom email sending domains",
      "evidence": [
        {
          "file": "vercel.json"
        }
      ],
      "confidence": "medium"
    },
    {
      "id": "cron-domains-renewal-reminders",
      "trigger": "cron",
      "schedule": "0 8 * * *",
      "description": "Send domain renewal reminder emails",
      "evidence": [
        {
          "file": "vercel.json"
        }
      ],
      "confidence": "medium"
    },
    {
      "id": "cron-domains-renewal-payments",
      "trigger": "cron",
      "schedule": "0 8 * * *",
      "description": "Process domain renewal payments",
      "evidence": [
        {
          "file": "vercel.json"
        }
      ],
      "confidence": "medium"
    },
    {
      "id": "cron-streams-send-link-clicked-webhooks",
      "trigger": "cron",
      "schedule": "* * * * *",
      "description": "Dispatch link.clicked webhooks from click stream, per-minute",
      "evidence": [
        {
          "file": "vercel.json"
        }
      ],
      "confidence": "medium"
    },
    {
      "id": "cron-streams-update-workspace-clicks",
      "trigger": "cron",
      "schedule": "* * * * *",
      "description": "Aggregate workspace click counters, per-minute",
      "evidence": [
        {
          "file": "vercel.json"
        }
      ],
      "confidence": "medium"
    },
    {
      "id": "cron-streams-update-workspace-links-usage",
      "trigger": "cron",
      "schedule": "* * * * *",
      "description": "Update workspace links usage counters, per-minute",
      "evidence": [
        {
          "file": "vercel.json"
        }
      ],
      "confidence": "medium"
    },
    {
      "id": "cron-streams-update-partner-stats",
      "trigger": "cron",
      "schedule": "*/2 * * * *",
      "description": "Update partner stats from event stream",
      "evidence": [
        {
          "file": "vercel.json"
        }
      ],
      "confidence": "medium"
    },
    {
      "id": "cron-partner-platforms-website",
      "trigger": "cron",
      "schedule": "* * * * *",
      "description": "Crawl/verify partner website platforms, per-minute",
      "evidence": [
        {
          "file": "vercel.json"
        }
      ],
      "confidence": "medium"
    },
    {
      "id": "cron-partner-program-summary",
      "trigger": "cron",
      "schedule": "0 13 1 * *",
      "description": "Monthly partner program summary generation",
      "evidence": [
        {
          "file": "vercel.json"
        }
      ],
      "confidence": "medium"
    },
    {
      "id": "cron-pending-applications-summary",
      "trigger": "cron",
      "schedule": "0 9 * * *",
      "description": "Daily pending program applications summary email",
      "evidence": [
        {
          "file": "vercel.json"
        }
      ],
      "confidence": "medium"
    },
    {
      "id": "cron-trial-emails",
      "trigger": "cron",
      "schedule": "0 * * * *",
      "description": "Send trial lifecycle emails hourly",
      "evidence": [
        {
          "file": "vercel.json"
        }
      ],
      "confidence": "medium"
    },
    {
      "id": "cron-payouts-aggregate-due-commissions",
      "trigger": "cron",
      "schedule": "0 * * * *",
      "description": "Aggregate due commissions into payouts hourly",
      "evidence": [
        {
          "file": "vercel.json"
        }
      ],
      "confidence": "medium"
    },
    {
      "id": "cron-trigger-withdrawal",
      "trigger": "cron",
      "schedule": "0 1,13 * * *",
      "description": "Trigger scheduled withdrawals twice daily",
      "evidence": [
        {
          "file": "vercel.json"
        }
      ],
      "confidence": "medium"
    },
    {
      "id": "cron-trigger-backup",
      "trigger": "cron",
      "schedule": "40 0,8,12,20 * * *",
      "description": "Trigger DB backup 4x daily",
      "evidence": [
        {
          "file": "vercel.json"
        }
      ],
      "confidence": "medium"
    },
    {
      "id": "cron-payouts-force-withdrawals",
      "trigger": "cron",
      "schedule": "0 12 * * *",
      "description": "Force withdrawal processing daily",
      "evidence": [
        {
          "file": "vercel.json"
        }
      ],
      "confidence": "medium"
    },
    {
      "id": "cron-payouts-reminders-partners",
      "trigger": "cron",
      "schedule": "0 14 * * *",
      "description": "Send payout reminder emails to partners daily",
      "evidence": [
        {
          "file": "vercel.json"
        }
      ],
      "confidence": "medium"
    },
    {
      "id": "cron-payouts-reminders-program-owners",
      "trigger": "cron",
      "schedule": "0 13 25-31,1-5 * *",
      "description": "Send payout reminders to program owners near month-end",
      "evidence": [
        {
          "file": "vercel.json"
        }
      ],
      "confidence": "medium"
    },
    {
      "id": "cron-bounties-queue-sync-social-metrics",
      "trigger": "cron",
      "schedule": "0 * * * *",
      "description": "Queue bounty social metrics sync jobs hourly",
      "evidence": [
        {
          "file": "vercel.json"
        }
      ],
      "confidence": "medium"
    },
    {
      "id": "cron-sitemaps-queue",
      "trigger": "cron",
      "schedule": "0 2 * * *",
      "description": "Queue sitemap import jobs nightly",
      "evidence": [
        {
          "file": "vercel.json"
        }
      ],
      "confidence": "medium"
    },
    {
      "id": "cron-webhooks-sync-click-workspaces",
      "trigger": "cron",
      "schedule": "*/5 * * * *",
      "description": "Sync click workspaces for webhook dispatch every 5 min",
      "evidence": [
        {
          "file": "vercel.json"
        }
      ],
      "confidence": "medium"
    },
    {
      "id": "inline-link-cache-warm",
      "trigger": "inline",
      "description": "Cache warm + partner enrollment lookup via waitUntil in link redirect handler",
      "evidence": [
        {
          "file": "lib/middleware/link.ts",
          "lines": "95-120",
          "note": "ev.waitUntil linkCache.set + getPartnerEnrollmentInfo"
        }
      ],
      "confidence": "high"
    },
    {
      "id": "inline-reset-password-email",
      "trigger": "inline",
      "description": "Send password-reset confirmation email post-response",
      "evidence": [
        {
          "file": "app/api/auth/reset-password/route.ts",
          "note": "waitUntil sendEmail after transaction"
        }
      ],
      "confidence": "high"
    },
    {
      "id": "inline-ai-usage-increment",
      "trigger": "inline",
      "description": "Increment workspace aiUsage counter post-response",
      "evidence": [
        {
          "file": "app/api/ai/completion/route.ts",
          "note": "waitUntil prisma.project.update"
        }
      ],
      "confidence": "high"
    },
    {
      "id": "inline-confirm-email-change",
      "trigger": "inline",
      "description": "Send email-change confirmation OTP post-response",
      "evidence": [
        {
          "file": "lib/auth/confirm-email-change.ts",
          "note": "waitUntil sendEmail"
        }
      ],
      "confidence": "high"
    },
    {
      "id": "inline-token-last-used-update",
      "trigger": "inline",
      "description": "Rate-limited async update of API token lastUsed timestamp",
      "evidence": [
        {
          "file": "lib/auth/partner.ts",
          "lines": "140-165",
          "note": "waitUntil ratelimit + prisma.token.update"
        }
      ],
      "confidence": "high"
    },
    {
      "id": "queue-utm-sync",
      "trigger": "queue",
      "queueProvider": "upstash-qstash",
      "description": "Enqueue partner group default-link UTM sync after template update",
      "evidence": [
        {
          "file": "app/api/utm/[id]/route.ts",
          "note": "waitUntil qstash.publishJSON to /api/cron/groups/sync-utm"
        }
      ],
      "confidence": "high"
    },
    {
      "id": "inline-oauth-app-cleanup",
      "trigger": "inline",
      "description": "Delete old logo/screenshots from storage post-response",
      "evidence": [
        {
          "file": "app/api/oauth/apps/[appId]/route.ts",
          "lines": "120-140"
        }
      ],
      "confidence": "high"
    },
    {
      "id": "inline-integration-asset-cleanup",
      "trigger": "inline",
      "description": "Cleanup replaced integration logo/screenshots post-response",
      "evidence": [
        {
          "file": "lib/actions/add-edit-integration.ts",
          "note": "waitUntil storage.delete + deleteScreenshots"
        }
      ],
      "confidence": "high"
    },
    {
      "id": "inline-tokens-cache-sync",
      "trigger": "inline",
      "description": "Sync restricted-token cache on update/delete post-response",
      "evidence": [
        {
          "file": "app/api/tokens/[id]/route.ts",
          "note": "waitUntil tokenCache.set/delete"
        }
      ],
      "confidence": "high"
    }
  ],
  "externals": [
    {
      "id": "ext-anthropic",
      "category": "llm",
      "provider": "anthropic (via ai / @ai-sdk/anthropic)",
      "blocking": true,
      "evidence": [
        {
          "file": "app/api/ai/completion/route.ts",
          "note": "streamText(anthropic(model))"
        },
        {
          "file": "lib/ai/generate-partner-network-invite-email.ts",
          "lines": "1-20,90-110",
          "note": "generateText awaited in server action"
        }
      ]
    },
    {
      "id": "ext-stripe",
      "category": "payments",
      "provider": "stripe",
      "blocking": true,
      "evidence": [
        {
          "file": "app/api/workspaces/[idOrSlug]/billing/activate-paid-plan/route.ts"
        }
      ]
    },
    {
      "id": "ext-resend-email",
      "category": "email",
      "provider": "resend (@dub/email)",
      "blocking": true,
      "evidence": [
        {
          "file": "lib/auth/options.ts",
          "lines": "94-104",
          "note": "sendVerificationRequest awaits sendEmail for magic link"
        },
        {
          "file": "app/api/auth/reset-password/route.ts",
          "note": "wrapped in waitUntil, fire-and-forget"
        }
      ]
    },
    {
      "id": "ext-google-github-oauth",
      "category": "auth",
      "provider": "google/github oauth (next-auth)",
      "blocking": true,
      "evidence": [
        {
          "file": "lib/auth/options.ts",
          "lines": "105-118"
        }
      ]
    },
    {
      "id": "ext-upstash-qstash",
      "category": "other",
      "provider": "upstash-qstash",
      "blocking": false,
      "evidence": [
        {
          "file": "app/api/utm/[id]/route.ts",
          "note": "publishJSON inside waitUntil, not awaited by user"
        }
      ]
    },
    {
      "id": "ext-r2-storage",
      "category": "storage",
      "provider": "cloudflare-r2",
      "blocking": true,
      "evidence": [
        {
          "file": "app/api/resumes/upload-url/route.ts",
          "note": "getSignedUploadUrl awaited"
        },
        {
          "file": "app/api/oauth/apps/[appId]/route.ts",
          "lines": "60-75"
        }
      ]
    },
    {
      "id": "ext-unsplash",
      "category": "other",
      "provider": "unsplash",
      "blocking": true,
      "evidence": [
        {
          "file": "app/api/unsplash/download/route.ts"
        }
      ]
    },
    {
      "id": "ext-google-dns",
      "category": "other",
      "provider": "google-dns / target-host HEAD probe",
      "blocking": true,
      "evidence": [
        {
          "file": "app/api/providers/route.ts"
        }
      ]
    },
    {
      "id": "ext-google-favicon",
      "category": "other",
      "provider": "google favicon service",
      "blocking": true,
      "evidence": [
        {
          "file": "app/api/misc/check-favicon/route.ts"
        }
      ]
    },
    {
      "id": "ext-slack-oauth",
      "category": "other",
      "provider": "slack",
      "blocking": true,
      "evidence": [
        {
          "file": "app/api/slack/callback/route.ts"
        }
      ]
    },
    {
      "id": "ext-bitly-oauth",
      "category": "other",
      "provider": "bitly",
      "blocking": true,
      "evidence": [
        {
          "file": "app/api/callback/bitly/route.ts"
        }
      ]
    },
    {
      "id": "ext-veriff",
      "category": "other",
      "provider": "veriff (identity verification)",
      "blocking": true,
      "evidence": [
        {
          "file": "lib/veriff/schema.ts",
          "note": "session create schema; no direct call site shown"
        }
      ]
    }
  ],
  "realtime": [],
  "warnings": [
    "Deterministic inventory lists ~600+ routes; only routes with directly shown source were modeled in detail (~48 of them).",
    "Cron job internals (app/(ee)/api/cron/**) not shown as source; job entries derived from vercel.json schedule facts plus inventory path existence (medium confidence).",
    "HubSpot/Intercom/AppsFlyer/Shopify/Veriff webhook and OAuth routes exist per inventory but source wasn't shown, so most were excluded from routes[] except veriff/resend/dub/postbacks which had source.",
    "No websocket/SSE/polling implementation observed in shown files; realtime left empty though large surface area wasn't fully inspected.",
    "@upstash/qstash and 'ai' SDK usage confirmed via source; other installed SDKs (stripe, next-auth) confirmed used; not all installed SDKs were verified as called."
  ],
  "schemaVersion": 0,
  "meta": {
    "source": "github",
    "repo": "https://github.com/dubinc/dub",
    "analyzedAt": "2026-07-07T18:47:07.877Z",
    "fileCount": 3415,
    "extractorModel": "anthropic/claude-sonnet-5",
    "skeramVersion": "0.0.1",
    "commit": "6e7eb2892dd1",
    "framework": "next",
    "deployHint": "vercel"
  }
}