What is the proper folder architecture to apply to a web project?

5

My project comes down to PHP pages, with folder for images, css, js, and fonts.

I have already seen that some developers use one folder for project development and another folder for production. I would like to know how to work with these architectures since I am starting to use GRUNT in my projects.

    
asked by anonymous 19.02.2014 / 14:48

1 answer

2

Usually in any type of project (PHP, Java, Ruby, etc.) you have a public folder accessible to the general public through a web server (for example, the web/ folder or the public/ folder) .

In addition to this folder, you should have another folder with the source code of your application. It is in this folder that you organize the files of your project. For example, if you are creating a project with an MVC architecture, it would be interesting to create a app/ folder and, within it, the model/ , view/ , and controller/ folders. Of course, this folder is not accessible to the general public.

It's interesting that you download a framework to see what the folder structure is like inside it - or even use that framework for your project! In the case of PHP, one can use Zend Framework 2, Symfony 2, Laravel 4, CakePHP, etc. Most of them even have a friendly, almost native support, the GRUNT, or the tools you want to use separately, such as LESS, SASS, CoffeeScript, etc.

    
24.02.2014 / 18:16