Merge FE/BE repos into one?

I have a React frontend repo with a node/express/SQL backend repo. What is the best way to merge the two? Would it be to create an entirely new repo and have that split into two folders: “Client” / “Server” ? Then copy each respective repo into said folder?

Yeah, generally, of course the devil is in the details.
Typically your server needs to be at the root and then to develop locally, if for instance your react App development server was created with CRA you’d need to proxy to your root server to consume the api on the client side, you can use packages like concurrently to run both servers simultaneously for development.
For production, you’d only run your root server of course, meaning you’d need to run a build of your react app before the root server is up and running and then serve that build folder.

1 Like

Oof, I have some research to do.

The approach to having different repos for front-end code and back-end code has changed over the last few years.

Today the “trend” is using a monorepo approach, where you have multiple projects within the same repo, this way you can share code between each project via shared libraries. Tools like learna make full JS stack projects work seamlessly in a mono-repo.

Now the best way is very subjective, generally you can do anything you want, but there are a few standard approaches out there, but there is no formal way. As long as your able to run/build your front-end and “deploy” your backend where everything works you should be fine. To add onto this if you want/need to share code between the two “projects”, then you might need a third common library that can be used to share code between the two. Stuff like Learna, or other approaches help with these sort of tasks.

What do you mean, “share code”? I mean, the routes are connected and it is retrieving the data. Regardless thank you very much for the answer.