Skip to content

ragudesign/kb-nextjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ea9a31d · Jun 23, 2022

History

10 Commits
Jun 16, 2022
Jun 23, 2022
Jun 17, 2022
Jun 16, 2022
Jun 23, 2022
Jun 16, 2022
Jun 16, 2022
Feb 5, 2022
Jun 17, 2022
Feb 5, 2022
Feb 5, 2022
Feb 6, 2022
Jun 16, 2022
Feb 5, 2022
Feb 5, 2022
Jun 14, 2022
Feb 5, 2022

Repository files navigation


Logo

WordPress WPGraphQL NextJS App

This Next.js app connects to a WordPress WPGraphQL endpoint

Deploy with Vercel

Report Bug · Request Feature · WordPress Plugin



👋 About The Project

I started this project to learn more about Next.js and how i can use WordPress headless by exposing the data via WPGraphQL plugin. I created a small app which gets the posts from a custom post type and a search that uses a local json file so it's super quick which is generated on build.

image

🚀 Getting Started

Prerequisites

Setup a WordPress installation and add the following plugins:

  • Install Knowledge Base WP Plugin

    https://github.com/ragudesign/kb-wp
  • Install WPGraphQL Plugin

    https://www.wpgraphql.com/

Installation

  1. Clone the repo
yarn create next-app -e https://github.com/ragudesign/kb-nextjs
# or
npx create-next-app -e https://github.com/ragudesign/kb-nextjs
  1. Add a .env file to the root with the following:
WORDPRESS_GRAPHQL_ENDPOINT=http://wordpressite.com/graphql

Development

To start the project locally, run:

yarn dev
# or
npm run dev

🐸 License

Distributed under the MIT License. See LICENSE for more information.