Hi all, hope you are having a nice day.
So here I've been for a while giving shape to my first medium scale CMS and one of the things I deem very important now is to find a consistent structure for my directories as I see myself relocating files quite often.
I am using the MVC pattern so I have directories for classes, controllers, and views. I also have a directory called modules in which each module folder will have again the aforementioned folders.
In the application root directory I have three other folders called config, library and public. library has quite a few files with handy functions and another folder called resources where I keep almost all third party code.
Doing research in this matter I read that in order to enhance security all of the non-public files (application files) should reside outside of the root folder of the website (i.e. outside the public_html folder). This is what I am currently doing however this approach also makes it less practical for organization because i.e. any public files (js,css...) belonging to a particular module cannot be placed in the module folder. I have to create another folder that resides inside the public directory to host these files, which I don't like. I have not seen any CMS yet that has its application files outside the public folder. I wonder why that is. Any thoughts on this?
So going further to my public folder I have folders named css, js ,images (for all application images), media(for all user uploaded files), and skin(for the js and css of each module).
I find myself now wanting to put all application core inside a folder called admin in the public directory just for ease of organization. What do you think about this? Well what are your thoughts generally on CMS directory structure and code organization? Know of any enlightening resources?
Any help with this would be much appreciated.