TkDodo
Read post

The Vertical Codebase

Horizontal codebase structures that group code by type (components, hooks, utils, types) create poor cohesion and make large codebases hard to navigate. The alternative is a vertical structure that groups code by domain or feature — everything related to 'widgets' lives in src/widgets/, regardless of whether it's a component, hook, or utility. This mirrors how product teams are organized and reduces cognitive load. Shared code that spans multiple features becomes its own vertical. To enforce boundaries between verticals, tools like pnpm workspaces, Nx dependency rules, or eslint-plugin-boundaries can define public interfaces and prevent unintended coupling. The tradeoffs include difficulty choosing the right vertical and risk of duplicated implementations across teams.

    #general-programming#react#typescript
Apr 20•9m read time•From tkdodo.eu
Post cover image
Table of contents
But AI doesn’t care !?Code colocationAlign VerticallyFinding the Right VerticalBut What About Shared Code?BoundariesWhere’s the catch?
162.7K Impressions5 Comments
TkDodo's image
TkDodo

TK Dodo is a platform dedicated to sharing insights and resources on software development, technolog...

184 Followers

•

1.4K Upvotes

Would you recommend this post?

Copy link
WhatsApp
Facebook
X
New Squad
  • © 2026 Daily Dev Ltd.
  • Guidelines
  • Explore
  • Tags
  • Sources
  • Squads
  • Leaderboard