API PLATFORM
A framework for API-driven Projects
Kévin Dunglas
Founder of Les-Tilleuls.coop
Symfony Core Team
API Platform creator
@dunglas
Les-Tilleuls.coop
Self-managed company since 2011
100% owned by employees
25 people, 97% growth in 2016
Hiring in London, Paris and Lille: jobs@les-tilleuls.coop
The Web of 2017
APIs: the Heart of the New Web
Progressive Web Apps
Downloaded only 1 time, works offline!
Sends async HTTP requests to the API
Huge ecosystem: React, Angular, Vue…
Holds the presentation logic
Static « website »: JS, HTML and CSS
Modernized stack:
ES2015, Babel, Webpack, Yarn, Flow, TypeScript, ReasonML…
Native Mobile Apps
Sync data by sending HTTP requests to the API
JS stack:
React Native, NativeScript
Downloaded from stores (App Store, Google Play)
Look’n’Feel consistent with the platform (iOS or Android)
Cloud Native Projects
Software built, tested and deployed continuously
Rich and open ecosystem:
Docker, Kubernetes, Mesos, Terraform…
Projects are hosted on public and private clouds
Containers and orchestration from dev stations to prod
A Framework
for the Modern Web
Goals
Modern API formats
A rock-solid API-first project in minutes
Batteries included:
create, consume and deploy the API
Customizable, extensible, modular:
config, events, decoration…
They already Use API Platform
Getting
Started
Get Docker
If you don’t have it yet…
Install
Grab a release on GitHub
Browse https://localhost
$ docker-compose up
API Platform and Symfony: a Framework for API-driven Projects
Just 1
class
Included (v2.1 - stable)
PHP FPM and Nginx containers, sensitive defaults for Symfony
Varnish container (more about this later)
Cross-platform Docker setup
MySQL container
Symfony Edition fine tuned for APIs
Upcoming Changes
HTTP/2 and HTTPS dev proxy
Containers for JS dev 🤔 🤗
Symfony Standard Edition Symfony Flex
Simplified directory structure
MySQL PostgreSQL
api-platform/api-platform@master
Too Much?
Go Micro with Flex
Browse http://localhost:8000
$ composer create-p symfony/skeleton api
$ cd api
$ composer req api
$ php -S 127.0.0.1:8000 -t public
Your Turn!
Create your
Class
PHPDoc extraction (optional)
The hook:@ApiResource
XML and YAML also supported
Doctrine integration (optional)
$ docker-compose exec php bin/console 
doctrine:schema:update --force
Plain Old PHP Object
Your 1st API
is ready!
API Platform and Symfony: a Framework for API-driven Projects
Out of the Box Features
JSON-LD + Hydra formats
But also… JSONAPI, HAL, XML, YAML, CSV and raw JSON…
OpenAPI (aka Swagger) doc
Nice UI (Swagger UI)
POST, GET (item and lists), PUT, DELETE
Pagination for lists (30 items per page), fully configurable
Data
Validation
Symfony
Validation groups
Error levels
Symfony Validator integration
API Platform and Symfony: a Framework for API-driven Projects
Relations
Class with a Relation
API Platform and Symfony: a Framework for API-driven Projects
Embedding Relations
Embedded Relations
HTTP Cache
(invalidation)
HTTP cache (invalidation)
GET responses generated only 1 time, then served by Varnish
(also work with CloudFlare and any cache proxy supporting tags)
Responses tagged with IRIs (URLs) of resources they contain
(including relations, embedded resources…)
When a write operation occurs cached responses containing outdated
data are purged
Builtin, single config flag, trusted proxies config provided
Browse https://localhost:444
Other
Features
API Platform and Symfony: a Framework for API-driven Projects
How does it
Work?
Core Library
Metadata Subsystem
Properties’ types and relations extracted with Symfony PropertyInfo
Guesses API’s structure (resources and properties)
from classes marked@ApiResource
Intermediate representation of the API structure
Used by Hypermedia normalizers (JSON-LD, Hydra, HAL…)
registered in the Symfony Serializer
Event-Driven Architecture
JSON-LD and Hydra
JSON-LD
Standardized hypermedia format: W3C recommandation (2014)
Easy to use: a standard JSON document with some specials
keys (starting with @) and mapped with a context
Backed by Google, BBC, Microsoft, US & UK govs...
Compliant with technologies of the semantic web: RDF,
SPARQL, triple store...
JSON for Linked Data
API Platform and Symfony: a Framework for API-driven Projects
API Platform and Symfony: a Framework for API-driven Projects
API Platform and Symfony: a Framework for API-driven Projects
API Platform and Symfony: a Framework for API-driven Projects
API Platform and Symfony: a Framework for API-driven Projects
API Platform and Symfony: a Framework for API-driven Projects
Hydra
auto-discoverable API:
resources, properties, types, operations
Standardize common API structures:
collections, paginations, filters, errors…
In-band API doc
Draft W3C
API Platform and Symfony: a Framework for API-driven Projects
API Platform and Symfony: a Framework for API-driven Projects
Data Fixtures
More Properties
More Properties
Install
$ docker-compose exec php 
composer req 
doctrine/data-fixtures:^1.2 
nelmio/alice:^3.0 
theofidry/alice-data-fixtures:^1.0@beta 
hautelook/alice-bundle:^2.0@beta
Loading Fixtures
$ docker-compose exec php bin/console
hautelook:fixtures:load
Client-side
tools
Admin
API Platform Admin
Sonata EasyAdmin-like but as a React PWA
Built on top of Admin On Rest (by Marmelab)
Material Design
Automatically generates the admin by parsing the Hydra API doc
Browse https://localhost:8001
API Platform and Symfony: a Framework for API-driven Projects
Alternatively…
$ yarn add @api-platform/admin
From any React installation:
Minimal Implementation
Customizing the Admin
API Platform and Symfony: a Framework for API-driven Projects
Clients
Generator
React PWA Generator (default)
SensioGeneratorBundle-like, 100% client-side
Rock solid stack
$ yarn global add @api-platform/client-generator
Twitter Bootstrap support + accessibility (ARIA roles)
Use ES2015’s fetch()
Parse Hydra API doc to generate files
API Platform and Symfony: a Framework for API-driven Projects
API Platform and Symfony: a Framework for API-driven Projects
API Platform and Symfony: a Framework for API-driven Projects
The Stack
React, ES2015+, JSX
React Router: client-side routing library
Redux: extensible container to manage the states of the app
Redux Form: forms
Redux Thunk: async actions (AJAX requests)
Optional: Twitter Bootstrap
Other Skeletons
React Native: master branch (@mysiar)
TypeScript definitions: master branch (@soyuka)
Your preferred technology: Pull Requests very appreciated!
Angular: community (momenttech/lysis)
Vue.js: api-platform/client-generator#35 (@alOneh)
React Native
$ generate-api-platform-client 
http://localhost src/ 
—g react-native
Deploy in
Clouds
Kubernetes & Helm
K8S: « Production-Grade Container Orchestration », by Google
Powers Google Kubernetes Engine and Azure Container Service
Helm: official K8S package manager (like APT or Homebrew), by Microsoft
Free software
Deploy in the Cloud
A Helm chart is provided with API Platform
# …Build and push the Docker images…
# …Connect to your Kubernetes cluster…
$ helm install ./api/helm/api --name api
The project is deployed,
managed, and scale!
One More
Thing…
GraphQL Support
$ composer req webonyx/graphql-php
api-platform/core@master (@alanpoulain & @raoulclais)
API Platform and Symfony: a Framework for API-driven Projects
Thanks!
Any questions?
api-platform/api-platform @ApiPlatform
https://api-platform.com

