20
loading...
This website collects cookies to deliver better user experience
If you take away nothing else from this article, at least take away this: If you want to improve your developer experience, organize your workspace. It doesn't haven't to be perfect, it just has to be consistent and intelligible.
/src
/components
/hooks
/pages
/functions
Button
component (let's say) versus where to look for a Products
page./src
/components
/product-listing
/hooks
/product-listing
/pages
/product-listing
/functions
/product-listing
shared
directories to distinguish:/src
/components
/shared
/product-listing
/hooks
/shared
/product-listing
/pages
/product-listing
/functions
/shared
/product-listing
/src
/shared
/components
/hooks
/functions
/pages
/product-listing
/components
/hooks
/functions
/pages
shared
directory is still a bit ambiguous with this domain-driven organization.Files that contain project-specific concepts but are used across multiple domains (i.e. ShoppingCart
, not found in a design system, etc.).
Files that contain generic files that could theoretically be consumed in any application (i.e. Button
, could be found in a design system, etc.).
common
(product-specific) and shared
(generic) files:/src
/shared
/components
/hooks
/functions
/pages
/common
/components
/hooks
/functions
/pages
/product-listing
/components
/hooks
/functions
/pages
common
versus shared
can vary based on context.shared
directory as an external package.// some-component.js
import { Button } from '@shared/components';
/src
/shared
/design
/data-visualization
This is a great way to keep shared, generic files in the project for convenience and experimentation before they become an external library.