T
TanStack7mo ago
crude-lavender

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
optimistic-gold
optimistic-gold7mo ago
How about grouping by domain, so you have a features/posts/components and features/posts/services?
correct-apricot
correct-apricot7mo 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
crude-lavender
crude-lavenderOP7mo ago
Yeah that's cool too. Thansk

Did you find this page helpful?