Answer the question
In order to leave comments, you need to log in
How to properly organize the structure of a SPA project, taking into account the convenience of version control and deployment?
Hello,
I need to organize a project for the development of a single-page application (SPA), while the front-end should be developed on one of the popular js frameworks, and the project should be assembled by a build system based on gulp / webpack. The backend must be implemented on Laravel 5.x.
So, there is a front-end part, which at the output gives an assembly of js scripts and the resources they use (css, pictures, etc.), and this assembly must be interfaced with the Laravel backend.
Questions:
1) what is the most correct way to version the entire source code of the project (even with the help of git)? Make one common repository or separate for the backend and frontend?
2) how to make it easy to deploy the project (deploy)? In theory, it's good to have a snapshot / version of the project containing the actual assembly of the front-end part, the actual back-end code + migrations. The dilemma (for me personally) here is that deployment does not require front-end sources, only a ready-made assembly. The assembly is constantly rebuilt by the collector. If you make a common repository, then it will contain frontend sources that are not needed on the production server during deployment. If you make two different repositories for the frontend and backend, then how to synchronize the current build and the corresponding backend version, because for good it should be in the same repository.
I hope that it is not too chaotic, I ask for advice or links to some docks that contribute to enlightenment in this direction.
Answer the question
In order to leave comments, you need to log in
it is better to divide it into repositories
for example: "project-front-end" and "project-back-end"
you can create another repository simply with the name "project" and make two submodules for the front and backend
, I don't know how for a single deployment, but with scaling it will be enough conveniently
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question