SlideShare a Scribd company logo
1 of 55
Download to read offline
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
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!
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)
symfonycon.les-tilleuls.coop @dunglas
Install API Platform
symfonycon.les-tilleuls.coop @dunglas
Tweaking the API
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
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

What's hot

Audioproject
AudioprojectAudioproject
Audioproject
buntfu
 

What's hot (20)

Symfony 4: A new way to develop applications #phpsrb
 Symfony 4: A new way to develop applications #phpsrb Symfony 4: A new way to develop applications #phpsrb
Symfony 4: A new way to develop applications #phpsrb
 
Meteor presentation
Meteor presentationMeteor presentation
Meteor presentation
 
Java and other open source solutions on windows azure
Java and other open source solutions on windows azureJava and other open source solutions on windows azure
Java and other open source solutions on windows azure
 
iOS Parallel Automation - Viktar Karanevich - Mobile Test Automation Meetup (...
iOS Parallel Automation - Viktar Karanevich - Mobile Test Automation Meetup (...iOS Parallel Automation - Viktar Karanevich - Mobile Test Automation Meetup (...
iOS Parallel Automation - Viktar Karanevich - Mobile Test Automation Meetup (...
 
Docker on Windows and Linux - Red Shirt Dev Tour
Docker on Windows and Linux - Red Shirt Dev TourDocker on Windows and Linux - Red Shirt Dev Tour
Docker on Windows and Linux - Red Shirt Dev Tour
 
GreenButton-201502
GreenButton-201502GreenButton-201502
GreenButton-201502
 
Neos 101 [Inspiring Con 2014]
Neos 101 [Inspiring Con 2014]Neos 101 [Inspiring Con 2014]
Neos 101 [Inspiring Con 2014]
 
Cloud+Data Next: Mashing Linux and Windows Containers
Cloud+Data Next: Mashing Linux and Windows ContainersCloud+Data Next: Mashing Linux and Windows Containers
Cloud+Data Next: Mashing Linux and Windows Containers
 
IDI 2020 - Containers Meet Serverless
IDI 2020 - Containers Meet ServerlessIDI 2020 - Containers Meet Serverless
IDI 2020 - Containers Meet Serverless
 
Ops for NoOps - Operational Challenges for Serverless Apps
Ops for NoOps - Operational Challenges for Serverless AppsOps for NoOps - Operational Challenges for Serverless Apps
Ops for NoOps - Operational Challenges for Serverless Apps
 
Get that Corner Office with Angular 2 and Electron
Get that Corner Office with Angular 2 and ElectronGet that Corner Office with Angular 2 and Electron
Get that Corner Office with Angular 2 and Electron
 
Going Serverless: The Best Ops is NoOps.
Going Serverless: The Best Ops is NoOps.Going Serverless: The Best Ops is NoOps.
Going Serverless: The Best Ops is NoOps.
 
Packer, Terraform, Ansible avec Azure
Packer, Terraform, Ansible avec AzurePacker, Terraform, Ansible avec Azure
Packer, Terraform, Ansible avec Azure
 
Audioproject
AudioprojectAudioproject
Audioproject
 
AWS Connect 2017 - Container (feat. AWS)
AWS Connect 2017 -  Container (feat. AWS)AWS Connect 2017 -  Container (feat. AWS)
AWS Connect 2017 - Container (feat. AWS)
 
15 ways-to-optimize-spring-boot-for-the-cloud
15 ways-to-optimize-spring-boot-for-the-cloud15 ways-to-optimize-spring-boot-for-the-cloud
15 ways-to-optimize-spring-boot-for-the-cloud
 
Ansible, PHP and EC2
Ansible, PHP and EC2Ansible, PHP and EC2
Ansible, PHP and EC2
 
Building a PaaS at HubSpot
Building a PaaS at HubSpotBuilding a PaaS at HubSpot
Building a PaaS at HubSpot
 
15-ways-to-optimize-spring-boot-for-the-cloud
15-ways-to-optimize-spring-boot-for-the-cloud15-ways-to-optimize-spring-boot-for-the-cloud
15-ways-to-optimize-spring-boot-for-the-cloud
 
Symfony with vagrant and ansible
Symfony with vagrant and ansibleSymfony with vagrant and ansible
Symfony with vagrant and ansible
 

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

symfony: An Open-Source Framework for Professionals (PHP Day 2008)
symfony: An Open-Source Framework for Professionals (PHP Day 2008)symfony: An Open-Source Framework for Professionals (PHP Day 2008)
symfony: An Open-Source Framework for Professionals (PHP Day 2008)
Fabien Potencier
 
Symfony2 San Francisco Meetup 2009
Symfony2 San Francisco Meetup 2009Symfony2 San Francisco Meetup 2009
Symfony2 San Francisco Meetup 2009
Fabien Potencier
 
Symfony Components 2.0 on PHP 5.3
Symfony Components 2.0 on PHP 5.3Symfony Components 2.0 on PHP 5.3
Symfony Components 2.0 on PHP 5.3
Fabien Potencier
 
Write Plugins for symfony (Symfony Camp 2007)
Write Plugins for symfony (Symfony Camp 2007)Write Plugins for symfony (Symfony Camp 2007)
Write Plugins for symfony (Symfony Camp 2007)
Fabien Potencier
 

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

Symfony4 - Deep dive
Symfony4 - Deep diveSymfony4 - Deep dive
Symfony4 - Deep dive
 
Fabien Potencier "Symfony 4 in action"
Fabien Potencier "Symfony 4 in action"Fabien Potencier "Symfony 4 in action"
Fabien Potencier "Symfony 4 in action"
 
Nice performance using Sf2 cache wrapping Sf1 application
Nice performance using Sf2 cache wrapping Sf1 applicationNice performance using Sf2 cache wrapping Sf1 application
Nice performance using Sf2 cache wrapping Sf1 application
 
Sf sf v5
Sf sf v5Sf sf v5
Sf sf v5
 
Nice performance using Sf2 cache wrapping Sf1 application - Paris
Nice performance using Sf2 cache wrapping Sf1 application - ParisNice performance using Sf2 cache wrapping Sf1 application - Paris
Nice performance using Sf2 cache wrapping Sf1 application - Paris
 
Merging two big Symfony based applications - SymfonyCon 2017
Merging two big Symfony based applications - SymfonyCon 2017Merging two big Symfony based applications - SymfonyCon 2017
Merging two big Symfony based applications - SymfonyCon 2017
 
Migration of a legacy project to Symfony
Migration of a legacy project to SymfonyMigration of a legacy project to Symfony
Migration of a legacy project to Symfony
 
Magento Meetup New Delhi- Console
Magento Meetup New Delhi- ConsoleMagento Meetup New Delhi- Console
Magento Meetup New Delhi- Console
 
Symfony 2.0 on PHP 5.3
Symfony 2.0 on PHP 5.3Symfony 2.0 on PHP 5.3
Symfony 2.0 on PHP 5.3
 
Hands-on with the Symfony2 Framework
Hands-on with the Symfony2 FrameworkHands-on with the Symfony2 Framework
Hands-on with the Symfony2 Framework
 
symfony: An Open-Source Framework for Professionals (PHP Day 2008)
symfony: An Open-Source Framework for Professionals (PHP Day 2008)symfony: An Open-Source Framework for Professionals (PHP Day 2008)
symfony: An Open-Source Framework for Professionals (PHP Day 2008)
 
ITB2019 CommandBox vs Node.js - Nolan Erck
ITB2019  CommandBox vs Node.js - Nolan ErckITB2019  CommandBox vs Node.js - Nolan Erck
ITB2019 CommandBox vs Node.js - Nolan Erck
 
Symfony2 San Francisco Meetup 2009
Symfony2 San Francisco Meetup 2009Symfony2 San Francisco Meetup 2009
Symfony2 San Francisco Meetup 2009
 
Symfony Components 2.0 on PHP 5.3
Symfony Components 2.0 on PHP 5.3Symfony Components 2.0 on PHP 5.3
Symfony Components 2.0 on PHP 5.3
 
Building a full-stack app with Golang and Google Cloud Platform in one week
Building a full-stack app with Golang and Google Cloud Platform in one weekBuilding a full-stack app with Golang and Google Cloud Platform in one week
Building a full-stack app with Golang and Google Cloud Platform in one week
 
Write Plugins for symfony (Symfony Camp 2007)
Write Plugins for symfony (Symfony Camp 2007)Write Plugins for symfony (Symfony Camp 2007)
Write Plugins for symfony (Symfony Camp 2007)
 
Hybrid Apps in a Snap
Hybrid Apps in a SnapHybrid Apps in a Snap
Hybrid Apps in a Snap
 
How Symfony changed my life (#SfPot, Paris, 19th November 2015)
How Symfony changed my life (#SfPot, Paris, 19th November 2015)How Symfony changed my life (#SfPot, Paris, 19th November 2015)
How Symfony changed my life (#SfPot, Paris, 19th November 2015)
 
Building Eclipse Plugins with Tycho
Building Eclipse Plugins with TychoBuilding Eclipse Plugins with Tycho
Building Eclipse Plugins with Tycho
 
How Symfony Changed My Life
How Symfony Changed My LifeHow Symfony Changed My Life
How Symfony Changed My Life
 

More from Les-Tilleuls.coop

More from Les-Tilleuls.coop (10)

API Platform and Symfony: a Framework for API-driven Projects
API Platform and Symfony: a Framework for API-driven ProjectsAPI Platform and Symfony: a Framework for API-driven Projects
API Platform and Symfony: a Framework for API-driven Projects
 
API Platform: Full Stack Framework Resurrection
API Platform: Full Stack Framework ResurrectionAPI Platform: Full Stack Framework Resurrection
API Platform: Full Stack Framework Resurrection
 
API Platform 2.1: when Symfony meets ReactJS (Symfony Live 2017)
API Platform 2.1: when Symfony meets ReactJS (Symfony Live 2017)API Platform 2.1: when Symfony meets ReactJS (Symfony Live 2017)
API Platform 2.1: when Symfony meets ReactJS (Symfony Live 2017)
 
Creating hypermedia APIs in a few minutes using the API Platform framework
Creating hypermedia APIs in a few minutes using the API Platform frameworkCreating hypermedia APIs in a few minutes using the API Platform framework
Creating hypermedia APIs in a few minutes using the API Platform framework
 
Symfony 2 : Performances et Optimisations
Symfony 2 : Performances et OptimisationsSymfony 2 : Performances et Optimisations
Symfony 2 : Performances et Optimisations
 
Diaporama du sfPot Lillois du 20 mars 2014
Diaporama du sfPot Lillois du 20 mars 2014Diaporama du sfPot Lillois du 20 mars 2014
Diaporama du sfPot Lillois du 20 mars 2014
 
Workshop HTML5 : référencement grâce à la sémantique
Workshop HTML5 : référencement grâce à la sémantiqueWorkshop HTML5 : référencement grâce à la sémantique
Workshop HTML5 : référencement grâce à la sémantique
 
Atelier #3 intégration html
Atelier #3 intégration htmlAtelier #3 intégration html
Atelier #3 intégration html
 
Atelier #2 initiation à css
Atelier #2 initiation à cssAtelier #2 initiation à css
Atelier #2 initiation à css
 
Atelier initiation au html5
Atelier initiation au html5Atelier initiation au html5
Atelier initiation au html5
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 

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