Skip to content

Instantly share code, notes, and snippets.

@alandsilva26
Created October 30, 2020 05:32
Show Gist options
  • Select an option

  • Save alandsilva26/a956028f489ba86e30a631a9ae55616d to your computer and use it in GitHub Desktop.

Select an option

Save alandsilva26/a956028f489ba86e30a631a9ae55616d to your computer and use it in GitHub Desktop.
File and Folder Structure for php projects using composer.

PHP Project directory using Composer

project-directory/
├───.git/                   # Git configuration and source directory
├───assets/                 # Uncompiled raw CSS, JavaScript , images, etc.
│ ├───css/
│ ├───images/
│ ├───js/
│ └───sass/  
├───bin/                    # Command line scripts
├───config/                 # Application configuration
├───node_modules/           # Node.js modules for managing front-end
├───public/                 # Publicly acessible files at http/https
│ │ index.php
│ │ ...  
├───src/                    # PHP source code files
│ ├───Controller/
| ├───Service/              # Grouping by archetype
│ ├───Product/              # Grouping by archetype
│ │ Product.php             # Grouping by feature
│ │ ProductService.php      # Grouping by feature
│ │ ...
├───templates/              # Template files
├───var/                    # Temporary application files
│ ├───cache/                # Cache files
│ └───log/                  # Application specific log files
└───vendor/                 # 3rd party packages installed with composer
│ .gitignore                # Ignored files
│ composer.json             # Composer dependencies file
│ package.json              # NPM dependencies file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment