TypeScript 14,874 FILES 10 FINDINGS

HOW SUPABASE
ACTUALLY WORKS

The open-source Firebase alternative. Conventions, patterns, and architecture extracted from the supabase/supabase repository by sourcebook.

QUICK_REF:
Data: React Query

WHAT_MATTERS

  • This is a monorepo — check workspace dependencies before modifying shared code

  • packages/ui/src/lib/utils/cn.ts is a hub file (imported by 57 files) — changes here ripple everywhere

  • Circular import chains detected — avoid adding to these cycles

KEY_FINDINGS

Local Supabase setup detected (supabase/ directory). Use `supabase db push` for migrations, not the dashboard.

HIGH

This is a monorepo. Changes may affect multiple packages. Check workspace dependencies before modifying shared code.

HIGH

Tests are co-located with source files (*.test.ts next to *.ts). Keep this pattern -- don't create a separate test/ directory.

HIGH

Project uses barrel exports (index.ts files that re-export). Import from the directory, not from deep paths.

HIGH
14 barrel export files found

Project strongly prefers named exports over default exports. Use `export function` / `export const`, not `export default`.

HIGH
53 named vs 6 default exports in sampled files

Data fetching uses React Query (useQuery/useMutation). Follow this pattern for new data operations.

HIGH
15 files

Hub files (most depended on): packages/ui/src/lib/utils/cn.ts (imported by 57 files); packages/pg-meta/src/pg-format/index.ts (imported by 40 files); packages/icons/src/createSupabaseIcon.ts (imported by 34 files); apps/studio/data/storage/keys.ts (imported by 24 files); packages/marketing/src/go/schemas.ts (imported by 23 files). Changes here have the widest blast radius.

HIGH

Circular import chains detected: useCommandMenuTelemetry.ts → useCommandMenuTelemetryContext.tsx; Day5.tsx → index.tsx; CustomersSliderMobile.tsx → index.tsx. Avoid adding to these cycles.

HIGH
GENERATED IN ~3 SECONDS WITH

npx sourcebook init

VIEW ON GITHUB star

RELATED_REPOS