2 ms·
I like the idea, as this is something we struggled with when we rebuilt Expedia's "Viewfinder" client-side app in universal React (SEO being the main reason for
by girvo 11y ago
I like the idea, as this is something we struggled with when we rebuilt Expedia's "Viewfinder" client-side app in universal React (SEO being the main reason for the project, despite being a client-side web app...).
One thing that becomes interesting though, is that all of the advice in the comments here saying "Follow the router!" works brilliantly if you've got a website-style app that you need to build. For us, the router is rather confusing, and all params are optional; it's more of a filter than anything else!
Because of that, we followed the more "convetional" (heh) tree: top level src/ folder, server/, client/, shared/ underneath it. Server and client only hold their respective entry points, and a few modules for the server-side behaviour (middleware and so on).
Under shared/ we have components/ which are separated into folders based on grouped functionality. Like so: https://i.imgur.com/9T0AX52.png https://i.imgur.com/9T0AX52.png
While that's slightly subjective, it worked in our case very well, and at the end of the day solid naming of your components means CtrlP becomes a lot more useful ;)