T
TanStack4mo ago
optimistic-gold

Directory Structure Best Practice

Which one makes more sense? Why? 1. Combined: where you put each features extra directories like components and services inside the routes directory. 2. Separated: where you put each features extra directories inside a shared component or feature directory.
No description
No description
3 Replies
genetic-orange
genetic-orange4mo ago
How about grouping by domain, so you have a features/posts/components and features/posts/services?
foreign-sapphire
foreign-sapphire4mo ago
we actually do that and it works well but I actually have that outside the routes as the features can be used across different pages I only use routing for: - navigation - data loading - layout/ Majority of biz logic is outside of the routes but thats my 2 cents
optimistic-gold
optimistic-goldOP4mo ago
Yeah that's cool too. Thansk

Did you find this page helpful?