Context:
I have recently joined a new company where they have a particular folder structure in the project where they have different modules in different folders in a single project. Each module folder has separate submodule and then separate child folders for back-end(in Python
) and front-end(in AngularJS
) code. Separate developers are responsible for different modules. It's my responsibility now to make this code modular.
I suggested two solutions:
having the separate git repo for front-end and back-end code
keep each module in a separate repo. Most of the back-end code returns JSON response and not HTML code, thus the front end mostly use Ajax calls to connect with the back-end.
The second one was approved.
Thus I am going to create separate git repo for the separate module and also trying to make a simple package manager script in Node.js
for downloading code according to git tag mentioned in a config.json
to create the same folder structure in a single project, kind of like how Bower does things. Only those modules which are going to be edited by the developer can be put in the config to ignore downloading and instead the developer can use git submodule
to make changes in that particular module so that they can use git
commands on the module (Commit
, pull
and push
). This is being done so that no developer can modify the code of other modules and so that we can manage the code properly by having them in a separate repo.
Current Folder Structure:
Project Root
|-app
|-common (Code used by all the modules)
| |-js
| |-py
|-modules
| |-module1
| | |-submodule1
| | | |-js
| | | |-py
| | |-submodule2
| | | |-js
| | | |-py
| | ...
| |-module2
| | |-submodule1
| | | |-js
| | | |-py
| | ...
| ...
Questions:
So my question is, is mainly how do other companies make their projects modular, specifically when both back-end and front-end code are in the same module. Is it recommended to have modules in the separate repo?(Already answered by the link provided by gnat)
Also is it good practice to have back-end and front-end together? In short, am I doing things the right way or not, to make the project modular by writing a custom script?
Current stack (In case it's required):
Back End - WebApp2 using Python
Front End - AngularJS
Cloud Platform - Google App Engine SE
HTML Templating Engine - Jade
CSS Templating Engine - Stylus
Task Runner - Gulp (We used to have grunt there, but I recently changed it to gulp)