Does anyone have examples of what you consider to be well-architected react / node apps? Or just individual patterns you really like? I’m thinking about things like:
- folder structure and naming
- component breakdown and composition
- routing patterns (front end and backend)
- error handling
- custom hook abstractions
- protected routes / auth enforcement
For background: We’ve been building a number of SPA apps at work on a React / Vite / Fastify / tRPC stack and although I love the flexibility and devEx, I’ve found that it’s causing a certain amount of bikeshedding and ad-hoc architectural patterns to form, especially when we build similar features in parallel, so I’m curious how everyone else is leveling up their architectural sensibilities?
Instead of...
You would have... That, in my opinion should include tests... You can have shared components, etc... or break up sub-projects.. but within a given project, I prefer features/concerns over class/data type.edit: In the above case, controller is really a higher order hook along with a higher order function component that will get call the hook, then pass the state to the separate component for render/events.
If you're doing server components, may want something similar but different depending on architecture or out of the box structures.