Architecture report - web

next15 app ts | tw3 @radix-ui/react-slot | swr react-hook-form+zod | next-auth prisma | vitest+playwright | turbopack · generated 2026-09-17T21:04:34.927Z

Summary

web — next15 app ts | tw3 @radix-ui/react-slot | swr react-hook-form+zod | next-auth prisma | vitest+playwright | turbopack

3620 source files in 21 modules, 12806 internal imports.

6 framework errors, 18 warnings, 1 dependency cycle, 7 near-duplicate groups.

The whole project was scanned.

Modules

ModuleFilesImports inImports out
lib1228576330
ui81510941264
app/(ee)68022926
app/app.dub.co41221477
app/api1611682
tests1260109
scripts1100235
playwright56289
app/(root)1009
(root)7012
app/password407
app/inspect202
app/proxy101
app/stats101
app/banned106

Two-way coupling

These module pairs import each other. A layered design usually wants one direction only.

Dependency cycles

e.g. lib/actions/partners/create-reward.ts imports ui/partners/format-reward-description.ts

Framework findings

SeverityLocationProblem
errorlib/api/create-id.ts:2'use client' file imports the Node built-in "crypto", which cannot run in the browser.
errorlib/api/rewards/custom-reward-utils.ts:7'use client' file imports the Node built-in "crypto", which cannot run in the browser.
errorlib/auth/sso-login-programs.ts:8process.env.FRAMER_CLIENT_ID is undefined in the browser. Only NEXT_PUBLIC_* variables reach client code.
errorlib/auth/sso-login-programs.ts:9process.env.FRAMER_CLIENT_SECRET is undefined in the browser. Only NEXT_PUBLIC_* variables reach client code.
errorlib/auth/sso-login-programs.ts:22process.env.BEEHIIV_CLIENT_ID is undefined in the browser. Only NEXT_PUBLIC_* variables reach client code.
errorlib/swr/use-workspace-preferences.ts:3'use client' only counts as a directive at the top of the file, above every import.
warningapp/(ee)/admin.dub.co/(dashboard)/programs/program-categories-list.tsx:100useState needs 'use client'. No importer of this file declares the directive, so it looks like a Server Component.
warningapp/app.dub.co/(dashboard)/[slug]/(ee)/program/partners/invite-network-partner-sheet.tsx:65useState needs 'use client'. No importer of this file declares the directive, so it looks like a Server Component.
warningapp/app.dub.co/(dashboard)/[slug]/(ee)/settings/domains/email/email-domain-card.tsx:31useState needs 'use client'. No importer of this file declares the directive, so it looks like a Server Component.
warninglib/actions/partners/get-conversion-score.ts:1This looks like a server action module but never declares 'use server'.
warninglib/actions/partners/throw-if-negative-network-balance.ts:1This looks like a server action module but never declares 'use server'.
warninglib/actions/partners/trigger-aggregate-due-commissions.ts:1This looks like a server action module but never declares 'use server'.
warninglib/actions/throw-if-no-permission.ts:1This looks like a server action module but never declares 'use server'.
warningui/guides/guide-selector.tsx:46useState needs 'use client'. No importer of this file declares the directive, so it looks like a Server Component.
warningui/layout/sidebar/icons/gear.tsx:9useEffect needs 'use client'. No importer of this file declares the directive, so it looks like a Server Component.
warningui/links/link-builder/draft-controls.tsx:46useState needs 'use client'. No importer of this file declares the directive, so it looks like a Server Component.
warningui/modals/add-customer-modal.tsx:60useState needs 'use client'. No importer of this file declares the directive, so it looks like a Server Component.
warningui/modals/delete-email-domain-modal.tsx:126useState needs 'use client'. No importer of this file declares the directive, so it looks like a Server Component.
warningui/modals/google-oauth-modal.tsx:19useState needs 'use client'. No importer of this file declares the directive, so it looks like a Server Component.
warningui/modals/identity-sync-confirm-modal.tsx:144useState needs 'use client'. No importer of this file declares the directive, so it looks like a Server Component.
warningui/modals/link-builder/ab-testing/ab-testing-modal.tsx:643useState needs 'use client'. No importer of this file declares the directive, so it looks like a Server Component.
warningui/modals/link-builder/ab-testing/traffic-split-slider.tsx:54useEffect needs 'use client'. No importer of this file declares the directive, so it looks like a Server Component.
warningui/modals/link-builder/webhooks-modal.tsx:146useState needs 'use client'. No importer of this file declares the directive, so it looks like a Server Component.
warningui/partners/update-partner-tags-modal.tsx:61useRef needs 'use client'. No importer of this file declares the directive, so it looks like a Server Component.

Conventions

Maturity: established.

Enforced:

Near-duplicate files

Roughly 538 lines could be removed by consolidating these.

- ui/partners/groups/design/application-form/modals/generate-lander-modal.tsx

- ui/partners/groups/design/lander/modals/generate-lander-modal.tsx

Most depended-on files

Imported by nothing

Entry points and tests are excluded, so these are candidates for deletion.