phramecms / api
Plug-and-play headless REST / JSON:API and dynamic OpenAPI 3.1 module for PhrameCMS.
v0.1.0
2026-12-04 21:15 UTC
Requires
- php: ^8.5
- phramecms/config: ^0.1
- phramecms/core: ^0.1
- phramecms/entity: ^0.1
- phramecms/routing: ^0.1
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.95
- infection/infection: ^0.35.12
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^13.0
- phramecms/user: ^0.1
- spaze/phpstan-disallowed-calls: ^4.15
Suggests
- phramecms/user: Enables token authentication and RBAC/ABAC policy enforcement on API requests
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-12-04 21:34:12 UTC
README
Plug-and-play headless REST / JSON:API and dynamic OpenAPI 3.1 module for PhrameCMS.
Responsibilities
- Zero-Boilerplate Content Endpoints: Automatically exposes every configured Entity Type and Bundle under
/api/v1/content/{entity_type}/{bundle}(GETlist,POSTcreate,GET /{id},PATCH /{id},DELETE /{id},GET /{id}/revisions,POST /{id}/transitions). - Query Capabilities: Standardized filtering (
?filter[status]=published), sorting (?sort=-created_at), cursor/page pagination, sparse fieldsets (?fields[article]=title,slug), and relationship inclusion (?include=author,tags). - Config & Schema Introspection Endpoints:
/api/v1/schemaand/api/v1/schema/entities/{type}/{bundle}exposing live JSON Schemas./api/v1/config/{name}and/api/v1/config/diff(RBAC-protected, supporting?dry_run=true).
- Dynamic OpenAPI 3.1 Specification: Automatically generates
/api/v1/openapi.jsonfrom active modules, entity bundles, field types, and registered Core Operations — staying permanently in sync with site configuration. - Thin Adapter Architecture: Contains zero duplicated domain logic; every request translates into a Core
OperationBusinvocation with the authenticated actor context.
Dependencies
- PHP
^8.5 phramecms/corephramecms/routingphramecms/entityphramecms/configphramecms/user(optional — enforces token auth & RBAC when installed)
Ecosystem
Part of the PhrameCMS multi-repo suite. See PhrameCMS/cms for the starter distribution and architecture docs.