You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 27, 2024. It is now read-only.
It's easy to query a WordPress REST-API and map over some blog posts in JavaScript. That's where many examples on the Internet stop and you'd be hard pressed to find anything about supporting advanced features because **_headless WordPress is hard!_**
47
+
Querying a REST-API or GraphQL endpoint and looping over blog posts is where many _"how to build a headless WordPress website"_ tutorials stop. You'd be hard pressed to find anything about supporting advanced features and plugins because **_headless WordPress is hard._**
42
48
43
-
At WebDevStudios we believe that WordPress is so much more than a blog-- and our clients require support for things like: SEO, forms, post previews, search, comments, authentication, custom post types, custom fields, etc...
49
+
At WebDevStudios we believe that WordPress is so much more than a blog-- and our clients require support for things like: SEO, forms, previews, search, comments, authentication, custom post types, custom fields, etc...
44
50
45
-
With this starter, we've figured out "the hard stuff"and placed the sum of our knowledge into something the community (and our future projects) could use as a jumping off point.
51
+
With this starter, we've figured out the hard stuff"and placed the sum of our knowledge into something the community (and our future projects) could use as a jumping off point.
46
52
47
53
### How's this all work?
48
54
@@ -52,6 +58,37 @@ The frontend (Next.js) talks to the backend (WordPress) via GraphQL.
52
58
<imgsrc="https://dl.dropbox.com/s/9wsal7szatfwt6g/nextjs-wordpress-starter-frontend-backend-graphic.png?dl=0"alt="A graphic showing the relationship between environments">
53
59
</details>
54
60
61
+
### 3rd Party Services
62
+
63
+
This starter uses a few 3rd party services.
64
+
65
+
<details>
66
+
67
+
-[Algolia](https://www.algolia.com/)
68
+
-[Chromatic](https://www.chromatic.com/)
69
+
-[Vercel](https://vercel.com/)
70
+
-[WP Engine](https://wpengine.com)
71
+
72
+
#### Algolia
73
+
74
+
We use [WP Search with Algolia](https://wordpress.org/plugins/wp-search-with-algolia/) to push content indicies from WordPress to Algolia. You will need to set up a (free) account and place your API credentials in the frontend `.env` file _and_ in the WordPress plugin settings.
75
+
76
+
#### Chromatic
77
+
78
+
Chromatic automates gathering UI feedback, visual testing, and documentation, so developers can iterate faster with less manual work. You will need to update both [`package.json`](https://github.com/WebDevStudios/nextjs-wordpress-starter/blob/staging/package.json#L34) and [`chromatic.yml`](https://github.com/WebDevStudios/nextjs-wordpress-starter/blob/staging/.github/workflows/chromatic.yml) with your Chromatic API key in order to automate builds.
79
+
80
+
#### Vercel
81
+
82
+
Vercel is the company behind Next.js and offers a platform _[that was built for deploying](https://vercel.com/solutions/nextjs)_ Next.js apps.
83
+
84
+
Vercel has a generous free tier and offers support for both serverless functions (required if using incremental static regeneration) and [`next/image`](https://nextjs.org/docs/api-reference/next/image). Something neither Netlify nor Cloudflare support.
85
+
86
+
#### WP Engine
87
+
88
+
We're a partner with WP Engine and love their managed WordPress hosting options. That said, while hosting your headless WordPress install on WP Engine is recommended, it is not required.
89
+
90
+
</details>
91
+
55
92
---
56
93
57
94
## 🚀 Frontend Setup (Next.js)
@@ -88,7 +125,7 @@ yarn
88
125
89
126
**Step 4: Setup ENV Variables**
90
127
91
-
Copy the sample ENV file, then add your credentials:
128
+
ENV variables are like constants in `wp-config.php`. Copy the sample ENV file, then add your credentials:
92
129
93
130
```bash
94
131
cp .env.sample .env
@@ -146,9 +183,17 @@ Before you get started, make sure you have the following dependency installed on
0 commit comments