tl;dr: How can I create a project with React on the front-end and Express on the back-end and have only one package.json and node_modules folder?
When creating an application with a React front-end and Express back-end, I'd like to have a structure like this:
- client
- client stuff
- server
- server stuff
- .gitignore
- package.json
- etc...
Note that the React front-end is built with create-react-app
Where "client stuff" and "server stuff" is purely front- and back-end code. However the best solution(only solution?) I have been able to find is something like this. Where the client and server are running on two separate servers and client requests are proxied to the server. This solution is fine except for the fact that it requires 2 if not 3 package.json
. I'd like to keep the client and server code separated as they should be, but still within the same project and repo with a single package.json and node_modules folder.
I understand the separation of concerns between client and server and I think what I'm shooting for satisfies that but if not please let me know.