D
D
Doxi2020-06-17 00:12:29
JavaScript
Doxi, 2020-06-17 00:12:29

Deploying a full stack project on node js and react?

There is a question about how to properly implement and deploy a full stack project.
Will it be correct to create 2 folders (server, client), where in the server folder write exactly api on node js (and return index.html from the public folder), and in the client folder write the front on the react (during development, write in package.json proxy to the port where the node js server is running), and at the end of development, build react and move all the built files to the public folder in the server folder?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
twoone, 2020-06-17
@twoone

There are two camps, the first of which advocates the separation of repositories into a client and server, and the second for a combined mono-repository. And both categories are right, because for some the project consists of a client and a server, while for others one server can be both for many clients and vice versa.
In your case, you will most likely lean towards a mono-repository (may require the use of lerna) which will consist of client\server directories and the like. Dev development can be approached in several ways. Either run a real server (there may be problems with private keys for third-party developers), or use mocks (constant synchronization is required, which can be solved by sharing mocks necessary for testing the server).
And for building and deploying, be sure to use ci \ cd (github actions for example) with which you can configure the project build as you wish.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question