SlideShare a Scribd company logo
Progressively enhance
your Symfony 4 app
symfonycon.les-tilleuls.coop @dunglas
Kévin Dunglas
❏ Les-Tilleuls.coop’s Founder
❏ Symfony Core Team

Panther, Serializer, WebLink, PropertyInfo, autowiring…
❏ API Platform and Mercure creator
@dunglas
symfonycon.les-tilleuls.coop @dunglas
✍ Self-managed since 2011
35 people, 1,000% in 6 years
👷 ➡ jobs@les-tilleuls.coop
symfonycon.les-tilleuls.coop @dunglas
symfonycon.les-tilleuls.coop @dunglas
Agenda
A joind.in clone in 40 minutes?
1. A modern Symfony app (MakerBundle, Doctrine)
2. Integrating Vue.js (Encore, API Platform)
3. UI Testing (Panther)
4. Real time update (Mercure)
symfonycon.les-tilleuls.coop
Our final app: try it now!
symfonycon.les-tilleuls.coop @dunglas
MakerBundle FTW!
A modern Symfony app
symfonycon.les-tilleuls.coop @dunglas
Install the Website Skeleton
Symfony full stack (SF + Twig + Doctrine)
symfonycon.les-tilleuls.coop @dunglas
MakerBundle
❏ Code scaffolding
❏ Entities
❏ Controllers
❏ Forms and CRUD
❏ Users and security (auth, voter)
❏ Tests
❏ Commands
Progressively enhance your Symfony 4 app using Vue, API Platform, Mercure and Panther
symfonycon.les-tilleuls.coop @dunglas
Updating the DB, creating a controller
symfonycon.les-tilleuls.coop @dunglas
The controller
symfonycon.les-tilleuls.coop @dunglas
Twig template: a partial
Twig templates
symfonycon.les-tilleuls.coop @dunglas
Our basic website is ready, thanks MakerBundle!
Progressively enhance your Symfony 4 app using Vue, API Platform, Mercure and Panther
symfonycon.les-tilleuls.coop @dunglas
A better UX thanks to Encore and API Platform
Integrating Vue.js
symfonycon.les-tilleuls.coop @dunglas
A modern feedback system
❏ Rate a talk, using a star based selector
❏ Post a comment
❏ No page reload, rich form, no form component
❏ Server-side: hypermedia API
❏ Client-side: web component (in JS)
Progressively enhance your Symfony 4 app using Vue, API Platform, Mercure and Panther
symfonycon.les-tilleuls.coop @dunglas
Install API Platform
Progressively enhance your Symfony 4 app using Vue, API Platform, Mercure and Panther
symfonycon.les-tilleuls.coop @dunglas
Tweaking the API
Progressively enhance your Symfony 4 app using Vue, API Platform, Mercure and Panther
symfonycon.les-tilleuls.coop @dunglas
Vue.js
❏ Progressive framework for building interfaces
❏ Designed to be incrementally adoptable
❏ Focused on the view layer
❏ Can also power Single-Page Applications
symfonycon.les-tilleuls.coop @dunglas
Install Symfony Encore
symfonycon.les-tilleuls.coop @dunglasJoke stolen from @iamdevloper
You just installed 600+ packages,

welcome to the JS world 😉
symfonycon.les-tilleuls.coop @dunglas
Enable Vue, register our component
symfonycon.les-tilleuls.coop @dunglas
symfonycon.les-tilleuls.coop @dunglas
A Vue component
notation :

notation @

