Configuration & start

Config .env

Go to the project root and make a copy of .env.example

cp .env.example

Edit the .env file

  1. update database settings
  2. Generate new keys from https://roots.io/salts.html

Edit the composer.json file

Add the following snippet to composer.json

The following snippet adds Advanced Custom Fields as an additional source for composer:

    ,{ 
      "type": "package", 
      "package": {  
        "name": "advanced-custom-fields/advanced-custom-fields-pro",
        "version": "5.6.1", 
        "type": "wordpress-plugin",
        "dist": { 
          "type": "zip", 
          "url": "https://connect.advancedcustomfields.com/index.php?p=pro&a=download"
        },
        "require": {
          "philippbaschke/acf-pro-installer": "^1.0", 
          "composer/installers": "^1.0"
        } 
      } 
    }

Add it just after:

  "repositories": [
    {
      "type": "composer",
      "url": "https://wpackagist.org"
    }

Install wordpress and spacecraft

Run installation-script ./install.sh

install.sh

The install.sh file is a simple bash file that runs the following commands:

composer install in the wordpress folder yarn in the custom theme folder

Start wordpress

This requires that you have WP CLI running on your machine.

You will start wordpress from the web folder and it will run on the following local address: http://127.0.0.1:8080 Open up a new terminal window and run:

wp server --docroot=web --host=127.0.0.1

You might have to configure your php bash settings - here is a helper.

Login to wordpress

Login to wordpress and:

  1. Enable Timber plugin
  2. Enable My Timber Starter Theme

Start spacecraft as proxy for wordpress

Go to the spacecraft folder and edit config.json Change all occurrences of views to ../templates

Make sure that you are running wp server --docroot=web --host=127.0.0. in one terminal window and then start gulp with the proxy setting with:

gulp proxy