Overview
Postlight’s Headless WordPress + React Starter Kit is an automated toolset that allows users to create a WordPress backend with a React frontend. It utilizes the WP REST API and GraphQL to serve data from the WordPress backend. The kit also includes a sample server-side rendered React frontend using Next.js powered by the WP REST API. It provides an automated installer, necessary plugins, and Docker containers for easy installation and deployment.
Features
- Automated installer for a core WordPress installation with a stable REST API.
- Newer GraphQL API for WordPress exposed through a plugin.
- Required plugins for custom post types and custom fields.
- Plugins to expose custom fields and WordPress menus in the WP REST API.
- JWT authentication plugins for secure user sign-in.
- Starter WordPress theme code and settings optimized for headless setup.
- Mechanism for importing data from existing WordPress installations using WP Migrate DB Pro.
- Sample frontend React app powered by GraphQL.
- Sample server-side rendered React app using Next.js and WP REST API.
- Docker containers and scripts for easy local development and deployment.
Installation
- Make sure Docker is installed.
- Build and start the four default containers: db-headless, wp-headless, frontend, and frontend-graphql.
- Wait for the containers to build for the first time. Subsequent startups should be faster.
- Use Docker tools like Kitematic or VSCode Docker plugin to monitor logs and manage containers.
- Optional: run the frontend locally while WordPress still runs on Docker.
- Access the React frontends and WordPress admin in your browser:
- Frontend powered by WP REST API (server-side rendered using Next.js): http://localhost:3000
- Frontend powered by GraphQL: http://localhost:3001
Summary
Postlight’s Headless WordPress + React Starter Kit is a convenient toolset for creating a headless WordPress installation with a React frontend. It offers an automated installer, necessary plugins, and Docker containers for easy setup and deployment. With support for WP REST API and GraphQL, users can build powerful and customizable applications. The kit also includes sample React apps to get started quickly. With its comprehensive feature set and user-friendly installation process, this starter kit is a valuable resource for developers looking to leverage the combination of WordPress and React.