Okay, I believe that there are several possible answers to this question, I’m going to raise two possibilities and approaches.
Separate Repositories
One option would be to have two applications, one front-end and one back-end, in this scenario the ideal would be to have a well decoupled front from the backend, where communication occurs through http or sockets.
In this scenario you would have:
- A replacement for the web frontend application (HTML, CSS, JS (May or May not use something like angular, React, etc)).
- One or more backend applications
Communication occurs through one or more backend Apis consumed by the front end.
Monolith
Observing your question is quite possible that you already have a monolith, in this case it is not necessary to break it into multiple repositories.
It is possible to hold this monolith together and still make the deployment of the desired shape.
In some frameworks like Laravel in PHP, Rails in Ruby there are directories for the static files and the front controller that processes the requests.
In these cases it is possible to deploy your application outside the directory of your web server (apache, Nginx, etc.) and add a symbolic link on your web server.
UNIX and Windows operating systems have this feature, where you can create a "shortcut" to a folder within another folder, where for all purposes this shortcut is handled by the applications (e.g. Web Server) as being the folder, in this case assuming that you had an apache server on linux you could do something like this:
/var/www/aplicacao/
- Deployment directory of your application.
/var/www/aplicacao/public/
- Directory with Assets and front controller
/var/www/public_html/
- Apache Web Directory
/var/www/public_html/aplicacao/
- Symbolic link to /var/www/application/public/
Changing apache settings to serve the directory /var/www/public_html/aplicacao/
on a given domain and adjusting access settings you wouldn’t have to worry about someone being able to access files outside the directory /var/www/aplicacao/public/
when accessing your domain.
hello Thiago, as far as I know the permissions are by repository, so if you want to have different access to each one you will need to have different repositories
– Ricardo Pontual
That’s what I thought too, but since I’m new to git I thought he might have an alternative to that.
– Thiago Vieira