The API first framework

Download
Getting started

API Platform Framework

The easiest way to create your web API

1

Install the framework

Install Docker and optionally GitHub CLI.

Install

gh repo create –template api-platform/api-platform my-api
cd my-api
docker compose up
open https://localhost
gh repo create –template api-platform/api-platform my-api
cd my-api
docker compose up
open https://localhost

Your development environment is ready!

Continuous integration (GitHub Action) as well as recipes to deploy in production with Docker Compose or Kubernetes are also pre-installed.
2

Define the resourcesas PHP classes, or using OpenAPI

Define the resources to expose

<?php
 
namespace App\ApiResource;
 
#[ApiResource]
class Beer
{
    public int $id;
    public string $name;
}
<?php
 
namespace App\ApiResource;
 
#[ApiResource]
class Beer
{
    public int $id;
    public string $name;
}
You get:
  • A stable state-of-the-art REST & GraphQL API

  • Automatic documentation OpenAPI, SwaggerUI, GraphiQL...

  • Support for standards and formats JSON-LD, Hydra, JSON:API

Alternatively, generate the classes from an existing RDF vocabulary.

API Platform automatically exposes production-grade HATEOAS API for you!

3

Plug your business & persistance logic

Plug your logic

class MyProcessor implements ProcessorInterface
{
// …
}
 
class MyProvidedr implements ProviderInterface
{
// …
}
class MyProcessor implements ProcessorInterface
{
// …
}
 
class MyProvidedr implements ProviderInterface
{
// …
}

The framework has been designed from the ground up to be usable from Rapid Application Development contexts to Domain-Driven Design or Clean Architecture-like approaches.

You can even mix both approaches!

...or use the native integration with popular persistence libraries!

Native integration

#[ORM\Entity]
#[ApiResource]
// …
#[ORM\Entity]
#[ApiResource]
// …

API Platform can automatically retrieve, persist, paginate and validate data using the most popular database systems.

You can also make your own persistence system!

4

Customize!

Customize every single behavior thanks to our carefully designed extension points.


Client generator

Scaffold client apps

We don't want to decide for you which front-end framework you want to work with. That's why we allow you to generate a web or mobile application for most popular front-end frameworks, like Vue, React, or Quasar.

Learn more

API Platform admin

Enjoy a beautiful B2B interface

API Platform Admin exposes your data trough a beautiful UI.

Entirely customizable

Hydra and OpenAPI compatible

Built on top of Material UI and React Admin

100% no code

Automatic API discovery

Mercure.rocks

Go real time

API Platform automatically leverages the Mercure protocol to send updates made to your resources to all the connected clients. Updates are automatically broadcasted by the API component. The admin and all the generated client skeletons are also natively able to receive the event and update the UI automatically.

Learn more

More features

Going further

Authentication and access control rules
Advanced data validation
Invalidation-based HTTP cache
Asynchronous state processing
Relation preloading avec Vulcain.rocks
Caddy server integration HTTPS & HTTP/3
Automatic pagination and filtering
Docker & Kubernetes setups included

References

They use API Platform

Open source
24 SèvresAdeoAlstomArteBNPFrance TVizi by eDFLibérationOrangeRenaultSensioLabsSmile
See all our references

Copyright © 2023 Kévin Dunglas

Sponsored by Les-Tilleuls.coop