codevelopers/fullstack

WordPress stack developed with symfony packages and integrated with Composer

v1.2.0 2022-03-22 00:31 UTC

This package is auto-updated.

Last update: 2022-07-22 01:12:27 UTC


README

Wordpress stack developed with Symfony packages and integrated with Composer.

Description

Fullstack is a Wordpress stack with a greater security and a better structure folder. The Wordpress core files are located in a subfolder, called public/wp. The old and well-known wp-content folder is replaced by public/content. On the other hand, Composer is used to install PHP dependencies, Wordpress themes and plugins. The configuration files are located outside the public folder for security reasons and contains the environment information like database credentials, proxy server settings, etc.

Requirements

  • php ^7.2
  • Composer

Installation with Github

Download the project from github or using the git clone command, and then run the composer install command inside the project root (location of the composer.json file).

Installation with Composer

Install Composer on your computer and once installed run in the cli composer create-project codevelopers/fullstack. If you want to install the project in a different folder, specify the name of the destination folder composer create-project codevelopers/fullstack dest.

Framework structure

fullstack/                   # → Root folder
├── config/                  # → Sensitive information here
│   ├── ComposerSetup.php    # → Composer script
│   ├── env.dev.php          # → Development or testing environment configuration file
│   ├── env.dist.php         # → Production environment configuration file
│   ├── env.local.php        # → Local environment configuration file
│   ├── env.php              # → Environment configuration file
│   └── salts.php            # → Wordpress Authentication unique keys and salts
├── console/                 # → Useful and powerful console commands
│   ├── DatabaseCreate.php   # → database:create console command
│   ├── DatabaseExport.php   # → database:export console command
│   ├── DatabaseImport.php   # → database:import console command
│   ├── HellowWorld.php      # → hello-world console command
│   └── ThemeUpdate.php      # → theme:update console command
├── database/                # → Database backup files
├── public/                  # → Public folder
│   ├── content              # → wp-content WordPress folder
│   ├── wp                   # → WordPress core files
│   ├── index.php            # → WordPress front controller
│   └── wp-config.php        # → WordPress configuration file
├── .gitignore               # → Changelog file
├── CHANGELOG.md             # → Changelog file
├── cli                      # → Run console commands in the CLI
├── composer.json            # → Composer file
├── LICENSE                  # → License file
└── README.md                # → This file

Install plugins

Search Wordpress plugins in the repository WordPress Packagist and then run (in the cli) into the project root composer require wpackagist-plugin/plugin-name to install the plugin wich you choosed. You can also install the plugins from the WordPress dashboard.

Install themes

Find Wordpress themes in the repository WordPress Packagist and then run (in the same location as the composer.json, ie project root) composer require wpackagist-theme/theme-name to install themes. You can also install themes from the dashboard.

Install PHP dependencies

Search PHP packages in Packagist and then run (in the project root) composer require vendor/package-name to install PHP dependencies.

WordPress configuration file

You have three configuration files:

  • env.dev.php for development and testing environment.
  • env.local.php for local development environment.
  • env.dist.php for production environment.

To set up the correct environment, you must set the constant ENV to local, dev or dist in the env.php file, as appropriate. Alternatively, you can set the environment variables in the webserver, since Fullstack get first the values from the $_ENV array super global, and if not exists, use the env.*.php file to get the settings. Additionally, you must set the Wordpress Authentication unique keys and salts in the config/salts.php file.

Console commands

Fullstack comes with a command line console (cli), with the following commands:

  • php cli database:create to create the database in mysql server.
  • php cli database:export to dump the database structure and data in a self contained sql file.
  • php cli database:import to import the database structure and data in the last generated sql file.
  • php cli theme:update to change themes metadata in the style.css theme stylesheet.
  • php cli plugin:install to install WordPress plugins using composer.
  • php cli plugin:uninstall to uninstall WordPress plugins using composer.
  • php cli plugin:update to update WordPress plugins using composer.

Remember that the cli command must be used only in the local or development environment, as it uses dev packages installed with composer.

Deploy to production

The deploy to production server process don't require upload the vendor folder, as Fullstack only uses php dependencies installed with Composer in the local or development environment.

Help us to skip working in this project

"Buy Me A Coffee"