0

I've been working with web-based solutions for some years now, Mostly PHP and WordPress projects, as this refers to. I'm not quite sure, if I structure my projects in the best way.

So, how do I structure my project in the right way?

For example, I have a project where i use Yarn for package control and gulp for my SASS and jQuery. Here my structure looks like this:

  • assets

    • css
      • style.css
      • style.min.css
    • sass
      • style.scss
    • js
      • scripts.js
      • scripts.min.js
    • img
  • node_modules

    • Bootstrap
    • jQuery
    • And so on
  • root

    • header.php
    • index.php
    • page.php
    • footer.php
    • gulpfile.js
    • package.json
    • yarn.lock

Isn't there a best practice on this? I can't find any professional page telling about this, and those that do exist, says different things.. There must be some type of guideline, even though everyone is different.

noReck
  • 113
  • 1
  • 4
  • 9
  • 2
    That's it: there isn't one and definitive only way to do things right and every other way is wrong. For that reason, this question is pretty off-topic in a site like this. – Álvaro González Jan 16 '17 at 12:36

1 Answers1

4

There is one result of the research effort scanning every package listed on https://packagist.org detailing which directories are being used by the vast majority of packages, i.e. what most people unconsciously agreed upon without coordination:

https://github.com/php-pds/skeleton

The short summary for directories:

If a package has a root-level directory for ...     
                            ... then it MUST be named:
command-line executables    bin/
configuration files         config/
documentation files         docs/
web server files            public/
other resource files        resources/
PHP source code             src/
test code                   tests/
Sven
  • 69,403
  • 10
  • 107
  • 109