aderaaij / wp-headless

Headless WordPress installation based on Bedrock

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WP Headless - A 'headless' WordPress installation

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.

πŸ“ƒ Description

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.

🧳 Features

  • 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

πŸ“¦ Requirements

πŸ›  Installation

  1. Clone the repository (git clone git@github.com:aderaaij/wp-headless.git)
  2. Rename the .env.example in the project root to .env
  3. Fill in required credentials in the .env file (equal to your wp-config.php in a regular WP install):
    • Database variables
      • DB_NAME - Database name
      • DB_USER - Database user
      • DB_PASSWORD - Database password
      • DB_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
  4. Point the webserver root to the /path/to/site/web/ folder
  5. Access WordPress admin at https://example.com/wp/wp-admin/

πŸš€ Deploying

This install includes the Bedrock Capistrano deployment scripts to easily deploy your site.

⚠️ This requires remote 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 πŸ˜…

πŸ“¦ Requirements

  • SSH access
  • Ruby >= 1.9

Required Gems:

  • capistrano (> 3.1.0)
  • capistrano-composer

πŸ’ͺ Usage

  • 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.

Symlinks

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/

About

Headless WordPress installation based on Bedrock

License:MIT License


Languages

Language:PHP 55.5%Language:Ruby 36.3%Language:Shell 6.4%Language:CSS 1.8%