{"id":22120811,"url":"https://github.com/codersakl/wp-react","last_synced_at":"2025-07-25T12:33:54.298Z","repository":{"id":43794542,"uuid":"198846165","full_name":"CodersAKL/wp-react","owner":"CodersAKL","description":"Wordpress headless cms + react with nextjs","archived":false,"fork":false,"pushed_at":"2023-07-18T21:31:11.000Z","size":10089,"stargazers_count":4,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-02T07:51:13.974Z","etag":null,"topics":["backend","docker","frontend","headless","headless-cms","headless-wordpress","headless-wp","theme","wordpress","wordpress-admin"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CodersAKL.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-25T14:24:41.000Z","updated_at":"2024-09-21T18:28:45.000Z","dependencies_parsed_at":"2024-12-01T14:30:50.986Z","dependency_job_id":"33a1f6c8-ae62-4502-9849-28bd6687c8b6","html_url":"https://github.com/CodersAKL/wp-react","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/CodersAKL/wp-react","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodersAKL%2Fwp-react","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodersAKL%2Fwp-react/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodersAKL%2Fwp-react/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodersAKL%2Fwp-react/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CodersAKL","download_url":"https://codeload.github.com/CodersAKL/wp-react/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodersAKL%2Fwp-react/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267007602,"owners_count":24020261,"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","status":"online","status_checked_at":"2025-07-25T02:00:09.625Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["backend","docker","frontend","headless","headless-cms","headless-wordpress","headless-wp","theme","wordpress","wordpress-admin"],"created_at":"2024-12-01T14:30:05.188Z","updated_at":"2025-07-25T12:33:53.982Z","avatar_url":"https://github.com/CodersAKL.png","language":"TypeScript","readme":"## Install\n\n_Prerequisite:_ Before you begin, you need [Docker](https://www.docker.com) installed. On Linux, you might need to install [docker-compose](https://docs.docker.com/compose/install/#install-compose) separately.\n\nDocker Compose builds and starts four containers by default: `db-headless`, `wp-headless`, `frontend`:\n\n    docker-compose up -d\n\n**Wait a few minutes** for Docker to build the services for the first time. After the initial build, startup should only take a few seconds.\n\nYou can follow the Docker output to see build progress and logs:\n\n    docker-compose logs -f\n\nAlternatively, you can use some useful Docker tools like Kitematic and/or VSCode Docker plugin to follow logs, start / stop / remove containers and images.\n\n_Optional:_ you can run the frontend locally while WordPress still runs on Docker:\n\n    docker-compose up -d wp-headless\n    cd frontend \u0026\u0026 yarn \u0026\u0026 yarn start\n\nOnce the containers are running, you can visit the React frontends and backend WordPress admin in your browser.\n\n## Frontend\n\nThis starter kit provides two frontend containers:\n\n- `frontend` container powered by the WP REST API is server-side rendered using Next.js, and exposed on port `3000`: [http://localhost:3000](http://localhost:3000)\n\nHere's what the frontend looks like:\n\nYou can follow the `yarn start` output by running docker-compose `logs` command followed by the container name. For example:\n\n    docker-compose logs -f frontend\n\nIf you need to restart that process, restart the container:\n\n    docker-compose restart frontend\n\n**PS:** Browsing the Next.js frontend in development mode is relatively slow due to the fact that pages are being built on demand. In a production environment, there would be a significant improvement in page load.\n\n## Backend\n\nThe `wp-headless` container exposes Apache on host port `8080`:\n\n- Dashboard: [http://localhost:8080/wp-admin](http://localhost:8080/wp-admin) (default credentials `nedstark`/`winteriscoming`)\n- REST API: [http://localhost:8080/wp-json](http://localhost:8080/wp-json)\n\nThis container includes some development tools:\n\n    docker exec wp-headless composer --help\n    docker exec wp-headless phpcbf --help\n    docker exec wp-headless phpcs --help\n    docker exec wp-headless phpunit --help\n    docker exec wp-headless wp --info\n\nApache/PHP logs are available via `docker-compose logs -f wp-headless`.\n\n## Database\n\nThe `db-headless` container exposes MySQL on host port `3307`:\n\n    mysql -uwp_headless -pwp_headless -h127.0.0.1 -P3307 wp_headless\n\nYou can also run a mysql shell on the container:\n\n    docker exec db-headless mysql -hdb-headless -uwp_headless -pwp_headless wp_headless\n\n## Reinstall/Import\n\nTo reinstall WordPress from scratch, run:\n\n    docker exec wp-headless wp db reset --yes \u0026\u0026 docker exec wp-headless install_wordpress\n\nTo import data from a mysqldump with `mysql`, run:\n\n    docker exec db-headless mysql -hdb-headless -uwp_headless -pwp_headless wp_headless \u003c example.sql\n    docker exec wp-headless wp search-replace https://example.com http://localhost:8080\n\n## Extend the REST APIs\n\nAt this point you can start setting up custom fields in the WordPress admin, and if necessary, creating [custom REST API endpoints](https://developer.wordpress.org/rest-api/extending-the-rest-api/adding-custom-endpoints/).\n\nThe primary theme code is located in `wordpress/wp-content/themes/postlight-headless-wp`.\n\n## Linting\n\nRemember to lint your code as you go.\n\nTo lint WordPress theme modifications, you can use [PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) like this:\n\n    docker exec -w /var/www/html/wp-content/themes/postlight-headless-wp wp-headless phpcs\n\nYou may also attempt to autofix PHPCS errors:\n\n    docker exec -w /var/www/html/wp-content/themes/postlight-headless-wp wp-headless phpcbf\n\nTo lint and format the JavaScript apps, both [Prettier](https://prettier.io/) and [ESLint](https://eslint.org/) configuration files are included.\n\n## Hosting\n\nMost WordPress hosts don't also host Node applications, so when it's time to go live, you will need to find a hosting service for the frontend.\n\nThat's why we've packaged the frontend app in a Docker container, which can be deployed to a hosting provider with Docker support like Amazon Web Services or Google Cloud Platform. For a fast, easier alternative, check out [Now](https://zeit.co/now).\n\n## Troubleshooting Common Errors\n\n**Docker Caching**\n\nIn some cases, you need to delete the `wp-headless` image (not only the container) and rebuild it.\n\n**CORS errors**\n\nIf you have deployed your WordPress install and are having CORS issues be sure to update `/wordpress/wp-content/themes/postlight-headless-wp/inc/frontend-origin.php` with your frontend origin URL.\n\n---\n\n\u003e Happy coding!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodersakl%2Fwp-react","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodersakl%2Fwp-react","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodersakl%2Fwp-react/lists"}