v-model
The View
The ViewModel
symfonycon.les-tilleuls.coop @dunglas
Loading the Vue component in Twig
Progressively enhance your Symfony 4 app using Vue, API Platform, Mercure and Panther
symfonycon.les-tilleuls.coop @dunglas
Panther: the new feline on the block
😺end-2-end testing
symfonycon.les-tilleuls.coop @dunglas
symfonycon.les-tilleuls.coop @dunglas
Symfony Panther: an E2E testing tool
❏ Executes real web browsers (Chrome by default)
❏ Supports JavaScript, CSS, DOM…
❏ Uses the W3C WebDriver Protocol
❏ Implements the APIs of
❏ Symfony BrowserKit (you already know it!)
❏ Facebook’s PHP WebDriver
❏ Provide some extra methods:
❏ wait, execute JS, screenshot, click…
❏ Standalone lib, for testing and web scraping
symfonycon.les-tilleuls.coop @dunglas
Symfony Panther: developer-friendly
❏ Nothing to install (except Panther)
❏ Nothing to configure
❏ neither Selenium,
❏ nor a web server
❏ Panther just works!
symfonycon.les-tilleuls.coop @dunglas
Populating the database with Alice Fixtures
symfonycon.les-tilleuls.coop @dunglas
The Panther test
symfonycon.les-tilleuls.coop @dunglas
The JavaScript is executed!
symfonycon.les-tilleuls.coop @dunglas
As well as HTTP requests, you can even take screenshots!
symfonycon.les-tilleuls.coop @dunglas
The screenshot 📸, by Panther
symfonycon.les-tilleuls.coop @dunglas
Introducing the Mercure protocol
Real Time
symfonycon.les-tilleuls.coop
symfonycon.les-tilleuls.coop @dunglas
symfonycon.les-tilleuls.coop @dunglas
symfonycon.les-tilleuls.coop @dunglas
Installing MercureBundle
symfonycon.les-tilleuls.coop @dunglas
The API
symfonycon.les-tilleuls.coop @dunglas
symfonycon.les-tilleuls.coop @dunglas
The ViewModel
Subscribing to real time events
symfonycon.les-tilleuls.coop @dunglas
The missing parts
❏ Validation
❏ automated in 4.3? symfony/symfony#27735
❏ User and authentication
❏ make:user, make:auth (no FOSUserBundle please!)
❏ API Platform access control
❏ Deployment
❏ SymfonyCloud: symfony deploy 😻
❏ Managed Mercure.rocks (alpha)
symfonycon.les-tilleuls.coop @dunglas
One step further
❏ Admin SPA, for free
❏ api-platform.com/docs/admin
❏ Vue or React SPA, or native app, for free
❏ api-platform.com/docs/client-generator/vuejs/
We can help you!
symfonycon.les-tilleuls.coop @dunglas
Thanks! Any question?

More Related Content

