Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions archive/examples/next/tutorial/.env.local.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Your WordPress site URL
NEXT_PUBLIC_WORDPRESS_URL=http://localhost:8888

# Plugin secret found in WordPress Settings->Faust
# Pre-configured for the tutorial - no need to change this!
FAUST_SECRET_KEY=47485b27a3d36728659cd62feb79658b3d05712b41095c13eeb73fcba7d33ac7
23 changes: 23 additions & 0 deletions archive/examples/next/tutorial/.wp-env.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"phpVersion": "8.3",
"plugins": [
"https://github.com/wp-graphql/wp-graphql/releases/latest/download/wp-graphql.zip",
"https://downloads.wordpress.org/plugin/faustwp.latest-stable.zip"
],
"config": {
"WP_DEBUG": true,
"SCRIPT_DEBUG": false,
"GRAPHQL_DEBUG": true,
"WP_DEBUG_LOG": true,
"WP_DEBUG_DISPLAY": false,
"SAVEQUERIES": false
},
"mappings": {
"db": "./wp-env/db",
"wp-content/uploads": "./wp-env/uploads",
".htaccess": "./wp-env/setup/.htaccess"
},
"lifecycleScripts": {
"afterStart": "wp-env run cli -- wp rewrite structure '/blog/%postname%/' && wp-env run cli -- wp rewrite flush"
}
}
62 changes: 62 additions & 0 deletions archive/examples/next/tutorial/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Learn Faust.js

Next.js app to be used with the [Learn Faust tutorial](https://faustjs.org/docs/tutorial/learn-faust/).

## Quick Start

1. **Install dependencies**
```bash
npm install
```

2. **Start everything**
```bash
npm run dev
```

That's it! The first time you run `npm run dev`, it will automatically:
- Create your `.env.local` configuration file
- Start WordPress with Docker
- Import the pre-configured database
- Start the Next.js development server

## Access Points

- **Frontend**: [http://localhost:3000/](http://localhost:3000/)
- **WordPress Admin**: [http://localhost:8888/wp-admin/](http://localhost:8888/wp-admin/)
- Username: `admin`
- Password: `password`

## What's Pre-configured?

The tutorial environment comes with:
- ✅ WPGraphQL plugin (active)
- ✅ FaustWP plugin (active)
- ✅ GraphQL introspection enabled
- ✅ Permalink structure: `/blog/%postname%/`
- ✅ Faust secret key configured
- ✅ Demo content ("Hello world!" post, "Sample Page")

## Available Commands

| Command | Description |
| --------------- | -------------------------------------------------------------- |
| `dev` | Start everything (WordPress + Next.js) |
| `dev:next` | Run Next.js development server only |
| `build` | Build the Next.js application for production |
| `wp:start` | Start the WordPress environment |
| `wp:stop` | Stop the WordPress environment |
| `wp:destroy` | Completely remove the WordPress environment |
| `wp:db:export` | Export the WordPress database |
| `wp:db:import` | Import the WordPress database |

## Prerequisites

- Node.js (v18+ recommended)
- [Docker](https://www.docker.com/) (required for WordPress with wp-env)

Make sure Docker is running before starting (`docker ps`)

## Learn More

For detailed step-by-step instructions on using Faust.js features, visit the [Learn Faust tutorial](https://faustjs.org/docs/tutorial/learn-faust/).
Loading
Loading