SlideShare a Scribd company logo
1 of 33
Download to read offline
by Jesus Manuel Olivas / octahedroid
Building a modern application using
Symfony API Platform and GatsbyJS
Jesus Manuel Olivas
jmolivas.com
@jmolivas
Agenda
Symfony API Platform
GraphQL
JAMstack
GatsbyJS
Web Development 101
Web Development 101
Traditional monolithic stack
Visitor Server
Database
Server render (traditional)
Server Client
SPA (client side)
Server Client
The Modern Stack (JAMstack)
Visitor CDN
JAMstack (pre-render markup)
Server ClientBuild Server
The API Platform Framework
REST and GraphQL
framework to build modern
API-driven projects
The API Platform Framework
https://github.com/api-platform/api-platform
The server skeleton includes the
Symfony microframework and
the Doctrine ORM. 
The API Platform Components
Build a fully-featured
hypermedia or GraphQL API
in minutes.
The API Components
api/config/packages/api_platform.yaml
API formats
formats:
jsonld: [‘application/ld+json'] # first one is the default
json: ['application/json']
jsonhal: ['application/hal+json']
xml: ['application/xml', 'text/xml']
yaml: ['application/x-yaml']
csv: ['text/csv']
html: ['text/html']
console make:entity
Add New Entity
use DoctrineORMMapping as ORM;
use RamseyUuidUuid;
use GedmoTimestampableTraitsTimestampableEntity;
class EntityBase
{
use TimestampableEntity;
/**
* @var string
* @ORMColumn(name="uuid", type="string")
!*/
protected $uuid;
public function getUuid()
{
return $this!->uuid;
}
YourEntity extends EntityBase 1/2
/**
* @GedmoTimestampable(on="create")
* @ORMColumn(type="datetime", nullable=true)
!*/
protected $createdAt;
/**
* @GedmoTimestampable(on="update")
* @ORMColumn(type="datetime", nullable=true)
!*/
protected $updatedAt;
public function !__construct()
{
$this!->uuid = Uuid!::uuid4()!->toString();
$this!->createdAt = new DateTime();
$this!->updatedAt = $this!->createdAt;
}
}
YourEntity extends EntityBase 2/2
console make:migration
console doctrine:migrations:migrate
Sync entities with DB
GraphQL is an open-source
data query and manipulation
language for APIs.
GraphQL
To enable GraphQL and GraphiQL interface
in your API, simply require
“webonyx/graphql-php”
package using composer
GraphQL
GraphQL demo
User Authentication
Allowing users to authenticate and identify
themselves, so that some or all of the page can
be personalized for them.
Examples include displaying a user's name and
avatar, or showing authorized users private
content.
Login using JWT
FOSUserBundle || Doctrine User Provider 
LexikJWTAuthenticationBundle
JWTRefreshTokenBundle
User Authentication
Use Doctrine ORM Filters
Register EventListeners for JWT & Auth
Use Serialization Groups (encode/decode)
Create custom GraphQL Queries or Mutations
Tips
GatsbyJS
Gatsby is a free and open source
framework based on React that
helps developers build blazing
fast  websites and apps
package.json
"dependencies": {
"gatsby": "^2.17.11",
"gatsby-source-graphql": "^2.1.28",
“react": "^16.11.0",
"react-dom": "^16.11.0"
},
gatsby-config.js
{
resolve: "gatsby-source-graphql",
options: {
typeName: "Symfony",
fieldName: "symfony",
url: `${process.env.SYMFONY_URL}/graphql`,
},
},
GatsbyJS
Gatsby demo
Centralize data with GraphQL
Easier to explore
Single source of truth
More scalable & team-friendly
Consistent, shareable dev workflow
Go Static for everything else
Blazing fast performance
Simpler deployment flow
Immutable deployments
Reduced DevOps overhead
Resources
https://api-platform.com/docs
https://symfonycasts.com/tracks/rest
https://www.gatsbyjs.org/docs/
Thank you.
Any Questions?

More Related Content

What's hot

SoCal Code Camp 2011 - ASP.NET MVC 4
SoCal Code Camp 2011 - ASP.NET MVC 4SoCal Code Camp 2011 - ASP.NET MVC 4
SoCal Code Camp 2011 - ASP.NET MVC 4
Jon Galloway
 

What's hot (20)

New Chargeback - Sergio Ocon - ManageIQ Design Summit 2016
New Chargeback - Sergio Ocon - ManageIQ Design Summit 2016New Chargeback - Sergio Ocon - ManageIQ Design Summit 2016
New Chargeback - Sergio Ocon - ManageIQ Design Summit 2016
 
JAMstack WTJ
JAMstack WTJJAMstack WTJ
JAMstack WTJ
 
Google App Engine Introduction
Google App Engine IntroductionGoogle App Engine Introduction
Google App Engine Introduction
 
Kubernetes - training micro-dragons without getting burnt
Kubernetes -  training micro-dragons without getting burntKubernetes -  training micro-dragons without getting burnt
Kubernetes - training micro-dragons without getting burnt
 
WebAPI::DBIC - Automated RESTful API's
WebAPI::DBIC - Automated RESTful API'sWebAPI::DBIC - Automated RESTful API's
WebAPI::DBIC - Automated RESTful API's
 
Camunda GraphQL Extension (09/2017 Berlin)
Camunda GraphQL Extension (09/2017 Berlin)Camunda GraphQL Extension (09/2017 Berlin)
Camunda GraphQL Extension (09/2017 Berlin)
 
What's new in Silverstripe 4? (StripeCon APAC 2016)
What's new in Silverstripe 4? (StripeCon APAC 2016)What's new in Silverstripe 4? (StripeCon APAC 2016)
What's new in Silverstripe 4? (StripeCon APAC 2016)
 
Blazing fast sites using Blaze, Hybrid CMS NYC
Blazing fast sites using Blaze, Hybrid CMS NYCBlazing fast sites using Blaze, Hybrid CMS NYC
Blazing fast sites using Blaze, Hybrid CMS NYC
 
Gatsby (Code.Talks) 2019
Gatsby (Code.Talks) 2019Gatsby (Code.Talks) 2019
Gatsby (Code.Talks) 2019
 
JAMStack
JAMStackJAMStack
JAMStack
 
Simpler Web Architectures Now! (At The Frontend 2016)
Simpler Web Architectures Now! (At The Frontend 2016)Simpler Web Architectures Now! (At The Frontend 2016)
Simpler Web Architectures Now! (At The Frontend 2016)
 
Mvc framework
Mvc frameworkMvc framework
Mvc framework
 
Why XAF and XPO?
Why XAF and XPO?Why XAF and XPO?
Why XAF and XPO?
 
How to ease the learning curve
How to ease the learning curveHow to ease the learning curve
How to ease the learning curve
 
VueJs Workshop
VueJs WorkshopVueJs Workshop
VueJs Workshop
 
A Simpler Web App Architecture (jDays 2016)
A Simpler Web App Architecture (jDays 2016)A Simpler Web App Architecture (jDays 2016)
A Simpler Web App Architecture (jDays 2016)
 
Magento Cloud - Introduction
Magento Cloud - IntroductionMagento Cloud - Introduction
Magento Cloud - Introduction
 
SoCal Code Camp 2011 - ASP.NET MVC 4
SoCal Code Camp 2011 - ASP.NET MVC 4SoCal Code Camp 2011 - ASP.NET MVC 4
SoCal Code Camp 2011 - ASP.NET MVC 4
 
How To Write Dynamic Migrations - Mohit Aghera
How To Write Dynamic Migrations - Mohit AgheraHow To Write Dynamic Migrations - Mohit Aghera
How To Write Dynamic Migrations - Mohit Aghera
 
Veda online
Veda onlineVeda online
Veda online
 

Similar to Building a modern application using Symfony API Platform and GatsbyJS PHP QRO

Python Ireland Nov 2009 Talk - Appengine
Python Ireland Nov 2009 Talk - AppenginePython Ireland Nov 2009 Talk - Appengine
Python Ireland Nov 2009 Talk - Appengine
Python Ireland
 

Similar to Building a modern application using Symfony API Platform and GatsbyJS PHP QRO (20)

Creating a modern web application using Symfony API Platform Atlanta
Creating a modern web application using  Symfony API Platform AtlantaCreating a modern web application using  Symfony API Platform Atlanta
Creating a modern web application using Symfony API Platform Atlanta
 
Choisir entre une API RPC, SOAP, REST, GraphQL? 
Et si le problème était ai...
Choisir entre une API  RPC, SOAP, REST, GraphQL?  
Et si le problème était ai...Choisir entre une API  RPC, SOAP, REST, GraphQL?  
Et si le problème était ai...
Choisir entre une API RPC, SOAP, REST, GraphQL? 
Et si le problème était ai...
 
Integrate any Angular Project into WebSphere Portal
Integrate any Angular Project into WebSphere PortalIntegrate any Angular Project into WebSphere Portal
Integrate any Angular Project into WebSphere Portal
 
Creating a modern web application using Symfony API Platform, ReactJS and Red...
Creating a modern web application using Symfony API Platform, ReactJS and Red...Creating a modern web application using Symfony API Platform, ReactJS and Red...
Creating a modern web application using Symfony API Platform, ReactJS and Red...
 
Alfresco Development Framework Basic
Alfresco Development Framework BasicAlfresco Development Framework Basic
Alfresco Development Framework Basic
 
SymfonyCon Berlin 2016 - Symfony Plugin for PhpStorm - 3 years later
SymfonyCon Berlin 2016 - Symfony Plugin for PhpStorm - 3 years laterSymfonyCon Berlin 2016 - Symfony Plugin for PhpStorm - 3 years later
SymfonyCon Berlin 2016 - Symfony Plugin for PhpStorm - 3 years later
 
Serverless Beyond Functions - CTO Club Made in JLM
Serverless Beyond Functions - CTO Club Made in JLMServerless Beyond Functions - CTO Club Made in JLM
Serverless Beyond Functions - CTO Club Made in JLM
 
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)
 
