This is a Yeoman generator for kickstarting ProcessWire projects.
The generator:
- creates a project structure allowing you to easily manage the following:
- website source
- database exports
- living styleguide / design system
- downloads ProcessWire
- installs Fixate's ProcessWire MVC Boilerplate
- installs a SCSS Framework
- creates a number of files for smoother development and collaboration:
- .editorconfig
- .gitignore
- .gitattributes
- robots.txt
- installs Gulp and Webpack with an
extensive task list fully equipped for
- javascript and Sass compilation
- asset minification and optimisation
- asset revision / cache-busting
- timestamped local and production database dumps
- rsync deployments
- auto reload
- a tmuxinator config to easily get your project running with a single command
Yeoman is a Node package which can be installed via npm:
$ npm install -g yo
Unlike many Yeoman Generators, this generator doesn't live in Yeoman's registry, as it is quite specific to our needs.
Until we decide to add our generator to the Yeoman registry, this is how you can enjoy some of the magic:
# clone the generator
$ git clone https://github.com/fixate/generator-fixate-pw.git
# let Yeoman know about the generator
$ cd generator-fixate-pw
$ npm link
# install all the generator dependencies
$ npm install
Initiate the generator from the root of your project's folder:
$ cd your-project-folder
$ yo fixate-pw
Once Yeoman has done all the hard work, you have a few small tasks to run before you 're free to get going.
All task automation and asset compilation is handled via Gulp tasks and Webpack.
$ npm installOpen .env and configure your local database credentials (these are used by Docker
to initialise your database and expose a virtual host).
A docker-compose.yml containerises the application with the following:
- PHP server
- Apache server with virtual host (defined in
.envanddocker/apache/local.apache.conf) - MySQL server (credentials defined in
.env) - Mailhog server
To start the server:
$ docker-compose upWith the docker container runnning, you can now install ProcessWire
-
Visit
localhost/install.php -
When entering database credentials, use
mysqlfor the hostname. This is the hostname that the MySQL docker image exposes to the PHP container -
Create a dev copy of
src/config.phpfor local development:$ cp src/site/config{,-dev}.php -
Open
src/site/config-dev.phpand enable debug$debug -> true;
This project makes use of Storybook as a living styleguide . To get up and running:
$ cd styleguide && npm init -y && npx -p @storybook/cli sb init --type reactOnce installed, you can start a server for the styleguide that will automatically update on changes to styles with the following:
# from the styleguide directory
$ npm run storybookYou'll first need to start the docker containers:
# from project root
$ docker-compose upOnce the docker containers are running, you can watch for file changes and run
automated compilation tasks with Gulp and Webpack. browser-sync will reload at localhost:3000 by proxying localhost:8080 exposed by Docker.
# from project root
$ npm run devFor each template, visit your admin and set all templates to use mvc:
Setup -> [your template] -> Files -> Alternate Template Filename