Start your next project faster with some sensible defaults. This boilerplate is our standard for creating new Craft CMS projects.
- Exploded directory structure
- PHPDotEnv
- Laravel Elixir
- Heroku configuration
- Docker Environment
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." Runcomposer install --ignore-platform-reqs
to install regardless of your platforms PHP version.
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 underresources
.
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. TheAPP_*
variables should be set on all environments.
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 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.
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.
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.
If you prefer not to use the command line installer but wish to use this boilerplate, follow these simple instructions:
- Download the zip of this project from the master branch
- Rename/move the directory to match your project name (e.g
my-cool-website
) and location - Download the latest version of Craft CMS using the
install.sh
shell script - Copy
.env.example
to.env
and update to meet your system configuration - Optional: If you plan to use Elixir, download our Craft Elixir plugin
Venveo is a Digital Marketing Agency for Building Materials Companies in Blacksburg, VA. Learn more about us on our website.
The MIT License (MIT). Please see License File for more information.