Skip to content

Commit b0425e3

Browse files
committed
use wp-env
1 parent d57d82c commit b0425e3

File tree

11 files changed

+10089
-35
lines changed

11 files changed

+10089
-35
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Your WordPress site URL
2+
NEXT_PUBLIC_WORDPRESS_URL=http://localhost:8888
3+
4+
# Plugin secret found in WordPress Settings->Faust
5+
# Pre-configured for the tutorial - no need to change this!
6+
FAUST_SECRET_KEY=47485b27a3d36728659cd62feb79658b3d05712b41095c13eeb73fcba7d33ac7
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"phpVersion": "8.3",
3+
"plugins": [
4+
"https://github.com/wp-graphql/wp-graphql/releases/latest/download/wp-graphql.zip",
5+
"https://downloads.wordpress.org/plugin/faustwp.latest-stable.zip"
6+
],
7+
"config": {
8+
"WP_DEBUG": true,
9+
"SCRIPT_DEBUG": false,
10+
"GRAPHQL_DEBUG": true,
11+
"WP_DEBUG_LOG": true,
12+
"WP_DEBUG_DISPLAY": false,
13+
"SAVEQUERIES": false
14+
},
15+
"mappings": {
16+
"db": "./wp-env/db",
17+
"wp-content/uploads": "./wp-env/uploads",
18+
".htaccess": "./wp-env/setup/.htaccess"
19+
},
20+
"lifecycleScripts": {
21+
"afterStart": "wp-env run cli -- wp rewrite structure '/blog/%postname%/' && wp-env run cli -- wp rewrite flush"
22+
}
23+
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Learn Faust.js
2+
3+
Next.js app to be used with the [Learn Faust tutorial](https://faustjs.org/docs/tutorial/learn-faust/).
4+
5+
## Quick Start
6+
7+
1. **Install dependencies**
8+
```bash
9+
npm install
10+
```
11+
12+
2. **Start everything**
13+
```bash
14+
npm run dev
15+
```
16+
17+
That's it! The first time you run `npm run dev`, it will automatically:
18+
- Create your `.env.local` configuration file
19+
- Start WordPress with Docker
20+
- Import the pre-configured database
21+
- Start the Next.js development server
22+
23+
## Access Points
24+
25+
- **Frontend**: [http://localhost:3000/](http://localhost:3000/)
26+
- **WordPress Admin**: [http://localhost:8888/wp-admin/](http://localhost:8888/wp-admin/)
27+
- Username: `admin`
28+
- Password: `password`
29+
30+
## What's Pre-configured?
31+
32+
The tutorial environment comes with:
33+
- ✅ WPGraphQL plugin (active)
34+
- ✅ FaustWP plugin (active)
35+
- ✅ GraphQL introspection enabled
36+
- ✅ Permalink structure: `/blog/%postname%/`
37+
- ✅ Faust secret key configured
38+
- ✅ Demo content ("Hello world!" post, "Sample Page")
39+
40+
## Available Commands
41+
42+
| Command | Description |
43+
| --------------- | -------------------------------------------------------------- |
44+
| `dev` | Start everything (WordPress + Next.js) |
45+
| `dev:next` | Run Next.js development server only |
46+
| `build` | Build the Next.js application for production |
47+
| `wp:start` | Start the WordPress environment |
48+
| `wp:stop` | Stop the WordPress environment |
49+
| `wp:destroy` | Completely remove the WordPress environment |
50+
| `wp:db:export` | Export the WordPress database |
51+
| `wp:db:import` | Import the WordPress database |
52+
53+
## Prerequisites
54+
55+
- Node.js (v18+ recommended)
56+
- [Docker](https://www.docker.com/) (required for WordPress with wp-env)
57+
58+
Make sure Docker is running before starting (`docker ps`)
59+
60+
## Learn More
61+
62+
For detailed step-by-step instructions on using Faust.js features, visit the [Learn Faust tutorial](https://faustjs.org/docs/tutorial/learn-faust/).

0 commit comments

Comments
 (0)