Skip to content

Turkeyseo/headless-wordpress

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Headless WordPress with Next.js

The ultimate headless WordPress solution - Transform any WordPress site into a blazing-fast, modern web application powered by Next.js 16 and React 19.

MIT License Next.js React TypeScript

🌐 Created by WPTR - Free & Open Source


✨ Features

🎯 Core Features

  • ⚑ Lightning Fast - Next.js 16 with React 19 and React Compiler
  • πŸ”Œ Easy Setup - Connect to any WordPress site in minutes
  • 🎨 Visual Customization - Theme colors, fonts, and layouts from admin panel
  • πŸ“± Fully Responsive - Mobile-first design that looks great everywhere
  • πŸ” SEO Optimized - Automatic meta tags, sitemaps, and hreflang support

πŸ› οΈ Admin Dashboard

  • Homepage Builder - Drag & drop sections (Hero, Posts Grid, CTA, etc.)
  • Menu Management - Primary & footer menus with submenu support
  • Theme Editor - Real-time color customization
  • Ads Management - Configure ad slots across your site
  • Pages Manager - Create local pages without WordPress
  • Language Settings - 80+ languages with customizable UI strings
  • Security - Password-protected admin panel

πŸ“Š Technical Highlights

  • GraphQL Integration - Efficient data fetching from WordPress
  • ISR Support - Incremental Static Regeneration for fresh content
  • Image Optimization - Next.js Image component with lazy loading
  • CSS Modules - Scoped, optimized styling
  • TypeScript - Full type safety

πŸš€ Quick Start

Prerequisites

  • Node.js 18+
  • A WordPress site with GraphQL plugin (WPGraphQL)

Installation

  1. Clone the repository
git clone https://github.com/Turkeyseo/headless-wordpress.git
cd headless-wordpress
  1. Install dependencies
npm install
  1. Start development server
npm run dev
  1. Open your browser Navigate to http://localhost:3000/install and follow the setup wizard.

πŸ“– Configuration

WordPress Setup

  1. Install WPGraphQL plugin on your WordPress site
  2. (Optional) Install Yoast SEO for enhanced SEO data
  3. Ensure your WordPress permalinks are set to "Post name"

Environment Variables (Optional)

Create a .env.local file:

# Optional: Override WordPress URL (otherwise set via admin panel)
WORDPRESS_URL=https://your-wordpress-site.com

πŸ—οΈ Project Structure

src/
β”œβ”€β”€ app/                    # Next.js App Router pages
β”‚   β”œβ”€β”€ manager/           # Admin dashboard
β”‚   β”œβ”€β”€ install/           # Setup wizard
β”‚   β”œβ”€β”€ category/          # Category pages
β”‚   └── [...slug]/         # Dynamic post/page routes
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ layout/            # Header, Footer
β”‚   β”œβ”€β”€ sections/          # Homepage sections
β”‚   β”œβ”€β”€ ui/                # Reusable UI components
β”‚   └── manager/           # Admin components
β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ wordpress.ts       # GraphQL queries
β”‚   β”œβ”€β”€ config.ts          # Site configuration
β”‚   β”œβ”€β”€ actions.ts         # Server actions
β”‚   └── utils.ts           # Helper functions
└── styles/                # Global styles

🎨 Customization

Theme Colors

Access the admin panel at /manager and navigate to Theme tab to customize:

  • Primary & Secondary colors
  • Background & Foreground
  • Accent colors
  • Border & Muted colors

Homepage Sections

Available section types:

  • Hero - Full-width banner with CTA
  • Posts Grid - Card-based post layout
  • Posts List - Compact list layout
  • Posts Carousel - Sliding post cards
  • Category Tabs - Tabbed post navigation
  • CTA - Call-to-action blocks
  • HTML Block - Custom HTML content

🌍 Multi-Language Support

The system supports 80+ languages including:

  • Major European languages (EN, DE, FR, ES, IT, PT, etc.)
  • Asian languages (ZH, JA, KO, HI, TH, VI, etc.)
  • Middle Eastern languages (AR, FA, HE, TR, etc.)
  • African languages (SW, AM, HA, etc.)
  • And many more...

Configure language and customize all UI strings from the Languages tab in admin panel.


πŸ“’ Ads Management

Built-in ad management with predefined slots:

  • Header Top
  • Homepage - Below Hero
  • Post Top / Middle / Bottom
  • Sidebar Top
  • Footer Top

Simply paste your ad code (Google AdSense, etc.) and toggle activation.


πŸš€ Deployment

Vercel (Recommended)

Deploy with Vercel

Netlify

Deploy to Netlify

Self-Hosted

npm run build
npm start

πŸ”’ Security

  • Admin panel is password-protected
  • Credentials stored with bcrypt hashing
  • No direct database access from frontend
  • WordPress remains hidden from visitors

πŸ”„ Auto-Update System

This project includes a built-in update system that checks for new versions from GitHub:

Features

  • Version Check - Automatically checks for new releases on startup
  • One-Click Update - Update directly from the admin panel
  • Configuration Preserved - Your site-config.json (settings, menus, theme) is preserved during updates
  • Release Notes - View what's new before updating

How to Update

  1. Open the admin panel at /manager
  2. Click on the Updates tab
  3. If a new version is available, click Install Update
  4. Restart the application after the update

Manual Update

If you prefer to update manually:

# Backup your configuration
cp site-config.json site-config.backup.json

# Pull latest changes
git fetch origin main
git reset --hard origin/main

# Restore your configuration
cp site-config.backup.json site-config.json

# Install dependencies and rebuild
npm install
npm run build

πŸ“ License

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


🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your 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

πŸ’¬ Support


⭐ Star History

If you find this project useful, please consider giving it a star! ⭐


Made with ❀️ by WPTR

About

HeadLess WordPress

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published