/craft-boilerplate

Our standard project template for new Craft CMS websites

Primary LanguagePHPMIT LicenseMIT

Craft CMS Boilerplate

Start your next project faster with some sensible defaults. This boilerplate is our standard for creating new Craft CMS projects.

Requirements

Whats Included

  • Exploded directory structure
  • PHPDotEnv
  • Laravel Elixir
  • Heroku configuration
  • Docker Environment

TL;DR

Install this as your starting point with the following command:

composer create-project venveo/craft-boilerplate --ignore-platform-reqs new-project-name

Note: When using composer to install dependencies, you may run into the following error: "Your requirements could not be resolved to an installable set of packages." Run composer install --ignore-platform-reqs to install regardless of your platforms PHP version.

Structure

Out of the box, this project comes prepared with an expanded folder structure, which simply means not the craft/{subfolders} and public/index.php.

Instead the structure looks like this:

  • app
  • config
  • plugins
  • public
  • resources
  • storage

Note: the templates directory is located under resources.

PHPDotEnv Support

While we love how easy [Craft can support multiple environments](TODO link), we still find ourselves reaching into the project to composer require vlucas/phpdotenv (honestly, we have that committed to memory...). So we thought it best to include this in our setup with the bare minimum configuration options.

The following environment variables are set:

  • APP_ENV=local

  • APP_URL=http://localhost

  • APP_NAME=Application Name

  • APP_CPTRIGGER=admin

  • APP_KEY=64charstring

  • DB_HOST=localhost

  • DB_NAME=dev_projectname

  • DB_USER=homestead

  • DB_PASSWORD=secret

  • DB_PREFIX=craft

Note: The DB_* environment variables are only required when developing locally. The APP_* variables should be set on all environments.

Laravel Elixir/Gulp

Part of our workflow includes setting up a gulpfile.js so this project has a simple Laravel Elixir configuration ready to rock.

Note: That also means that we need a smart way to use Laravel Elixir in Craft templates. So we also composer install our Craft Elixir plugin to speed things up.

Heroku Ready!

Heroku is our platform of choice, so the project ships with a Procfile that suits most projects.

Note: We understand that not all projects may choose Heroku over something like Digital Ocean and ServerPilot (we heart that option as well) so you can simply remove or ignore those two files.

Installation and Setup

The most convenient way to install is using our Craft CMS Installer (WIP) which will allow you to install Craft from the command line using our boilerplate or a plain Craft installation.

Craft Installer

Open terminal and enter the following command:

craft new my-cool-website

Magic... Now go build something awesome!

Note: Detailed documentation on the Craft Installer can be found here. Which is still a work in progress, for now.

Manual Installation

If you prefer not to use the command line installer but wish to use this boilerplate, follow these simple instructions:

  1. Download the zip of this project from the master branch
  2. Rename/move the directory to match your project name (e.g my-cool-website) and location
  3. Download the latest version of Craft CMS using the install.sh shell script
  4. Copy .env.example to .env and update to meet your system configuration
  5. Optional: If you plan to use Elixir, download our Craft Elixir plugin

Credits

About Venveo

Venveo is a Digital Marketing Agency for Building Materials Companies in Blacksburg, VA. Learn more about us on our website.

License

The MIT License (MIT). Please see License File for more information.