I’m new to Vue and Node, and I’m trying to figure out how to structure my project.
On the one hand I’ve got a “vue init webpack myproject”-based frontend, while on the other hand I’ve got an Express+MongoDB based REST API. The Vue-project uses the REST API for all data-handling etc. Currently I’ve split these two into two separate Git repositories. Developmentwise this makes sense to me, since the frontend and backend should be farly loosely coupled anyway.
However, when it comes to the deployment to test and production I haven’t got a good working process yet. My plan is to host both the frontent and the backend on the same webserver. Initial deployments have been done by doing an ‘npm run build’ on the frontend project, and then manually copying the genereated files over to the \static folder in my backend project, and lastly starting up the backend server with ‘npm run start’.
This doesn’t feel good, and I’m sure there are better ways to deploy the frontend and backend.
Any thoughts or tips on how to improve the deployment process?