w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Modular web-app project structure & version control

This is just my approach, I hope it helps.

How should I approach version control? I did some prototyping with one Git repository, which turned out kind of unsatisfying, especially since I could only assign one tag for all modules. Is Git submodules the way to go here?

I could also create repos for every module, which seems cumbersome, especially since changes to the core could require changes in dependant modules, which would make sense to do in the same branch (or not?).

For every module I create a new Repo. In CakePHP these are called plugins. Plugins are very useful for things like a Log viewer, or a basic tool that you use. You can use composer to install the plugins which makes it very easy to update your application once tested locally. Also, we use this method at the company I work for. The only difference there is that we make the plugin repository private instead of public because we don't want the world to be using the code since it is a very private CRM application.

More information about this subject:

Where should I put Javascript code? Since most modules will depend on some core RequireJS modules it would make sense to keep them in one place and let Grunt distribute the minified versions into their respective CakePHP-Plugin Javascript locations.

If the JavaScript is only for 1 plugin, and 1 plugin only, then you should put it at your myplugin/webroot/js/ folder of the plugin. Because it belongs there. When you have JavaSript that is used by several plugins, or even by the core app itself, put it in your app/webroot/js folder because that makes more sense when you get into your code as a new developer.

Please note what the documentation says at http://book.cakephp.org/2.0/en/plugins.html#plugin-assets.

If you still have some questions regarding my "answer" please ask in the comments below. I hope this helps you in some way.

© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.