More Related Content

PDF
A Basic Django Introduction
PPTX
What Is Express JS?
PDF
Google Firebase presentation - English
PPTX
Springboot Microservices
PDF
Support developpement applications mobiles avec ionic v3 et v4
PPTX
Google Firebase Presentation
PDF
Terraform: An Overview & Introduction
PPTX
Firebase
A Basic Django Introduction
What Is Express JS?
Google Firebase presentation - English
Springboot Microservices
Support developpement applications mobiles avec ionic v3 et v4
Google Firebase Presentation
Terraform: An Overview & Introduction
Firebase

What's hot (20)

PDF
Support de cours angular
ODP
Introduction to Ansible
PPTX
Spring boot Introduction
PDF
Closures in Javascript
PPTX
containerd the universal container runtime
PPTX
Introduction to Node js
PPT
presentation on Docker
PPTX
Introduction to microservices
PDF
Microservice With Spring Boot and Spring Cloud
PPT
Formation jpa-hibernate-spring-data
PDF
Introduction to Firebase from Google
PPTX
PDF
Support Web Services SOAP et RESTful Mr YOUSSFI
PDF
Automating Network Infrastructure : Ansible
PDF
API : l'architecture REST
PDF
Support programmation orientée objet c# .net version f8
PDF
Architecture réparties et les services web
PDF
La persistance des données : ORM et hibernate
PDF
Docker 101: Introduction to Docker
PDF
[OpenStack Days Korea 2016] Track1 - 카카오는 오픈스택 기반으로 어떻게 5000VM을 운영하고 있을까?
Support de cours angular
Introduction to Ansible
Spring boot Introduction
Closures in Javascript
containerd the universal container runtime
Introduction to Node js
presentation on Docker
Introduction to microservices
Microservice With Spring Boot and Spring Cloud
Formation jpa-hibernate-spring-data
Introduction to Firebase from Google
Support Web Services SOAP et RESTful Mr YOUSSFI
Automating Network Infrastructure : Ansible
API : l'architecture REST
Support programmation orientée objet c# .net version f8
Architecture réparties et les services web
La persistance des données : ORM et hibernate
Docker 101: Introduction to Docker
[OpenStack Days Korea 2016] Track1 - 카카오는 오픈스택 기반으로 어떻게 5000VM을 운영하고 있을까?
Ad

