Skip to content

reandimo/wordpress-vue-boilerplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

WordPress + Vue.js Headless Boilerplate

License: MIT WordPress Nuxt Docker

Modern boilerplate for headless projects with WordPress Bedrock (backend) and Nuxt 4 (frontend). Includes complete Docker configuration, GraphQL, WooCommerce, and sitemap proxy for SEO.

πŸš€ Features

Backend (WordPress Bedrock)

  • βœ… WordPress Bedrock - Modern structure with Composer
  • βœ… Docker Compose - NGINX, PHP 8.2, MariaDB, Redis, MailHog
  • βœ… WPGraphQL - Complete GraphQL API
  • βœ… WooCommerce + WPGraphQL WooCommerce - Headless e-commerce
  • βœ… Yoast SEO - SEO and sitemap generation
  • βœ… Redis Object Cache - Object caching for better performance

Frontend (Nuxt 4)

  • βœ… Nuxt 4 - Vue.js framework with SSR
  • βœ… Pinia - State management
  • βœ… Apollo Client - GraphQL client
  • βœ… Bootstrap 5 + SCSS - Styles and components
  • βœ… Sitemap Proxy - Sitemap URLs rewritten to frontend domain

πŸ“ Project Structure

wordpress-vue-boilerplate/
β”œβ”€β”€ backend/              # WordPress Bedrock + Docker
β”‚   β”œβ”€β”€ config/          # Bedrock configuration
β”‚   β”œβ”€β”€ docker/          # Dockerfiles and configs
β”‚   β”œβ”€β”€ web/             # Document root
β”‚   β”œβ”€β”€ composer.json    # PHP dependencies
β”‚   └── docker-compose.yml
β”‚
└── frontend/            # Nuxt 4 Application
    β”œβ”€β”€ pages/           # App pages
    β”œβ”€β”€ assets/          # SCSS, images
    β”œβ”€β”€ server/          # API routes (sitemap proxy)
    β”œβ”€β”€ nuxt.config.ts   # Nuxt configuration
    └── package.json

πŸ› οΈ Prerequisites

⚑ Quick Start

1. Clone the Repository

git clone https://github.com/reandimo/wordpress-vue-boilerplate.git
cd wordpress-vue-boilerplate

2. Setup and Start the Backend

cd backend

# Copy environment variables
cp .env.example .env

# Edit .env and generate new salts at: https://roots.io/salts.html

# Install WordPress dependencies
docker compose run --rm php composer install

# Start Docker services
docker compose up -d

Access http://localhost:8080 and complete the WordPress installation.

Activate plugins from WP Admin:

  • WPGraphQL
  • WPGraphQL WooCommerce
  • Yoast SEO
  • WooCommerce
  • Redis Object Cache

3. Setup and Start the Frontend

cd ../frontend

# Install dependencies
npm install

# Copy environment variables (already configured for localhost:8080)
cp .env.example .env

# Start development server
npm run dev

Access http://localhost:3000 to see your application.

πŸ“š Detailed Documentation

πŸ”— Available Services

Service Port URL
Frontend (Nuxt) 3000 http://localhost:3000
Backend (WordPress) 8080 http://localhost:8080
WP Admin 8080 http://localhost:8080/wp/wp-admin
GraphQL Endpoint 8080 http://localhost:8080/graphql
MailHog (Email UI) 8025 http://localhost:8025
MariaDB 3306 localhost:3306
Redis 6379 localhost:6379

πŸ§ͺ GraphQL

The GraphQL endpoint is available at http://localhost:8080/graphql

Example Query

query GetPosts {
  posts(first: 10) {
    nodes {
      id
      title
      excerpt
      date
      author {
        node {
          name
        }
      }
    }
  }
}

WooCommerce Query

query GetProducts {
  products(first: 10) {
    nodes {
      id
      name
      price
      image {
        sourceUrl
      }
    }
  }
}

🚒 Production

Backend

  1. Change WP_ENV to production in .env
  2. Use secure passwords
  3. Configure HTTPS with SSL certificates
  4. Consider external Redis for better scalability
  5. Configure automatic backups

Frontend

cd frontend
npm run build

Deploy the .output folder to your hosting service (Vercel, Netlify, etc.)

🀝 Contributing

Contributions are welcome! Please:

  1. Fork the project
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“ License

This project is licensed under the MIT License. See the LICENSE file for details.

πŸ™ Acknowledgments

πŸ’¬ Support

If you encounter any issues or have questions:


Made with ❀️ for the community

About

Wordpress + Vue 3 + Nuxt 4 + Vite Stack for Development

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors