API PLATFORM: REST AND GRAPHQL FRAMEWORK ON TOP OF SYMFONYDOCSDEMORESOURCESCOMMUNITYDISTRIBUTIONAPI COMPONENT API Platform is built on top of battle-tested products. The server skeleton includes the famous Symfony framework and the Doctrine ORM. Our scaffolding tool supports the most popular JavaScript libraries. The development environment and the deployment mechanism leverage Docker, Kubernetes and Helm. extend the framework with thousands of API PLATFORM: GETTING STARTEDSEE MORE ON API-PLATFORM.COM API PLATFORM: GETTING STARTED Be sure to make your API send proper CORS HTTP headers to allow the admin's domain to access it.. To do so, if you use the API Platform Distribution, update the value of the CORS_ALLOW_ORIGIN parameter in api/.env (it will be set to ^https?://localhost:?*$ by default).. If you use a custom installation of Symfony and API Platform Core, you will need to adjust the NelmioCorsBundle API PLATFORM: THE EVENT SYSTEM The Event System. Note: using Kernel event with API Platform should be mostly limited to tweaking the generated HTTP response. Also, GraphQL is not supported.For most use cases, better extension points, working both with REST and GraphQL, are available. API PLATFORM: THE SERIALIZATION PROCESS The main serialization process has two stages: As you can see in the picture above, an array is used as a man-in-the-middle. This way, Encoders will only deal with turning specific formats into arrays and vice versa. The same way, Normalizers will deal with turning specific objects into arrays and vice versa. -- The Symfony documentation. API PLATFORM: FILTERS API Platform provides a convenient way to create Doctrine ORM and MongoDB ODM filters. If you use custom data providers , you can still create filters by implementing the previously mentioned interface, but - as API Platform isn't aware of your persistence system's internals - you have to create the filtering logic by yourself. API PLATFORM: CREATING CUSTOM OPERATIONS AND CONTROLLERS This custom operation behaves exactly like the built-in operation: it returns a JSON-LD document corresponding to the id passed in the URL. Here we consider that autowiring is enabled for controller classes (the default when using the API Platform distribution). This action will be automatically registered as a service (the service name is the same as the class name: App\Controller API PLATFORM: SECURITY The API Platform security layer is built on top of the Symfony Security component . All its features, including global access control directives are supported. API Platform also provides convenient access control expressions which you can apply at resource and operation level. Watch the Security screencast. API PLATFORM: CONFIGURATION This setting is only relevant when using the Doctrine ORM generator. Interfaces and Doctrine Resolve Target Entity Listener. ResolveTargetEntityListener is a feature of Doctrine to keep modules independent. It allows to specify interfaces and abstract classes in relation mappings.. If you set the option useInterface to true, the generator will generate an interface corresponding to each API PLATFORM: JWT AUTHENTICATION JWT Authentication. JSON Web Token (JWT) is a JSON-based open standard ( RFC 7519) for creating access tokens that assert some number of claims. For example, a server could generate a token that has the claim "logged in as admin" and provide that to a client. The client could then use that token to prove that he/she is logged in as admin. API PLATFORM: REST AND GRAPHQL FRAMEWORK ON TOP OF SYMFONYDOCSDEMORESOURCESCOMMUNITYDISTRIBUTIONAPI COMPONENT API Platform is built on top of battle-tested products. The server skeleton includes the famous Symfony framework and the Doctrine ORM. Our scaffolding tool supports the most popular JavaScript libraries. The development environment and the deployment mechanism leverage Docker, Kubernetes and Helm. extend the framework with thousands of API PLATFORM: GETTING STARTEDSEE MORE ON API-PLATFORM.COM API PLATFORM: GETTING STARTED Be sure to make your API send proper CORS HTTP headers to allow the admin's domain to access it.. To do so, if you use the API Platform Distribution, update the value of the CORS_ALLOW_ORIGIN parameter in api/.env (it will be set to ^https?://localhost:?*$ by default).. If you use a custom installation of Symfony and API Platform Core, you will need to adjust the NelmioCorsBundle API PLATFORM: THE EVENT SYSTEM The Event System. Note: using Kernel event with API Platform should be mostly limited to tweaking the generated HTTP response. Also, GraphQL is not supported.For most use cases, better extension points, working both with REST and GraphQL, are available. API PLATFORM: THE SERIALIZATION PROCESS The main serialization process has two stages: As you can see in the picture above, an array is used as a man-in-the-middle. This way, Encoders will only deal with turning specific formats into arrays and vice versa. The same way, Normalizers will deal with turning specific objects into arrays and vice versa. -- The Symfony documentation. API PLATFORM: FILTERS API Platform provides a convenient way to create Doctrine ORM and MongoDB ODM filters. If you use custom data providers , you can still create filters by implementing the previously mentioned interface, but - as API Platform isn't aware of your persistence system's internals - you have to create the filtering logic by yourself. API PLATFORM: CREATING CUSTOM OPERATIONS AND CONTROLLERS This custom operation behaves exactly like the built-in operation: it returns a JSON-LD document corresponding to the id passed in the URL. Here we consider that autowiring is enabled for controller classes (the default when using the API Platform distribution). This action will be automatically registered as a service (the service name is the same as the class name: App\Controller API PLATFORM: SECURITY The API Platform security layer is built on top of the Symfony Security component . All its features, including global access control directives are supported. API Platform also provides convenient access control expressions which you can apply at resource and operation level. Watch the Security screencast. API PLATFORM: CONFIGURATION This setting is only relevant when using the Doctrine ORM generator. Interfaces and Doctrine Resolve Target Entity Listener. ResolveTargetEntityListener is a feature of Doctrine to keep modules independent. It allows to specify interfaces and abstract classes in relation mappings.. If you set the option useInterface to true, the generator will generate an interface corresponding to each API PLATFORM: JWT AUTHENTICATION JWT Authentication. JSON Web Token (JWT) is a JSON-based open standard ( RFC 7519) for creating access tokens that assert some number of claims. For example, a server could generate a token that has the claim "logged in as admin" and provide that to a client. The client could then use that token to prove that he/she is logged in as admin. API PLATFORM: GETTING STARTED Getting started Installing API Platform Core. If you are starting a new project, the easiest way to get API Platform up is to install the API Platform Distribution.It comes with the API Platform Core library integrated with the Symfony framework, the schema generator, Doctrine ORM, Elasticsearch-PHP, NelmioCorsBundle and Behat. Doctrine MongoDB ODM can also be enabled by following the MongoDB API PLATFORM: GETTING STARTED Be sure to make your API send proper CORS HTTP headers to allow the admin's domain to access it.. To do so, if you use the API Platform Distribution, update the value of the CORS_ALLOW_ORIGIN parameter in api/.env (it will be set to ^https?://localhost:?*$ by default).. If you use a custom installation of Symfony and API Platform Core, you will need to adjust the NelmioCorsBundle API PLATFORM: GETTING STARTED API Platform Con 2021: join us in Lille (France) or online on September 10 for our 1st international conference. API PLATFORM: THE EVENT SYSTEM The Event System. Note: using Kernel event with API Platform should be mostly limited to tweaking the generated HTTP response. Also, GraphQL is not supported.For most use cases, better extension points, working both with REST and GraphQL, are available. API PLATFORM: OPERATIONS API Platform automatically registers typical CRUD operations and describes them in the exposed documentation (Hydra and Swagger). It also creates and registers routes corresponding to these operations in the Symfony routing system (if it is available). The behavior of built-in operations is briefly presented in the Getting started guide. API PLATFORM: IDENTIFIERS Identifiers. Every item operation has an identifier in its URL. Although this identifier is usually a number, it can also be an UUID, a date, or the type of your choice.To help with your development experience, we introduced an identifier normalization process. API PLATFORM: JSON SCHEMA SUPPORT JSON Schema Support. JSON Schema is a popular vocabulary to describe the shape of JSON documents. A variant of JSON Schema is also used in OpenAPI specifications.. API Platform provides an infrastructure to generate JSON Schemas for any resource, represented in API PLATFORM: DEPRECATING RESOURCES AND PROPERTIES As you can see, to deprecate a resource, we just have to explain what the client should do to upgrade in the dedicated attribute. The deprecation will automatically be taken into account by clients supporting the previously mentioned format, including API Platform Admin, API Platform Client Generator and the lower level api-doc-parser library. Here is how it renders for OpenAPI in the
built-in
API PLATFORM: HANDLING FILE UPLOAD As common a problem as it may seem, handling file upload requires a custom implementation in your app. This page will guide you in handling file upload in your API, with the help of VichUploaderBundle. It is recommended you read the documentation of VichUploaderBundle before proceeding. It will help you get a grasp on how the bundle works, and
API PLATFORM: DATA PERSISTERS To mutate the application states during POST, PUT, PATCH or DELETE operations, API Platform uses classes called data persisters. Data persisters receive an instance of the class marked as an API resource (usually using the # attribute). This instance contains data submitted by the client during the deserialization process. API Platform
docs
Distribution API component Schema component Admin component Scaffolding component Deployment
Screencasts
Demo
Resources
News Logos Wallpapers Colouring Webby
Community
Overview Contributors Events API Platform
API PLATFORM:REST AND GRAPHQL FRAMEWORK TO BUILD MODERN API-DRIVEN PROJECTS
Download
Get started
THE API PLATFORM FRAMEWORK API Platform is a set of tools to build and consume web APIs API COMPONENT
Build a fully-featured hypermedia or GraphQL API in minutes. Leverage its awesome features to develop complex and high performance API-first projects. Extend or override everything you want. Read more
SCHEMA GEN COMPONENT Instantly generates a PHP data model from the Schema.org vocabulary. Let the ORM create the related tables. Read more
ADMIN COMPONENT
Adds a convenient Material Design administration interface built with React without writing a line of code. It's a Progressive Web App! Read more
CLIENT GEN COMPONENT Scaffolds a Progressive Web App (React or Vue.js) or a native mobile app (React Native), and edit it to fit your needs. Read more
AN ALL-IN-ONE SOLUTION FOR MODERN PROJECTS GRAPHQL, LINKED DATA and SEMANTIC WEB compatible Super easy ONE CLICK INSTALL with Docker Generate your PROGRESSIVE WEB APPS and NATIVE MOBILE APPS DEPLOY INSTANTLY in the cloud with Kubernetes BUILT ON THE SHOULDERS OF GIANTS API Platform is built on top of BATTLE-TESTED PRODUCTS. The server skeleton includes the famous SYMFONY 4 microframework and the DOCTRINE ORM. Client-side components use Facebook's REACT (a Vue.js integration is also available). The development environment and the deployment mechanism leverage DOCKER, KUBERNETES AND HELM. extend the framework with thousands of existing Symfony bundles and React components use the server library in any existing Symfony or PHP app, use client components with any Hydra-enabled API, regardless of its programming language
reuse all your Symfony, React and Docker skills and benefit of their high quality docs; you are in known territory API Platform is also designed as a set of independent and reusable components. You can perfectly use them in a standalone way, or integrate them by yourself in your own project. CREATING LINKED DATA REST APIS HAS NEVER BEEN SO EASY SHAPE THE DATA
CREATE A MODEL
Design your own data model as plain old PHP classes or import an existing structure from the Schema.org vocabulary. BUILD THE SERVER
EXPOSE YOUR API
Embrace the open web: JSON-LD/Hydra, GraphQL, JSON API, HAL, YAML, JSON, XML and CSV are supported out of the box. ADD AUTH
Add JSON Web Token or OAuth authentication in a breath. CORS support is built-in. OWASP’s best practices are automatically enforced. BROWSE THE DOCS
Enjoy the beautiful, automatically generated, API documentation (Swagger/OpenAPI).
ADD CLIENTS
PWA AND MOBILE
Generate React, React Native and Vue.js apps from the API docs. CREATE AN ADMIN
A nice Material UI admin interface built with React is automatically available!
TEST
SPECS & TESTS
Add unit tests with PHPUnit. Create specs and tests with a developer friendly API testing tool on top of Behat. A Postman integration is also provided.
DEPLOY
CLOUD NATIVE
Install a development environment and deploy your project in production using Docker, Kubernetes and the Helm package manager. EASY TO EXPOSE, EASY TO CONSUME! API Platform is agnostic of the client-side technology. Thanks to open web standards, it is compatible with: JAVASCRIPT APPS (including but not limited to React and Angular) NATIVE MOBILE APPS (iOS, Android...) ALL MODERN PROGRAMMING LANGUAGES (PHP, Java, .Net, Ruby, Python...) ENHANCE SEO AND INTEROPERABILITY Adding Schema.org markup to websites and apps increase their ranking in search engines results and enable awesome features such as Google Rich Snippets and Gmail markup
.
Mapping your app data model to Schema.org structures can be a tedious task. Using the generator , your data model will be a derived from Schema.org. Serializing your data as JSON-LD will not require specific mapping nor adaptation. Simply include a JSON-LD file in your page instead of enriching the DOM: IT’S A MATTER OF MINUTES BEFORE BEING SEO READY. Schema.org improves the interoperability of your applications. Used with hypermedia technologies such as Hydra it's a big step towards the semantic and machine readable web. It opens the way to generic web API clients able to extract and process data from any website or app using such technologies. THEY USE API PLATFORM OPEN SOURCE PROJECTS Bolt
CoopCycle
Digital State
AudienceHero
Mobicoop
French Government
En Marche !
Parti de gauche
PartKeepr
COMPANIES
Copyright © 2019 Kévin Dunglas Sponsored by Les-Tilleuls.coop Code licensed under MIT ,
documentation under CC BY 3.0 .
Trademark policy
API Platform
Home
docs
Distribution API component Schema component Admin component Scaffolding component Deployment
Screencasts
Demo
Resources
News Logos Wallpapers Colouring Webby
Community
Overview Contributors Events