Viewers also liked (9)

PDF
API Platform: Full Stack Framework Resurrection
PDF
Webpack Encore Symfony Live 2017 San Francisco
PDF
A Journey from Hexagonal Architecture to Event Sourcing - SymfonyCon Cluj 2017
PDF
Composer: putting dependencies on the score
PPTX
Overview of Message Queues
PDF
Symfony and frontend: a better way
PDF
Merging two big Symfony based applications - SymfonyCon 2017
PDF
Behat Best Practices with Symfony
PPTX
The reviewer checklist
API Platform: Full Stack Framework Resurrection
Webpack Encore Symfony Live 2017 San Francisco
A Journey from Hexagonal Architecture to Event Sourcing - SymfonyCon Cluj 2017
Composer: putting dependencies on the score
Overview of Message Queues
Symfony and frontend: a better way
Merging two big Symfony based applications - SymfonyCon 2017
Behat Best Practices with Symfony
The reviewer checklist
Ad

Similar to API Platform and Symfony: a Framework for API-driven Projects (20)

PDF
API Platform 2.1: when Symfony meets ReactJS (Symfony Live 2017)
PDF
API Platform: A Framework for API-driven Projects
PPTX
Creating hypermedia APIs in a few minutes using the API Platform framework
PDF
High quality ap is with api platform
PDF
A high profile project with Symfony and API Platform: beIN SPORTS
PDF
Creating a modern web application using Symfony API Platform Atlanta
PDF
A 60-mn tour of AWS compute (March 2016)
PPT
Programming With Amazon, Google, And E Bay
PDF
Building APIs in an easy way using API Platform
PDF
Docker serverless v1.0
PPT
Report From JavaOne 2009 - part 3
PDF
Building Desktop RIAs with PHP, HTML & Javascript in AIR
PPT
What is Adobe Flex ?
PPT
Adobe® Flex™
PPTX
Drupal 8 preview_slideshow
PPT
Current state of affairs cloud computing
PPT
UIT: Our Skills
PDF
Unleash your Symfony projects with eZ Platform
PPTX
ROLE Technologies – A possible contribution to Apache Rave?
PDF
Creating a modern web application using Symfony API Platform, ReactJS and Red...
API Platform 2.1: when Symfony meets ReactJS (Symfony Live 2017)
API Platform: A Framework for API-driven Projects
Creating hypermedia APIs in a few minutes using the API Platform framework
High quality ap is with api platform
A high profile project with Symfony and API Platform: beIN SPORTS
Creating a modern web application using Symfony API Platform Atlanta
A 60-mn tour of AWS compute (March 2016)
Programming With Amazon, Google, And E Bay
Building APIs in an easy way using API Platform
Docker serverless v1.0
Report From JavaOne 2009 - part 3
Building Desktop RIAs with PHP, HTML & Javascript in AIR
What is Adobe Flex ?
Adobe® Flex™
Drupal 8 preview_slideshow
Current state of affairs cloud computing
UIT: Our Skills
Unleash your Symfony projects with eZ Platform
ROLE Technologies – A possible contribution to Apache Rave?
Creating a modern web application using Symfony API Platform, ReactJS and Red...

