{"id":26550173,"url":"https://github.com/technway/rest-api-starter","last_synced_at":"2025-09-11T10:43:27.131Z","repository":{"id":272504431,"uuid":"916797597","full_name":"technway/rest-api-starter","owner":"technway","description":"A lightweight, headless WordPress theme optimized for REST API functionality with JWT authentication support.","archived":false,"fork":false,"pushed_at":"2025-01-16T06:57:03.000Z","size":23,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-22T07:33:07.321Z","etag":null,"topics":["headless","headless-wordpress","rest-api","starter-theme","wordpress-theme"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/technway.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2025-01-14T19:24:19.000Z","updated_at":"2025-03-16T22:46:50.000Z","dependencies_parsed_at":"2025-01-14T21:33:45.889Z","dependency_job_id":"9b8f2e16-72a4-4b36-b18e-949745e5c059","html_url":"https://github.com/technway/rest-api-starter","commit_stats":null,"previous_names":["technway/rest-api-starter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/technway/rest-api-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technway%2Frest-api-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technway%2Frest-api-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technway%2Frest-api-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technway%2Frest-api-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/technway","download_url":"https://codeload.github.com/technway/rest-api-starter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technway%2Frest-api-starter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274618268,"owners_count":25318597,"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-09-11T02:00:13.660Z","response_time":74,"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":["headless","headless-wordpress","rest-api","starter-theme","wordpress-theme"],"created_at":"2025-03-22T07:30:46.689Z","updated_at":"2025-09-11T10:43:27.111Z","avatar_url":"https://github.com/technway.png","language":"PHP","readme":"\u003cdiv align=\"center\"\u003e\n\n![rest-api-starter-logo](https://i.ibb.co/mFwHYYR/rest-api-starter-logo.png)\n\n\u003ch1\u003eREST API Starter\u003c/h1\u003e\n\nA lightweight WordPress theme designed to function purely as a **headless REST API** endpoint. It strips away all frontend rendering and traditional WordPress theme features, focusing solely on providing a clean, efficient REST API interface for your WordPress content.\n\n[![WordPress](https://img.shields.io/badge/WordPress-6.7-blue.svg)](https://wordpress.org/)\n[![PHP](https://img.shields.io/badge/PHP-7.2+-purple.svg)](https://php.net/)\n[![License](https://img.shields.io/badge/license-GPL--2.0-green.svg)](https://www.gnu.org/licenses/gpl-2.0.html)\n\n\u003c/div\u003e\n\n---\n\n- [Get Started](#get-started)\n  - [Installation](#installation)\n  - [Required Plugins](#required-plugins)\n  - [Environment Setup](#environment-setup)\n    - [Step 1: Install Dependencies](#step-1-install-dependencies)\n    - [Step 2: Create the `.env` File](#step-2-create-the-env-file)\n    - [Step 3: Configure `wp-config.php`](#step-3-configure-wp-configphp)\n- [Usage](#usage)\n  - [Example API Endpoints:](#example-api-endpoints)\n  - [Authentication Example (Using JWT):](#authentication-example-using-jwt)\n  - [API Testing](#api-testing)\n- [Documentation](#documentation)\n- [License](#license)\n- [Support](#support)\n- [Credits](#credits)\n\n\n### Key Features:\n- Lightweight WordPress theme.\n- Clean and optimized codebase for API-focused development.\n- Removed unnecessary WordPress frontend features.\n- Disabled frontend rendering.\n- Redirects all frontend requests to the REST API endpoint.\n\n---\n\n## Get Started\n\n### Installation\n\n1. Clone the repository or download the zip file of this theme.\n2. (Optional) Rename the theme folder. And to update all theme references, run the provided rename script:\n   ```bash\n   php ./scripts/rename-theme.php \"NEW Theme Name\"\n   ```\n   This will automatically update all theme references.\n3. Upload the theme to the `wp-content/themes/` directory.\n4. Activate the theme via the WordPress admin panel: **Appearance \u003e Themes**.\n\n---\n\n### Required Plugins\n\nIf your API requires authentication, install the following plugin:\n\n- **[JWT Authentication for WP REST API](https://wordpress.org/plugins/jwt-authentication-for-wp-rest-api/)**:\n  This plugin secures your API endpoints with JWT tokens.\n\n---\n\n### Environment Setup\n\n#### Step 1: Install Dependencies\n\nRun the following command in the theme directory to install Composer dependencies:\n```bash\ncomposer install\n```\n\n#### Step 2: Create the `.env` File\n\n1. Duplicate `.env.example` to `.env`:\n   ```bash\n   cp .env.example .env\n   ```\n2. Replace the `JWT_AUTH_SECRET_KEY` value with a strong random string. You can use [this tool](https://api.wordpress.org/secret-key/1.1/salt/) to generate one.\n\n#### Step 3: Configure `wp-config.php`\n\nAdd the following code snippet to your `wp-config.php` file:\n\n```php\n/* Add any custom values between this line and the \"stop editing\" line. */\n\n$theme_path = __DIR__ . '/wp-content/themes/rest-api-starter';\n\nif (file_exists($theme_path . '/vendor/autoload.php')) {\n    require_once $theme_path . '/vendor/autoload.php';\n\n    // Load environment variables from .env\n    $dotenv = Dotenv\\Dotenv::createImmutable($theme_path);\n    $dotenv-\u003eload();\n\n    define('JWT_AUTH_SECRET_KEY', $_ENV['JWT_AUTH_SECRET_KEY']);\n    define('JWT_AUTH_CORS_ENABLE', $_ENV['JWT_AUTH_CORS_ENABLE']);\n}\n\n/* That's all, stop editing! Happy publishing. */\n```\n\nIf this setup doesn’t work, you can hardcode the secret key directly (not recommended for security reasons):\n\n```php\n/* Add any custom values between this line and the \"stop editing\" line. */\n\ndefine('JWT_AUTH_SECRET_KEY', 'your_secret_key_here');\ndefine('JWT_AUTH_CORS_ENABLE', true);\n\n/* That's all, stop editing! Happy publishing. */\n```\n\n---\n\n## Usage\n\nThis theme is designed to be used purely as a backend API. Once installed:\n\n1. All frontend requests will be redirected to `/wp-json`.\n2. Use the WordPress REST API to interact with your site content.\n\n### Example API Endpoints:\n- `GET /wp-json/wp/v2/posts` - Retrieve posts.\n- `GET /wp-json/wp/v2/pages` - Retrieve pages.\n- `GET /wp-json/wp/v2/media` - Retrieve media items.\n\n### Authentication Example (Using JWT):\n1. Obtain a token:\n   ```bash\n   POST /wp-json/jwt-auth/v1/token\n   {\n       \"username\": \"your-username\",\n       \"password\": \"your-password\"\n   }\n   ```\n2. Use the token for authenticated requests:\n   ```bash\n   GET /wp-json/wp/v2/posts\n   Authorization: Bearer \u003cyour-token\u003e\n   ```\n\n---\n\n### API Testing\nThe `testing-api` directory contains ready-to-use HTTP request files for testing the API endpoints. These tests are designed to work with VS Code's REST Client extension.\n\nFor detailed information about the API tests, see [testing-api.md](testing-api/testing-api.md).\n\n---\n\n## Documentation\n\nFor detailed WordPress REST API documentation, visit:\n[WordPress REST API Handbook](https://developer.wordpress.org/rest-api/)\n\n---\n\n## License\nThis theme is licensed under the GNU General Public License v2 or later (GPL-2.0). See the [LICENSE](LICENSE) file for details.\n\n---\n\n## Support\nFor support and contributions, visit the [Technway GitHub repository](https://github.com/technway/graphql-starter).\n\n---\n\n## Credits\nThe Rest API Starter Theme is built with ❤️ and maintained by **[Technway](https://technway.biz)**.\n\nContributions are welcome! Feel free to fork the repository and submit pull requests.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechnway%2Frest-api-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechnway%2Frest-api-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechnway%2Frest-api-starter/lists"}