Serverless Application Development with SAM
Serverless Application Development with SAMServerless Application Development with SAM
Serverless Application Development with SAM
 
High quality ap is with api platform
High quality ap is with api platformHigh quality ap is with api platform
High quality ap is with api platform
 
Application Lifecycle Management in a Serverless World
Application Lifecycle Management in a Serverless WorldApplication Lifecycle Management in a Serverless World
Application Lifecycle Management in a Serverless World
 
Deep Dive on Serverless Stack
Deep Dive on Serverless StackDeep Dive on Serverless Stack
Deep Dive on Serverless Stack
 
Your API on Steroids - Retrofitting GraphQL by Code, Cloud Native or Serverless
Your API on Steroids - Retrofitting GraphQL by Code, Cloud Native or ServerlessYour API on Steroids - Retrofitting GraphQL by Code, Cloud Native or Serverless
Your API on Steroids - Retrofitting GraphQL by Code, Cloud Native or Serverless
 
Graphql usage
Graphql usageGraphql usage
Graphql usage
 
Serverless Development Deep Dive
Serverless Development Deep DiveServerless Development Deep Dive
Serverless Development Deep Dive
 
Going FaaSter, Functions as a Service at Netflix
Going FaaSter, Functions as a Service at NetflixGoing FaaSter, Functions as a Service at Netflix
Going FaaSter, Functions as a Service at Netflix
 
