If you want to use this structure for Acme, Inc.:
- Clone this repository
- Find and replace all occurrences of
fooclient
toacme
- Find and replace all occurrences of
Foo Client
toAcme, Inc.
- Find and replace all occurrences of
foo
toacme
- Find and replace all occurrences of
Foo
toAcme
Create a local certificate
cd .docker/ssl
openssl req \
-newkey rsa:2048 \
-x509 \
-nodes \
-keyout fooclient.key \
-new \
-out fooclient.crt \
-subj /CN=fooclient.test \
-reqexts SAN \
-extensions SAN \
-config <(cat /System/Library/OpenSSL/openssl.cnf \
<(printf '[SAN]\nsubjectAltName=DNS:fooclient.test')) \
-sha256 \
-days 3650
Make sure you have PHP 8.0 or higher, Docker, NodeJS 16 and Composer 2 or higher installed.
- Copy the
.env.sample
file and rename it to.env
and add / update your project details - Run
npm run start
to install NodeJS and Composer packages. This also automatically installs the PHP coding standards. You will be prompted for your password to trust the SSL certificate - Start your local environment (see below)
- Create a local database
echo "CREATE DATABASE fooclient;" | mysql -uroot -proot -h 0.0.0.0
- If you don't use a Mac, go to
.docker/ssl
and trust the self-signed certificate in there. If you use a Mac, this should be done automatically - Add
127.0.0.1 fooclient.test
to your hosts file - Visit https://fooclient.test in your browser
- To access WP Admin, visit https://fooclient.test/wp/wp-admin/
- To access MailHog, visit http://0.0.0.0:8025
To start your local Docker environment, run: npm run local-environment:start
To stop your local Docker environment, run: npm run local-environment:stop
- Create a database
echo "CREATE DATABASE \`fooclient-tests\`;" | mysql -uroot -proot -h 0.0.0.0
- Run
npm run test:php
to run the tests