https://github.com/reandimo/wordpress-vite-boilerplate
Wordpress + Vite Stack for Development
https://github.com/reandimo/wordpress-vite-boilerplate
acf acf-blocks bedrock ftp ftp-sync woocommerce wordpress wordpress-bedrock
Last synced: 17 days ago
JSON representation
Wordpress + Vite Stack for Development
- Host: GitHub
- URL: https://github.com/reandimo/wordpress-vite-boilerplate
- Owner: reandimo
- Created: 2026-03-28T13:19:45.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2026-03-31T22:16:01.000Z (3 months ago)
- Last Synced: 2026-06-18T03:34:10.518Z (17 days ago)
- Topics: acf, acf-blocks, bedrock, ftp, ftp-sync, woocommerce, wordpress, wordpress-bedrock
- Language: JavaScript
- Homepage: https://reandimo.github.io/wordpress-vite-boilerplate/
- Size: 169 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
WordPress Vite Boilerplate
Bedrock + Docker + Vite + Block Theme (FSE)
Interactive setup, ACF Blocks v3, TypeScript, SCSS, and remote sync via SSH/FTP.
Quick Start ยท
Dev Modes ยท
Setup Guide ยท
Theme Dev ยท
ACF Blocks
---
## The Problem
```
๐ฉ Classic WordPress โจ With This Boilerplate
โโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโ
Edit via FTP or cPanel editor Edit locally, auto-sync to server
No HMR, manual browser refresh Vite HMR โ instant CSS/JS updates
Vanilla CSS / jQuery spaghetti TypeScript + SCSS + BEM
No version control structure Bedrock + Docker + Composer
"Works on my machine" Same stack everywhere
Create blocks with copy-paste PHP ACF Blocks v3 with field groups
```
Think **`shopify theme dev`**, but for WordPress.
---
## ๐ฆ Requirements
- [Node.js](http://nodejs.org/) >= 18
- [Git](https://git-scm.com/) (includes Git Bash on Windows)
Everything else is checked automatically by the setup script.
---
## ๐ Quick Start
```bash
# Clone
git clone https://github.com/reandimo/wordpress-vite-boilerplate.git my-project
cd my-project
# Run the interactive setup
node setup.js
# Follow the on-screen instructions โจ
```
The setup script detects your OS, asks for your preferences, checks dependencies, and configures everything. See the [Setup Guide](docs/setup-guide.md) for details.
---
## ๐ Dev Modes
The setup wizard lets you choose how you want to develop:
```
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ โ
โ ๐ณ docker Full local stack โ
โ PHP, Nginx, MariaDB, MailHog, phpMyAdmin โ
โ โ
โ ๐ remote-sync Edit locally, sync to remote โ
โ SSH (rsync) or FTP (lftp) โ
โ โ
โ โก both Docker local + remote sync โ
โ Best of both worlds โ
โ โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
```
---
## ๐ Sync Protocols
```
โโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโ
โ SSH (rsync) โ FTP (lftp) โ
โ โโโโโโโโโโ โ โโโโโโโโโ โ
โ โ Delta transfer โ โ Universal access โ
โ โ Encrypted โ โ No server setup โ
โ โ Passwordless โ โ Works everywhere โ
โ โ ~200 bytes/edit โ โ Full file upload โ
โ โ โ
โ โ
Recommended โ โ Fallback option โ
โโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโ
```
Powered by [**wp-dev-sync**](https://github.com/reandimo/wp-dev-sync) CLI:
```bash
npm run sync # Watch + auto-sync
npm run sync:push # One-time upload
npm run sync:pull # One-time download
npm run tunnel # Public URL for previews
npm run setup:remote # Preflight check
```
---
## ๐ Documentation
| | Page | What you'll learn |
|:--|:-----|:------------------|
| ๐ง | [Setup Guide](docs/setup-guide.md) | Interactive setup walkthrough and config options |
| ๐ณ | [Docker Development](docs/docker-development.md) | Local stack, services, and daily workflow |
| ๐ | [Remote Sync](docs/remote-sync.md) | SSH/FTP sync, watch mode, tunnels |
| ๐จ | [Theme Development](docs/theme-development.md) | Vite, HMR, SCSS, TypeScript, asset pipeline |
| ๐งฑ | [ACF Blocks](docs/acf-blocks.md) | Creating custom blocks with ACF v3 |
| ๐ | [Deployment](docs/deployment.md) | Production builds and server deployment |
| ๐ช | [Windows Setup](docs/windows-setup.md) | Windows-specific config and troubleshooting |
---
## ๐๏ธ Project Structure
```
project/
โโโ setup.js # Interactive setup (run once)
โโโ docker-compose.yml # Docker services
โโโ docker/ # PHP 8.2-fpm + Nginx configs
โโโ app/ # Bedrock root
โ โโโ composer.json # โโ WP core + plugins (wpackagist)
โ โโโ config/ # โโ WordPress config (environments)
โ โโโ web/app/themes// # โโ Your Block Theme โฌ
โโโ package.json # Root scripts (sync, tunnel, setup)
```
## ๐จ Theme Structure
```
app/web/app/themes//
โ
โโโ blocks/ # ACF Blocks v3
โ โโโ example-cta/ # โโ block.json + render.php
โ
โโโ includes/ # PHP classes (PSR-4)
โ โโโ ACF/ # โโ Field groups
โ โโโ Helpers/ViteHelper.php # โโ Vite asset loading
โ โโโ Theme/ThemeSetup.php # โโ Theme bootstrap
โ
โโโ parts/ # Template parts
โ โโโ header.html # โโ Site header
โ โโโ footer.html # โโ Site footer
โ
โโโ templates/ # FSE block templates
โ โโโ index.html # โโ Default
โ โโโ page.html # โโ Pages
โ โโโ single.html # โโ Posts
โ โโโ 404.html # โโ Not found
โ
โโโ resources/
โ โโโ fonts/ # Custom fonts โ copied to public/
โ โโโ scripts/frontend/main.ts # TS entry point
โ โโโ styles/
โ โโโ base/ # โโ Variables, media queries
โ โโโ components/ # โโ Reusable component styles
โ โโโ sections/ # โโ Block/section styles
โ โโโ frontend/main.scss # โโ SCSS entry point
โ
โโโ theme.json # Design tokens + block settings
โโโ vite.config.js # Vite 5 + HMR config
โโโ functions.php # PSR-4 autoloader + bootstrap
```
---
## ๐งฑ ACF Blocks v3
Create custom blocks with a simple workflow:
```bash
# 1. Create block files
blocks/my-block/block.json # Block definition
blocks/my-block/render.php # Block template
# 2. Add ACF fields
includes/ACF/MyBlock.php # Field group
# 3. Register
functions.php โ $acf_files[] # Add 'MyBlock'
ThemeSetup.php โ $blocks[] # Add 'my-block'
# 4. Style
resources/styles/sections/_my-block.scss
```
See the included `blocks/example-cta/` for a complete reference.
---
## โก Vite + HMR
```bash
# Inside theme directory
npm run dev # Start dev server (localhost:5173)
npm run build # Build once
npm run production # Optimized production build
```
- **Dev:** Vite dev server with HMR for instant CSS/JS updates
- **Build:** Assets compiled to `public/` with manifest.json
- **Fonts:** Automatically copied from `resources/fonts/` to `public/fonts/`
- **Docker:** `host.docker.internal` lets the PHP container reach Vite on your host
---
## ๐ณ Docker Services
```bash
docker compose up -d # Start everything
docker compose down # Stop everything
docker compose exec php sh # Shell into PHP container
docker compose exec php wp cache flush # WP-CLI
```
| Service | Port | Description |
|:--------|:-----|:------------|
| Nginx | `8080` | Web server |
| PHP-FPM | `9000` | PHP 8.2 |
| MariaDB | `3306` | Database |
| MailHog | `8025` | Email testing |
| phpMyAdmin | `8081` | Database GUI |
---
๐ Full Setup Guide
ย ยทย
๐ Report Bug
ย ยทย
๐ก Request Feature
Built by Renan Diaz ยท GPL-2.0-or-later