More from Les-Tilleuls.coop (11)

PDF
Symfony on steroids
: Vue.js, Mercure, Panther
PDF
Official "push" and real-time capabilities for Symfony and API Platform (Merc...
PDF
Progressively enhance your Symfony 4 app using Vue, API Platform, Mercure and...
PDF
HTTP/2: speed up your apps and dispatch real time updates (Symfony and API Pl...
PDF
Panther: test your Symfony apps with real web browsers
PDF
Symfony 2 : Performances et Optimisations
PDF
Diaporama du sfPot Lillois du 20 mars 2014
PDF
Workshop HTML5 : référencement grâce à la sémantique
PDF
Atelier #3 intégration html
PDF
Atelier #2 initiation à css
PDF
Atelier initiation au html5
Symfony on steroids
: Vue.js, Mercure, Panther
Official "push" and real-time capabilities for Symfony and API Platform (Merc...
Progressively enhance your Symfony 4 app using Vue, API Platform, Mercure and...
HTTP/2: speed up your apps and dispatch real time updates (Symfony and API Pl...
Panther: test your Symfony apps with real web browsers
Symfony 2 : Performances et Optimisations
Diaporama du sfPot Lillois du 20 mars 2014
Workshop HTML5 : référencement grâce à la sémantique
Atelier #3 intégration html
Atelier #2 initiation à css
Atelier initiation au html5

Recently uploaded (20)

PPTX
CNN LeNet5 Architecture: Neural Networks
PDF
Designing Intelligence for the Shop Floor.pdf
PPTX
WiFi Honeypot Detecscfddssdffsedfseztor.pptx
PDF
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf
PDF
AI/ML Infra Meetup | LLM Agents and Implementation Challenges
PDF
Ableton Live Suite for MacOS Crack Full Download (Latest 2025)
PDF
DuckDuckGo Private Browser Premium APK for Android Crack Latest 2025
PDF
Visual explanation of Dijkstra's Algorithm using Python
PDF
Multiverse AI Review 2025: Access All TOP AI Model-Versions!
PPTX
Tech Workshop Escape Room Tech Workshop
PPTX
Advanced SystemCare Ultimate Crack + Portable (2025)
PPTX
"Secure File Sharing Solutions on AWS".pptx
PDF
Microsoft Office 365 Crack Download Free
PDF
How AI/LLM recommend to you ? GDG meetup 16 Aug by Fariman Guliev
PDF
Types of Token_ From Utility to Security.pdf
PPTX
Computer Software - Technology and Livelihood Education
PDF
MCP Security Tutorial - Beginner to Advanced
PDF
Topaz Photo AI Crack New Download (Latest 2025)
PDF
Cost to Outsource Software Development in 2025
DOCX
How to Use SharePoint as an ISO-Compliant Document Management System
CNN LeNet5 Architecture: Neural Networks
Designing Intelligence for the Shop Floor.pdf
WiFi Honeypot Detecscfddssdffsedfseztor.pptx
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf
AI/ML Infra Meetup | LLM Agents and Implementation Challenges
Ableton Live Suite for MacOS Crack Full Download (Latest 2025)
DuckDuckGo Private Browser Premium APK for Android Crack Latest 2025
Visual explanation of Dijkstra's Algorithm using Python
Multiverse AI Review 2025: Access All TOP AI Model-Versions!
Tech Workshop Escape Room Tech Workshop
Advanced SystemCare Ultimate Crack + Portable (2025)
"Secure File Sharing Solutions on AWS".pptx
Microsoft Office 365 Crack Download Free
How AI/LLM recommend to you ? GDG meetup 16 Aug by Fariman Guliev
Types of Token_ From Utility to Security.pdf
Computer Software - Technology and Livelihood Education
MCP Security Tutorial - Beginner to Advanced
Topaz Photo AI Crack New Download (Latest 2025)
Cost to Outsource Software Development in 2025
How to Use SharePoint as an ISO-Compliant Document Management System

API Platform and Symfony: a Framework for API-driven Projects