4

Goal:

I want to deploy a MERN stack application for people to use it.

Problems faced with directory structure:

On the web I found some people telling that the React app should live inside the views folder which is inside my backend. Others say that the front-end and back-end must be completely two separate folders and that they must live in the main application folder.

Troubles before deployment:

The React app has its own node modules and the express app has its own. Also, both have their own localhost domain. Even the MongoDB database has its own domain. Should each of these be deployed separately?

Confusions with choosing the right service/services for deployment?

What should I choose for my purpose: Netlify, Heroku, Firebase App Engine, etc...

1 Answers1

0

Two options will work for you but I recommend that you should use two separate folders. The server folder and view folder can be at the same level. In the root folder in your project, you will have the server and view folders at the same level, which means you will have one package.json file in your root folder. So you don't have to deploy each of those separately.

RM-Digit
  • 94
  • 8