{"id":13606354,"url":"https://github.com/itsamoreh/byob-headless-wordpress","last_synced_at":"2025-04-18T19:13:34.788Z","repository":{"id":44782243,"uuid":"428571481","full_name":"itsamoreh/byob-headless-wordpress","owner":"itsamoreh","description":"WIP - Headless WordPress setup for Gutenberg blocks from scratch.","archived":false,"fork":false,"pushed_at":"2022-09-15T23:43:54.000Z","size":1491,"stargazers_count":7,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-12T08:40:13.784Z","etag":null,"topics":["nextjs","wordpress"],"latest_commit_sha":null,"homepage":"byob-demo.vercel.app","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/itsamoreh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-11-16T08:15:19.000Z","updated_at":"2022-11-19T06:37:35.000Z","dependencies_parsed_at":"2023-01-18T09:31:08.018Z","dependency_job_id":null,"html_url":"https://github.com/itsamoreh/byob-headless-wordpress","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsamoreh%2Fbyob-headless-wordpress","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsamoreh%2Fbyob-headless-wordpress/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsamoreh%2Fbyob-headless-wordpress/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsamoreh%2Fbyob-headless-wordpress/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itsamoreh","download_url":"https://codeload.github.com/itsamoreh/byob-headless-wordpress/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249535845,"owners_count":21287496,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["nextjs","wordpress"],"created_at":"2024-08-01T19:01:08.417Z","updated_at":"2025-04-18T19:13:34.763Z","avatar_url":"https://github.com/itsamoreh.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Next.js Headless WordPress Starter\n\n## Setup\n\nFirst, clone or fork the repo and `cd` into it.\n\n```bash\ngit clone https://github.com/itsamoreh/nextjs-headless-wordpress.git\ncd nextjs-headless-wordpress\n```\n\nNext install Docker from [docs.docker.com/get-docker](https://docs.docker.com/get-docker/) and make sure Docker is running before you continue.\n\nSet up the project with: `./wp-byob configure`. You'll be asked a few questions.\n\n**Would you like to use this project's WordPress backend setup?**\n\nAnswer:\n\n`y`: If you would like to use this project's WordPress backend setup using Docker.\n\n`n`: If you want to use your own WordPress setup.\n\n**What is your WordPress URL?**\n\nThis URL will be used to access WordPress. The default is http://localhost:8080 if you just press enter.\n\n**What is your Next.js frontend URL?**\n\nThis URL will be used to access the Next.js frontend. The default is http://localhost:3000 if you just press enter.\n\n**This is going to:**\n\n- Create the `.env` file in the frontend directory.\n- Setup the WordPress backend with all plugins via composer (if you chose to use this project's WordPress backend setup).\n- Install npm packages for Next.js frontend and start the development server.\n\nThe **WordPress backend** will be available at [http://localhost:8080](http://localhost:8080) by default.\nThe **Next.js frontend** will be available on at [http://localhost:3000](http://localhost:3000) by default.\n\n### After Setup\n\n- Make sure to activate all plugins that were installed via composer by going to \"WordPress Admin Panel \u003e Plugins\".\n- Update the block registry by going to \"WordPress Admin Panel \u003e GraphQL Gutenberg\".\n- Update the permalink by going to \"WordPress Admin Panel \u003e Settings \u003e Permalinks\". Choose \"Post name\" under \"Common Settings\" and hit \"Save\".\n- Set a Homepage and Posts page by going to \"WordPress Admin Panel \u003e Settings \u003e Reading\".\n- See \"Debugging\" if you're having problems.\n\n### During development\n\nUseful commands (run these from the project root):\n\n```bash\n./wp-byob configure       # Run the configuration wizard to set up the backend, frontend and create an .env file.\n./wp-byob start-all       # Create and start the WordPress docker environment and run the Next.js development server.\n./wp-byob start-backend   # Start the WordPress docker environment.\n./wp-byob start-frontend  # Run Next.js development server.\n./wp-byob stop            # Stop the WordPress docker environment.\n```\n\n## Debugging\n\n**If you get a server error on the frontend, check to see that the `.htaccess` file in `backend/wordpress` has the following rules. They may have been overwritten during setup.**\n\n```shell script\n# BEGIN WordPress\n# The directives (lines) between \"BEGIN WordPress\" and \"END WordPress\" are\n# dynamically generated, and should only be modified via WordPress filters.\n# Any changes to the directives between these markers will be overwritten.\n\u003cIfModule mod_rewrite.c\u003e\nRewriteEngine On\nRewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]\nRewriteBase /\nRewriteRule ^index\\.php$ - [L]\nRewriteCond %{REQUEST_FILENAME} !-f\nRewriteCond %{REQUEST_FILENAME} !-d\nRewriteRule . /index.php [L]\n\u003c/IfModule\u003e\n\n# END WordPress\n```\n\n**If you're getting another error on the frontend.**\n\n- Check if all the required WordPress plugins form `backend/wordpress/composer.json` are Activated by going to \"WordPress Admin Panel \u003e Plugins\".\n- Ensure you have updated the block registry by going to \"WordPress Admin Panel \u003e GraphQL Gutenberg\".\n- Ensure that `.env` file has the correct env variables and values in `frontend/.env`.\n\n**If you need to change `php.ini`'s `upload_max_filesize` directive, add the following to the `.htaccess` file in `backend/wordpress`, customizing limits for your needs.**\n\n```shell script\n\n# END WordPress\n\nphp_value upload_max_filesize 12M\nphp_value post_max_size 13M\nphp_value memory_limit 15M\n```\n\n## Credits\n\n[Imran Sayed's Next.js Headless WordPress](https://github.com/imranhsayed/nextjs-headless-wordpress)\n\n[Colby Fayock's Next.js WordPress Starter](https://github.com/colbyfayock/next-wordpress-starter)\n\n[WebDevStudios' Next.js WordPress Starter](https://github.com/WebDevStudios/nextjs-wordpress-starter)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitsamoreh%2Fbyob-headless-wordpress","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitsamoreh%2Fbyob-headless-wordpress","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitsamoreh%2Fbyob-headless-wordpress/lists"}