A roots/Bedrock based WordPress installation to easily spin-up and deploy a headless WordPress installation to use as Headless CMS for your JAMStack site.
WP Headless is a barebones, yet versatile installation of WordPress to use as a headless CMS for all your JAMStack needs. It includes WPGraphQL for exposing a GraphQL API and includes a headless theme which redirects users to the admin and the WP Vercel Deploy Hooks plugin to dynamically deploy your Vercel project from your WordPress site.
-
The usually cool stuff brought by roots/Bedrock like:
- Easy dependency management of themes, plugin and the WordPress core through Composer
- Better WordPress folder structure
- Easy WordPress configuration for different environments with
.env
files
-
WPGraphQL - Exposes a GraphQL endpoint as a data source for your JAMstack site
-
WP Headless Theme - A 'headless' theme which disables the front-end and redirects users to the login / admin area
-
WP Vercel Deply Hooks - Plugin to deploy your Vercel project dynamically
-
Easy deploy with roots/bedrock-capistrano
- PHP >= 7.1
- Composer
- Clone the repository (
git clone git@github.com:aderaaij/wp-headless.git
) - Rename the
.env.example
in the project root to.env
- Fill in required credentials in the
.env
file (equal to yourwp-config.php
in a regular WP install):- Database variables
DB_NAME
- Database nameDB_USER
- Database userDB_PASSWORD
- Database passwordDB_HOST
- Database host Optionally, you can define DATABASE_URL for using a DSN instead of using the variables above (e.g. mysql://user:password@127.0.0.1:3306/db_name)
WP_ENV
- Set to environment (development, staging, production)WP_HOME
- Full URL to WordPress home (https://example.com)WP_SITEURL
- Full URL to WordPress including subdirectory (https://example.com/wp)AUTH_KEY
, SECURE_AUTH_KEY, LOGGED_IN_KEY, NONCE_KEY, AUTH_SALT, SECURE_AUTH_SALT, LOGGED_IN_SALT, NONCE_SALT
- Database variables
- Point the webserver root to the
/path/to/site/web/
folder - Access WordPress admin at
https://example.com/wp/wp-admin/
This install includes the Bedrock Capistrano deployment scripts to easily deploy your site.
SSH
access to your server. If you don't have SSH
access, you might be able to try Capistrano with LFTP, and let me know how it goes π
- SSH access
- Ruby >= 1.9
Required Gems:
- capistrano (> 3.1.0)
- capistrano-composer
- Deploy:
cap production deploy
- Rollback:
cap production deploy:rollback
Composer support is built-in so when you run a deploy, composer install is automatically run.
Symlink shared upload folders:
ln -s /home/91934.cloudwaysapps.com/gfqrxtbxbj/public_html/wp-headless/shared/web/app/uploads /home/master/applications/gfqrxtbxbj/public_html/wp-headless/current/web/app/