Reputation: 9522
I'm just being curious whats the proper approach to split client and server side code in git repositories and how to bring them back to work together for developing, testing and deployment?
E.g lets take an app with an laravel backend and an angular frontend.
For me it seems the proper way to put both into different git repositories e.g. app-angular-frontend and app-laravel-backend, since somehow they are independent (different build processes and tools, ...) even though they partly rely on each other heavily (apis).
However I have no idea how to probably couple this now, since the angular app should be served by the laravel backend and get the data from it. Anyhow the builded angular app has to get to the public folder of backend application?
Upvotes: 3
Views: 577
Reputation: 14568
Use separate repositories. This helps make things independent, scalable, and easy to manage.
Using your example of Laravel and Angular, assume you want to maintain two different EC2 instances - one for frontend & other for backend. The fact that they are connected to each other is not defined by same or different repositories but by security configurations like being in the same security group, being able to connect to each other etc.
Both the frameworks follow different setup procedures;
You can install one by some composer
and php artisan
commands and other by npm
and @angular/cli
.
If you want to automate this process to setup both the projects on same machine, you can write a bash script which, upon running once, does everything including cloning the repositories in two locations, generating env file conditionally, running composer and npm commands in respective directories, etc.
Upvotes: 0