Building Serverless Applications with AWS Chalice
Building Serverless Applications with AWS ChaliceBuilding Serverless Applications with AWS Chalice
Building Serverless Applications with AWS Chalice
 
Devops on serverless
Devops on serverlessDevops on serverless
Devops on serverless
 
Python Ireland Nov 2009 Talk - Appengine
Python Ireland Nov 2009 Talk - AppenginePython Ireland Nov 2009 Talk - Appengine
Python Ireland Nov 2009 Talk - Appengine
 
StrongLoop Overview
StrongLoop OverviewStrongLoop Overview
StrongLoop Overview
 

More from Jesus Manuel Olivas

More from Jesus Manuel Olivas (19)

Remix & GraphQL: A match made in heaven with type-safety DX
Remix & GraphQL:  A match made in heaven with type-safety DXRemix & GraphQL:  A match made in heaven with type-safety DX
Remix & GraphQL: A match made in heaven with type-safety DX
 
Drupal 10 Party GraphQL
Drupal 10 Party GraphQLDrupal 10 Party GraphQL
Drupal 10 Party GraphQL
 
How to use Drupal to create editorial experiences your content creators will...
How to use Drupal  to create editorial experiences your content creators will...How to use Drupal  to create editorial experiences your content creators will...
How to use Drupal to create editorial experiences your content creators will...
 