PDF
Panther: test your Symfony apps with real web browsers
PDF
Symfony on steroids
: Vue.js, Mercure, Panther
PDF
Official "push" and real-time capabilities for Symfony and API Platform (Merc...
PDF
HTTP/2: speed up your apps and dispatch real time updates (Symfony and API Pl...
PDF
API Platform: A Framework for API-driven Projects
PDF
Better UX using Meteor and Famo.us
PPTX
#SDD2017 - Modernizing .NET Apps with Docker
PDF
Symfony 4: A new way to develop applications #phpsrb
Panther: test your Symfony apps with real web browsers
Symfony on steroids
: Vue.js, Mercure, Panther
Official "push" and real-time capabilities for Symfony and API Platform (Merc...
HTTP/2: speed up your apps and dispatch real time updates (Symfony and API Pl...
API Platform: A Framework for API-driven Projects
Better UX using Meteor and Famo.us
#SDD2017 - Modernizing .NET Apps with Docker
Symfony 4: A new way to develop applications #phpsrb

What's hot (19)

PDF
Meteor presentation
PPTX
Java and other open source solutions on windows azure
PDF
iOS Parallel Automation - Viktar Karanevich - Mobile Test Automation Meetup (...
PPTX
Docker on Windows and Linux - Red Shirt Dev Tour
PDF
GreenButton-201502
PDF
Neos 101 [Inspiring Con 2014]
PPTX
Cloud+Data Next: Mashing Linux and Windows Containers
PDF
IDI 2020 - Containers Meet Serverless
PDF
Ops for NoOps - Operational Challenges for Serverless Apps
PDF
Get that Corner Office with Angular 2 and Electron
PDF
Going Serverless: The Best Ops is NoOps.
PPTX
Packer, Terraform, Ansible avec Azure
PPT
Audioproject
PDF
AWS Connect 2017 - Container (feat. AWS)
PPTX
15 ways-to-optimize-spring-boot-for-the-cloud
PDF
Ansible, PHP and EC2
PDF
Building a PaaS at HubSpot
PPTX
15-ways-to-optimize-spring-boot-for-the-cloud
PDF
Symfony with vagrant and ansible
Meteor presentation
Java and other open source solutions on windows azure
iOS Parallel Automation - Viktar Karanevich - Mobile Test Automation Meetup (...
Docker on Windows and Linux - Red Shirt Dev Tour
GreenButton-201502
Neos 101 [Inspiring Con 2014]
Cloud+Data Next: Mashing Linux and Windows Containers
IDI 2020 - Containers Meet Serverless
Ops for NoOps - Operational Challenges for Serverless Apps
Get that Corner Office with Angular 2 and Electron
Going Serverless: The Best Ops is NoOps.
Packer, Terraform, Ansible avec Azure
Audioproject
AWS Connect 2017 - Container (feat. AWS)
15 ways-to-optimize-spring-boot-for-the-cloud
Ansible, PHP and EC2
Building a PaaS at HubSpot
15-ways-to-optimize-spring-boot-for-the-cloud
Symfony with vagrant and ansible
Ad

Similar to Progressively enhance your Symfony 4 app using Vue, API Platform, Mercure and Panther (20)

PDF
Symfony 4 Workshop - Limenius
PDF
Symfony War Stories
PDF
Modularity problems
PDF
Symfony2 San Francisco Meetup 2009
PDF
Symfony4 - Deep dive
PDF
How Symfony changed my life (#SfPot, Paris, 19th November 2015)
PDF
Symfony and eZ Publish
PDF
How Symfony Changed My Life
PDF
Creating a modern web application using Symfony API Platform, ReactJS and Red...
PDF
Symfony 4: A new way to develop applications #ipc19
PDF
API Platform: Full Stack Framework Resurrection
PDF
Building APIs in an easy way using API Platform
PDF
eZPublish meets Simfony2 - phpDay2013
PDF
Symfony tips and tricks
PPTX
Speed up your developments with Symfony2
PDF
Symfony demonstration
PDF
symfony_from_scratch
PDF
symfony_from_scratch
PDF
Symfony 2.0 on PHP 5.3
Symfony 4 Workshop - Limenius
Symfony War Stories
Modularity problems
Symfony2 San Francisco Meetup 2009
Symfony4 - Deep dive
How Symfony changed my life (#SfPot, Paris, 19th November 2015)
Symfony and eZ Publish
How Symfony Changed My Life
Creating a modern web application using Symfony API Platform, ReactJS and Red...
Symfony 4: A new way to develop applications #ipc19
API Platform: Full Stack Framework Resurrection
Building APIs in an easy way using API Platform
eZPublish meets Simfony2 - phpDay2013
Symfony tips and tricks
Speed up your developments with Symfony2
Symfony demonstration
symfony_from_scratch
symfony_from_scratch
Symfony 2.0 on PHP 5.3
Ad

More from Les-Tilleuls.coop (9)

PDF
API Platform and Symfony: a Framework for API-driven Projects
PDF
API Platform 2.1: when Symfony meets ReactJS (Symfony Live 2017)
PPTX
Creating hypermedia APIs in a few minutes using the API Platform framework
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
API Platform and Symfony: a Framework for API-driven Projects
API Platform 2.1: when Symfony meets ReactJS (Symfony Live 2017)
Creating hypermedia APIs in a few minutes using the API Platform framework
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)

PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Encapsulation theory and applications.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
Big Data Technologies - Introduction.pptx
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Cloud computing and distributed systems.
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
cuic standard and advanced reporting.pdf
PDF
Electronic commerce courselecture one. Pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
Encapsulation theory and applications.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Big Data Technologies - Introduction.pptx
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Mobile App Security Testing_ A Comprehensive Guide.pdf
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Digital-Transformation-Roadmap-for-Companies.pptx
Encapsulation_ Review paper, used for researhc scholars
Cloud computing and distributed systems.
Building Integrated photovoltaic BIPV_UPV.pdf
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Understanding_Digital_Forensics_Presentation.pptx
cuic standard and advanced reporting.pdf
Electronic commerce courselecture one. Pdf
Empathic Computing: Creating Shared Understanding
Per capita expenditure prediction using model stacking based on satellite ima...

Progressively enhance your Symfony 4 app using Vue, API Platform, Mercure and Panther