README.md 8,09 ko
Newer Older
Kévin Dunglas's avatar
Kévin Dunglas a validé
The API Platform Framework
==========================
Kévin Dunglas's avatar
Kévin Dunglas a validé

The Gitter Badger's avatar
The Gitter Badger a validé
[![Join the chat at https://gitter.im/api-platform/api-platform](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/api-platform/api-platform?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
Kévin Dunglas's avatar
Kévin Dunglas a validé
[![Build Status](https://travis-ci.org/api-platform/core.svg?branch=master)](https://travis-ci.org/api-platform/core)
[![Build status](https://ci.appveyor.com/api/projects/status/grwuyprts3wdqx5l?svg=true)](https://ci.appveyor.com/project/dunglas/dunglasapibundle)
[![Coverage Status](https://coveralls.io/repos/github/api-platform/core/badge.svg)](https://coveralls.io/github/api-platform/core)
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/a93f5a40-483f-4c46-ba09-3e1033b62552/mini.png)](https://insight.sensiolabs.com/projects/a93f5a40-483f-4c46-ba09-3e1033b62552)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/api-platform/core/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/api-platform/core/?branch=master)
[![Dependency Status](https://www.versioneye.com/user/projects/5552e93306c318a32a0000fa/badge.svg?style=flat)](https://www.versioneye.com/user/projects/5552e93306c318a32a0000fa)
The Gitter Badger's avatar
The Gitter Badger a validé

Tomasz Pluskiewicz's avatar
Tomasz Pluskiewicz a validé
*The new breed of web frameworks*
Kévin Dunglas's avatar
Kévin Dunglas a validé

Kévin Dunglas's avatar
Kévin Dunglas a validé
[![API Platform](https://api-platform.com/logo-250x250.png)](https://api-platform.com)
Kévin Dunglas's avatar
Kévin Dunglas a validé

The official project documentation is available **[on the API Platform website][31]**.

Quentin80's avatar
Quentin80 a validé
API Platform is a next-generation PHP web framework designed to easily create
API-first projects without compromising extensibility and
Kévin Dunglas's avatar
Kévin Dunglas a validé
flexibility:
Kévin Dunglas's avatar
Kévin Dunglas a validé
* **Expose in minutes an hypermedia REST API** that works out of the box by reusing
  entity metadata (ORM mapping, validation and serialization) ; that embraces [JSON-LD][1],
Kévin Dunglas's avatar
Kévin Dunglas a validé
  [Hydra][2] and such other data formats like [HAL][32], [YAML][33], [XML][34] or [CSV][35]
Quentin80's avatar
Quentin80 a validé
  and provides a ton of features (CRUD, validation and error handling, relation embedding, filters, ordering...)
Kévin Dunglas's avatar
Kévin Dunglas a validé
* Enjoy the **beautiful automatically generated API documentation** (Swagger)
* Use our awesome code generator to **bootstrap a fully-functional data model from
  [Schema.org][8] vocabularies** with ORM mapping and validation (you can also do
  it manually)
Quentin80's avatar
Quentin80 a validé
* Easily add **[JSON Web Token][25] or [OAuth][26] authentication**
Kévin Dunglas's avatar
Kévin Dunglas a validé
* Create specs and tests with a **developer friendly API context system** on top
  of [Behat][10]
* Develop your website UI, webapp, mobile app or anything else you want using
Kévin Dunglas's avatar
Kévin Dunglas a validé
  **your preferred client-side technologies**! Tested and approved with **React**, **AngularJS**
  (integration included), **Ionic**  and **native mobile** apps
Kévin Dunglas's avatar
Kévin Dunglas a validé

Kévin Dunglas's avatar
Kévin Dunglas a validé
API Platform embraces open web standards (Swagger, JSON-LD, Hydra, HAL, JWT, OAuth,
HTTP...) and the [Linked Data][27] movement. Your API will automatically
expose structured data in Schema.org/JSON-LD. It means that your API Platform application
is usable **out of the box** with technologies of the semantic
Kévin Dunglas's avatar
Kévin Dunglas a validé
web.

It also means that **your SEO will be improved** because **[Google recommends these
formats][28]**.
And yes, Google crawls full-Javascript applications [as well as old-fashioned ones][29].

Last but not least, API Platform is built on top of the [Symfony][5]
Kévin Dunglas's avatar
Kévin Dunglas a validé
full-stack framework and follows its best practices. It means than you can:

* use **thousands of Symfony bundles** with API Platform
* integrate API Platform in **any existing Symfony application**
Kévin Dunglas's avatar
Kévin Dunglas a validé
* reuse **all your Symfony skills** and benefit of the incredible
Quentin80's avatar
Quentin80 a validé
  amount of Symfony documentation
Kévin Dunglas's avatar
Kévin Dunglas a validé
* enjoy the popular [Doctrine ORM][6] (used by default, but fully optional: you can
  use the data provider you want, including but not limited to MongoDB ODM and ElasticSearch)

Install
-------

Kévin Dunglas's avatar
Kévin Dunglas a validé
[Read the official "Getting Started" guide](https://api-platform.com/docs/core/getting-started).
Kévin Dunglas's avatar
Kévin Dunglas a validé

What's inside?
--------------

API Platform provides rock solid foundations to build your project:
Kévin Dunglas's avatar
Kévin Dunglas a validé

* [**The Schema Generator**][7] to generate PHP entities from [Schema.org][8] types with
Kévin Dunglas's avatar
Kévin Dunglas a validé
Doctrine ORM mappings, Symfony validation and extended PHPDoc
* [**The API bundle**][9] to expose in minutes your entities as a JSON-LD and
Kévin Dunglas's avatar
Kévin Dunglas a validé
 Hydra enabled hypermedia REST API
Kévin Dunglas's avatar
Kévin Dunglas a validé
* [**Swagger UI**][24] integrated with the API bundle to
Kévin Dunglas's avatar
Kévin Dunglas a validé
automatically generate a beautiful human-readable documentation and a
sandbox to test the API
* [Behat][10] and [Behatch][11] configured to easily test the API
* The full power of the [**Symfony**][5] framework and its ecosystem
* **[Doctrine][6] ORM/DBAL**
* An AppBundle you can use to start coding
* Annotations enabled for everything
* Swiftmailer and Twig to create beautiful emails

It comes pre-configured with the following bundles:

  * [**Symfony**][5] - API Platform is built on top of the full-stack
Kévin Dunglas's avatar
Kévin Dunglas a validé
    Symfony framework
  * [**API Platform's API bundle**][9] - Creates powerful Hypermedia APIs supporting JSON-LD
Kévin Dunglas's avatar
Kévin Dunglas a validé
    and Hydra
Kévin Dunglas's avatar
Kévin Dunglas a validé
  * [**DunglasActionBundle**][36] - Automatically register actions, commands and event
   subscribers as a service
Kévin Dunglas's avatar
Kévin Dunglas a validé
  * [**NelmioCorsBundle**][12] - Support for CORS headers
  * [**NelmioApiDocBundle**][24] - Generates a human-readable documentation
  * [**FosHttpCacheBundle**][13] - Add powerful caching capacities, supports Varnish,
    Nginx a built-in PHP reverse proxy
  * [**SensioFrameworkExtraBundle**][14] - Adds several enhancements, including
    template and routing annotation capability
  * [**DoctrineBundle**][15] - Adds support for the Doctrine ORM
  * [**TwigBundle**][16] - Adds support for the Twig templating engine (useful
    in emails)
  * [**SecurityBundle**][17] - Authentication and roles by integrating Symfony's
    security component
  * [**SwiftmailerBundle**][18] - Adds support for Swiftmailer, a library for sending
    emails
  * [**MonologBundle**][19] - Adds support for Monolog, a logging library
  * **WebProfilerBundle** (in dev/test env) - Adds profiling functionality and
    the web debug toolbar
  * **SensioDistributionBundle** (in dev/test env) - Adds functionality for configuring
    and working with Symfony distributions
  * [**SensioGeneratorBundle**][20] (in dev/test env) - Adds code generation capabilities

All libraries and bundles included in API Platform are released under
Kévin Dunglas's avatar
Kévin Dunglas a validé
the MIT or BSD license.

Authentication support
----------------------

Json Web Token is a lightweight and popular way to handle authentication in a
stateless way. Install [**LexikJWTAuthenticationBundle**][21] to adds JWT support
to API Platform.
Kévin Dunglas's avatar
Kévin Dunglas a validé

Oauth support can also be easily added using [**FOSOAuthServerBundle**][22].

Enjoy!

Credits
-------

Created by [Kévin Dunglas][23]. Sponsored by [Les-Tilleuls.coop][30]
Commercial support available upon request.
Kévin Dunglas's avatar
Kévin Dunglas a validé

[1]:  http://json-ld.org
[2]:  http://hydra-cg.com
[3]:  https://getcomposer.org
Kévin Dunglas's avatar
Kévin Dunglas a validé
[4]:  http://www.hydra-cg.com/
[5]:  https://symfony.com
[6]:  http://www.doctrine-project.org
[7]:  https://api-platform.com/doc/1.0/schema-generator/
Kévin Dunglas's avatar
Kévin Dunglas a validé
[8]:  http://schema.org
[9]:  https://api-platform.com/doc/1.0/api-bundle/
[10]: https://behat.readthedocs.org
Kévin Dunglas's avatar
Kévin Dunglas a validé
[11]: https://github.com/Behatch/contexts
[12]: https://github.com/nelmio/NelmioCorsBundle
[13]: https://foshttpcachebundle.readthedocs.org
[14]: https://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/index.html
[15]: https://symfony.com/doc/current/book/doctrine.html
[16]: https://symfony.com/doc/current/book/templating.html
[17]: https://symfony.com/doc/current/book/security.html
[18]: https://symfony.com/doc/current/cookbook/email.html
[19]: https://symfony.com/doc/current/cookbook/logging/monolog.html
[20]: https://symfony.com/doc/current/bundles/SensioGeneratorBundle/index.html
Kévin Dunglas's avatar
Kévin Dunglas a validé
[21]: https://github.com/lexik/LexikJWTAuthenticationBundle
[22]: https://github.com/FriendsOfSymfony/FOSOAuthServerBundle
[23]: https://dunglas.fr
Kévin Dunglas's avatar
Kévin Dunglas a validé
[24]: http://swagger.io/swagger-ui/
Kévin Dunglas's avatar
Kévin Dunglas a validé
[25]: http://jwt.io/
[26]: http://oauth.net/
[27]: https://en.wikipedia.org/wiki/Linked_data
Kévin Dunglas's avatar
Kévin Dunglas a validé
[28]: https://developers.google.com/structured-data/
[29]: http://searchengineland.com/tested-googlebot-crawls-javascript-heres-learned-220157
[30]: https://les-tilleuls.coop
[31]: https://api-platform.com
Quentin80's avatar
Quentin80 a validé
[32]: http://stateless.co/hal_specification.html
[33]: http://yaml.org/
[34]: https://www.w3.org/XML/
[35]: https://www.ietf.org/rfc/rfc4180.txt
Kévin Dunglas's avatar
Kévin Dunglas a validé
[36]: https://github.com/dunglas/DunglasActionBundle