title: Folder structure for modular development with PHP and vuejs (or angular)
body: <p>Essentially, I'm looking to have a PHP development workflow that needs to be modular, but using a Single Page Application technology. </p>
  
  <p>I understand it is recommended to separate the back-end from the front-end. Develop them separately. But is there a way to group all related code into one module (or folder), meaning all backend code with its own views presentation inside the same folder?</p>
  
  <p>It's like MVC, but the "V" contains fragments of vuejs (or angular) files, which extends from a master file somewhere in your project.</p>
  
  <p><strong>For example</strong></p>
  
  <p>Assume we are building a modular CMS, where you can upload "plugins" (really, PHP modules), extending the CMS' functionality:</p>
  
  <pre><code>-project[root-folder]
  ----core[folder] # contains all infrastracture code, api routes, master view file, magic, etc.
  ----modules[folder] # uploadable modules goes here
  --------User[folder] # sample module; follows the MVC pattern
  ------------Controllers[folder] # contains files, e.g. UserController.php
  ------------Models[folder] # contains User.php
  ------------views[folder] # where vue components is housed
  ----------------users/index.php # contains vue code
  ----------------users/create.php # etc...
  ----------------users/js/user.js
  ----------------users/css/user.css
  --------Blog[folder] # another module
  ----index.php # the master view or just the bootstrap file
  ----gulpfile.js
  </code></pre>
  
  <p>Then inside the core/ folder, there is a master layout that binds all views together.</p>
  
  <p>Will a folder structure like this be viable?</p>
  
  <p>Obvious problem there is you can't use .vue files (as that would mean, every time you upload a new module, you need to run gulp or re-compile).</p>
  
  <p>Hoping for your feedback. Thanks.</p>