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

Asked

Viewed 2,656 times

5

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

I’ve seen that some developers use a 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.

  • 6

    Responses based only on opinions are not good at stackoverflow, could elaborate and more objective your question. Does this project have any special requirements? here and here has some recommendations on how to ask questions

  • 2

    Depending on the technology there may be objectivity, but without specifying any the question is very broad. For example, if it were in Java Web I would suggest the default Maven directory structure and some basic packages based on 3, 4 or 5-layer architectures.

  • 1

    I made the change to the question, see if it’s clearer now.

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 folder web/ or the folder public/).

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 folder app/ and, within it, the folders model/, view/ and controller/. Of course, this folder is not accessible to the general public.

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.