Beyond Static: Building a Dynamic Application with Gatsby
Beyond Static: Building a Dynamic Application with GatsbyBeyond Static: Building a Dynamic Application with Gatsby
Beyond Static: Building a Dynamic Application with Gatsby
 
Embracing the modern web using a Headless CMS with GatsbyJS Stanford
Embracing the modern web using a Headless CMS with GatsbyJS StanfordEmbracing the modern web using a Headless CMS with GatsbyJS Stanford
Embracing the modern web using a Headless CMS with GatsbyJS Stanford
 
Building a dynamic application with GatsbyJS-Tec-Mexicali
Building a dynamic application  with GatsbyJS-Tec-MexicaliBuilding a dynamic application  with GatsbyJS-Tec-Mexicali
Building a dynamic application with GatsbyJS-Tec-Mexicali
 
Building a modern web application in the cloud partnercon
Building a modern web application in the cloud partnerconBuilding a modern web application in the cloud partnercon
Building a modern web application in the cloud partnercon
 
Embracing the modern web using Drupal as a Headless CMS with Gatsby BADCamp
Embracing the modern web using Drupal as a Headless CMS with Gatsby BADCampEmbracing the modern web using Drupal as a Headless CMS with Gatsby BADCamp
Embracing the modern web using Drupal as a Headless CMS with Gatsby BADCamp
 
Embracing the modern web using Drupal as Headless CMS with GatsbyJS NYC
Embracing the modern web using Drupal as Headless CMS with GatsbyJS NYCEmbracing the modern web using Drupal as Headless CMS with GatsbyJS NYC
Embracing the modern web using Drupal as Headless CMS with GatsbyJS NYC
 
Writing a slack chatbot seattle
Writing a slack chatbot seattleWriting a slack chatbot seattle
Writing a slack chatbot seattle
 
Building a Modern Web Application in the Cloud TecNerd
Building a Modern Web Application in the Cloud TecNerdBuilding a Modern Web Application in the Cloud TecNerd
Building a Modern Web Application in the Cloud TecNerd
 
How to keep Drupal relevant in the Git-based and API-driven CMS era Florida
How to keep Drupal relevant in the Git-based and API-driven CMS era FloridaHow to keep Drupal relevant in the Git-based and API-driven CMS era Florida
How to keep Drupal relevant in the Git-based and API-driven CMS era Florida
 
How to keep Drupal relevant in the Git-based and API-driven CMS era DrupalCampNJ
How to keep Drupal relevant in the Git-based and API-driven CMS era DrupalCampNJHow to keep Drupal relevant in the Git-based and API-driven CMS era DrupalCampNJ
How to keep Drupal relevant in the Git-based and API-driven CMS era DrupalCampNJ
 
Tools and Projects Dec 2018 Edition
Tools and Projects Dec 2018 EditionTools and Projects Dec 2018 Edition
Tools and Projects Dec 2018 Edition
 
How to keep Drupal relevant in the Git-based and API-driven CMS era - BADCamp
How to keep Drupal relevant in the Git-based and API-driven CMS era - BADCampHow to keep Drupal relevant in the Git-based and API-driven CMS era - BADCamp
How to keep Drupal relevant in the Git-based and API-driven CMS era - BADCamp
 
Battle of the CMS DrupalCampLA
Battle of the CMS DrupalCampLABattle of the CMS DrupalCampLA
Battle of the CMS DrupalCampLA
 
Writing a slack chatbot DrupalCampLA
Writing a slack chatbot DrupalCampLAWriting a slack chatbot DrupalCampLA
Writing a slack chatbot DrupalCampLA
 
Improving your Drupal 8 development workflow DrupalCampLA
Improving your Drupal 8 development workflow DrupalCampLAImproving your Drupal 8 development workflow DrupalCampLA
Improving your Drupal 8 development workflow DrupalCampLA
 
Writing a slack chatbot mxlos
Writing a slack chatbot mxlosWriting a slack chatbot mxlos
Writing a slack chatbot mxlos
 

Recently uploaded

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
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Recently uploaded (20)

Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
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
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
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
 
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
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
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
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
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
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
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, ...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
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...
 
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 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 

Building a modern application using Symfony API Platform and GatsbyJS PHP QRO