Custom WordPress website for Quark Expeditions.
Make sure you have PHP 8.2, Docker, NodeJS 18 and Composer 2 or greater installed. You should preferably name your project directory as quarkexpeditions
.
- Clone this repository
- Get the
.env
file from one of your colleague and add that to the project. - 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) by running
npm run local-environment:start
, it will create all the required docker images. - Connect to MySQL: Host:
127.0.0.1
User:root
Password:root
Port:3306
- Create a database
quark
and import the database into it:echo "CREATE DATABASE quark;" | mysql -uroot -proot -h 0.0.0.0
- Get the database from one of your team-mates and import it.
- 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 local.quarkexpeditions.com
to your hosts file - Visit https://local.quarkexpeditions.com in your browser.
- Create a user for yourself if you don't already have one:
composer wp user create bob [email protected] --role=travelopia_super_user --user_pass=password
. If you already have a user, set yourself as a super admin:composer wp user set-role bob travelopia_super_user
- To access WP Admin, visit https://local.quarkexpeditions.com/wp-admin/
- To access MailHog, visit http://0.0.0.0:8025
- To access Solr, visit http://localhost:8983/sites/self/environments/lando/index/admin/
To start your local Docker environment, run: npm run local-environment:start
To re-start your local Docker environment that will remove previous docker files and re-created them,
run: npm run local-environment:restart
To stop your local Docker environment, run: npm run local-environment:stop
This project uses WordPress' Coding Standards: https://make.wordpress.org/core/handbook/best-practices/coding-standards/ . When you push changes to GitHub, they are checked against these coding stanards.
You can test this locally by running npm run lint
When you push changes to GitHub, it runs an automated suite of tests. To set this up locally, follow these steps:
- Create the tests database
echo "CREATE DATABASE \`quark-tests\`;" | mysql -uroot -proot -h 0.0.0.0
- Run
npm run test:php
to run the tests
- Run
npm run lint-test
before committing code to check if all automated tests and linters pass.