Deleting features

How to remove the modules you don't need.

Every optional module is a vertical slice, and every recipe below is machine-verified: bun run verify:deletion performs each deletion in a copy of the repo and requires build, typecheck and the unit tests to pass.

The general recipe:

  1. Delete src/features/<name>/.
  2. Delete its routes under src/routes/.
  3. Remove its line from src/core/db/schema.ts (and from src/core/payment/handlers.ts / src/core/stats/handlers.ts / src/core/account/handlers.ts / src/core/jobs/handlers.ts / src/core/audit/handlers.ts / src/core/email/handlers.ts / src/core/user-detail/handlers.ts if it registered there).
  4. Remove its nav link, dashboard stat block, and messages.
  5. Run bun run db:generate for the drop migration, then build.

Credits

Delete src/features/credits/ and src/routes/_app/credits.tsx. Remove one line each from the schema barrel, payment, stats and user-detail handlers, the nav link, the credits stat in the dashboard, the balance row at the bottom of the sidebar (between the [feature: credits] comments in src/routes/_app.tsx), and the creditPacks section in src/config/plans.ts.

Files

Delete src/features/files/, src/routes/_app/files.tsx, and the two src/routes/api/files* routes. Remove the barrel line, the account and user-detail handler lines, nav link, dashboard stat, and the R2 binding in wrangler.jsonc.

Blog & docs

Delete src/features/content/, content/{blog,docs}/ and src/routes/_marketing/{blog,docs}/, then remove the blog/docs nav links (the landing page also links to docs). Keep the mdx plugin, src/mdx.d.ts and content/legal/ — the Terms and Privacy pages are core and use them.

Waitlist

Delete src/features/waitlist/, src/routes/waitlist.tsx, src/routes/_app/admin/waitlist.tsx and src/routes/api/v1/admin/waitlist.ts. Remove the barrel line, the core/stats, core/user-detail and core/account handler lines, the admin nav row, the waitlist.* labels in src/routes/_app/admin/index.tsx, the waitlist flag in src/config/app-config.ts and the call-to-action branches that read it.

Notifications

Delete src/features/notifications/. Remove the barrel line, the core/notify and core/account handler lines, and the bell (between the [feature: notifications] comments in src/routes/_app.tsx — the sidebar's top row and the mobile bar). src/core/notify/ stays: with no sink registered, every notify() call is a no-op.

Analytics

Delete src/features/analytics/, src/routes/api/ph/$.ts and the analytics block in src/config/app-config.ts. Remove its lines from the core/payment, core/audit and core/account handler registries. It has no tables, so there is no migration. Leaving the PostHog key empty switches it off without deleting anything.

Audit log

Delete src/features/audit/, src/routes/_app/admin/audit.tsx and src/routes/api/v1/admin/audit.ts. Remove one line each from the schema barrel and the core/audit, core/stats, core/user-detail, core/payment, core/account and core/jobs handler registries, plus the admin nav link. src/core/audit/ stays: with no sink registered, every audit() call in the codebase is a no-op.

Email log

Delete src/features/email-log/, src/routes/_app/admin/email-log.tsx and src/routes/api/v1/admin/emails.ts. Remove one line each from the schema barrel and the core/email, core/stats, core/user-detail, core/account and core/jobs handler registries, plus the admin nav link. src/core/email/ stays — sending keeps working, the delivery events just have no sink.

Feedback

Delete src/features/feedback/, src/routes/_app/admin/feedback.tsx and src/routes/api/v1/admin/feedback.ts. Remove one line each from the schema barrel and the core/stats and core/user-detail handler registries, the admin nav row in src/components/app-sidebar.tsx, the Help & feedback user-menu item and its dialog (between the [feature: feedback] comments in src/routes/_app.tsx), and the feedback.* labels in src/routes/_app/admin/index.tsx.

Affiliate

Delete src/features/affiliate/, src/routes/_app/affiliate.tsx, src/routes/_app/admin/affiliate.tsx and the referral redirect src/routes/r.$code.ts. Remove one line each from the schema barrel and the core/payment, core/account, core/jobs, core/stats, core/settings and core/authz handler registries. Then cut the [feature: affiliate] blocks from src/components/app-sidebar.tsx (the user and admin rows, plus the HandCoinsIcon import), the notification bell's renderers, the metric labels in src/routes/_app/admin/index.tsx, the deletion-guard branch in src/features/auth/components/account-section.tsx, the settings page's group list and src/config/private-paths.ts. Finally narrow the guard code in src/core/account/events.ts back to 'ACTIVE_SUBSCRIPTION' — nothing raises PENDING_PAYOUT any more.