A marketing site for Revolt Media Limited.
Forked from our own starter project revoltmedia-starter
- Docker
- Lando
- Suggestion: Trust the Lando CA to avoid HTTPS errors.
The init-backend
and generate-env
tooling will generate the bedrock project under /backend
and generate a .env
file based on the .env.example
with randomized salts.
- Run
lando init-backend
- Run
lando generate-env
- Run
lando start
- Access your local instance at the URL provided after the start command finishes.
lando init-frontend
- Answer the prompts
If you want to clean up the starter specific files once your project is set up,
from the project root run: rm -rf starter-scripts .lando-base.yml
Note that this will remove the init-backend
tooling.
generate-env
Generates a.env
file based on the.env.example
init-backend
Generates a Bedrock project under the/backend
directoryinit-frontend
Generates a NextJS project under the/frontend
directory
wp-admin
is under/wp/
athttps://revoltmedia.lndo.site/wp/wp-admin
composer ...
commands can be run vialando composer ...
- Setup a
.lando.yml
config with some settings defined explicitly including some configs and env vars that are mostly personal taste. - Initialization of Bedrock via
lando composer create-project roots/bedrock
- Wrote this README with steps and tips.
- Create/Add blank theme placeholder for NextJS site
- Add basic plugins neeeded to connect NextJS
- WP-GraphQL
- Add connection config to NextJS to get data
- Create/Add React blocks plugin based on: https://medium.com/geekculture/headless-wordpress-gutenberg-next-js-part-1-3-creating-a-block-with-react-e8d69e8460d4
- Create/Add "S3 Uploads for Bedrock" plugin
Many S3 compatible plugins exist for WP. While it has drawbacks, it's a good idea to do something like this to separate the file uploads from the core code. The S3-Uploads plugin is great for use with Bedrock / composer.
- Their install steps can be used modifying them to
lando composer ...
orlando wp ...
- Their
wp-config.php
lines should be placed inbackend/config/applicaton.php
-
Change
define
toConfig::define
-
Replace the values with environment variables
env('S3_UPLOADS_BUCKET')
/** * S3 Uploads Plugin settings */ Config::define( 'S3_UPLOADS_BUCKET', env('S3_UPLOADS_BUCKET') ); // The s3 bucket region (excluding the rest of the URL) Config::define( 'S3_UPLOADS_REGION', env('S3_UPLOADS_REGION') ); // You can set key and secret directly: Config::define( 'S3_UPLOADS_KEY', env('S3_UPLOADS_KEY') ); Config::define( 'S3_UPLOADS_SECRET', env('S3_UPLOADS_SECRET') ); // Define the base bucket URL (without trailing slash) Config::define( 'S3_UPLOADS_BUCKET_URL', env('S3_UPLOADS_BUCKET_URL') );
-
Don't forget to add those variables to the
.env
file# S3 Uploads Bucket Config S3_UPLOADS_KEY='xxxx' S3_UPLOADS_SECRET='xxxx' S3_UPLOADS_BUCKET='xxxx' S3_UPLOADS_REGION='us-west-2' # Define the base bucket URL (without trailing slash) S3_UPLOADS_BUCKET_URL='https://s3.us-west-2.amazonaws.com/xxxx'
-
This starter project was created by bear for Revolt Media. It is a tool to spin up relevant projects faster. Please don't expect regular updates, and feel free to use it as a starting point.