SlideShare una empresa de Scribd logo
1 de 24
Descargar para leer sin conexión
1
Building Client Side
Web Applications with
WordPress and WP-API
Roy Sivan Twitter/Github - @royboy789 roysivan.com | arcctrl.com
I really don’t like
Windows
There will be code
There will be learning
There will be cats
Be Warned
WordPress developer at
Disney
and the co-founder of
My first install of WordPress was
0.7 and been a user &
developer since
Roy Sivan Twitter/Github - @royboy789 roysivan.com | arcctrl.com
Who is this geek?
Why build Web Applications
with WordPress?
Why not?
HOW?
Single Page Web
Application
S.P.A
Not all client side apps
need to be full S.P.A’s.
Client Side?
Client = Browser
POP QUIZ
What is the fastest file a web server
can serve?
CLIENT VS. SERVER SIDE - REQUESTS AND RESPONSE
One request to rule them all
“I want my blog posts”
SERVER CLIENT
PHP is the language behind WordPress
SERVERCLIENT
Client: Sends request for template
Server: Processes PHP code turning it into HTML.
Returns full HTML
Benefits of Loading Client Side
Less load on the server
CDN all template files
Easier to cache JS and HTML
VERY Scalable
AJAX - can transform your UI / UX
Code Example: Server Side Loop
<?php
//list all posts - this is PHP & HTML
while ( have_posts() ) : the_post();
?>
<article class="postWrapper">
<h3 class="page_title text-center">
<a href=“<?php the_permalink(); ?>” class="content">
<?php the_title(); ?>
</a>
</h3>
<?php the_content(); ?>
</article>
<?php
endwhile;
?>
Living on the client side
Code Example: Client Side Loop
(using AngularJS)
//list all posts - this is HTML
<article class="postWrapper" ng-repeat="post in posts” >
<h3 class="page_title text-center">
<a href=“/coh/#/post/{{post.ID}}” class="content">
{{post.title}}
</a>
</h3>
{{post.content}}
</article>
AngularJS - the important bits
<?php the_title(); ?>
PHP AngularJS HTML Template
{{post.title}}
<?php the_content(); ?> {{post.title}}
<?php the_permalink(); ?> {{post.link}}
WP-API Response Example
/posts - WP-API endpoint
{
ID: 1
content: '<p>Welcome to WordPress. This is your first post. Edit or
delete it, then start blogging!</p>',
title: 'Hello world!',
status: 'publish',
author : {..},
...
},
…
ASK NOT HOW, but WHY?
Case Study: Client
Client
WordPress for:
Users

User Authentication

Custom Post Types

Data Storage
WP-API / S.P.A for:
DOM Memory

User Profiles

Inline Commenting

Inline Bookmarks
Case Study: CodeCavalry
CodeCavalry.com
WordPress for:
Users

User Authentication

Custom Post Types

Data Storage
S.P.A for:
Session (CPT) Create

Firebase - WebSocket

User Dashboard

User Profiles
Awesome Resources
Roy Sivan Twitter/Github - @royboy789 roysivan.com | arcctrl.com
WP-API on GitHub
https://github.com/WP-API/WP-API
CodeCavalry
http://www.codecavalry.com
AngularJS WP Theme
http://www.roysivan.com/angular-wordpress-theme
AngularJS For WP Plugin
http://www.roysivan.com/angularjs-for-wordpress
Community Built WP App with AngularJS & Slides
http://www.roysivan.com/blog
Thank You
Find me online:
Twitter: @royboy789
Github: @royboy789
CodeCavalry.com/royboy789
Roy Sivan Twitter/Github - @royboy789 roysivan.com | arcctrl.com

Más contenido relacionado

La actualidad más candente

Phonegap Day 2016: Ember/JS & Hybrid Apps Tips
Phonegap Day 2016: Ember/JS & Hybrid Apps TipsPhonegap Day 2016: Ember/JS & Hybrid Apps Tips
Phonegap Day 2016: Ember/JS & Hybrid Apps TipsAlex Blom
 
Why Would A Programmer Fall In Love With SPA?
Why Would A Programmer Fall In Love With SPA?Why Would A Programmer Fall In Love With SPA?
Why Would A Programmer Fall In Love With SPA?Netguru
 
Using CI for continuous delivery Part 2
Using CI for continuous delivery Part 2Using CI for continuous delivery Part 2
Using CI for continuous delivery Part 2Vishal Biyani
 
Java spring mysql without hibernate(2) (1)
Java spring mysql without hibernate(2) (1)Java spring mysql without hibernate(2) (1)
Java spring mysql without hibernate(2) (1)AmedJacobReza
 
Ionic CLI Adventures
Ionic CLI AdventuresIonic CLI Adventures
Ionic CLI AdventuresJuarez Filho
 
WP REST API - Building a simple Web Application
WP REST API - Building a simple Web ApplicationWP REST API - Building a simple Web Application
WP REST API - Building a simple Web ApplicationEdmund Chan
 
Step by Step Guide on Lazy Loading in Angular 11
Step by Step Guide on Lazy Loading in Angular 11Step by Step Guide on Lazy Loading in Angular 11
Step by Step Guide on Lazy Loading in Angular 11Katy Slemon
 
Behavior Driven Development with Cucumber
Behavior Driven Development with CucumberBehavior Driven Development with Cucumber
Behavior Driven Development with CucumberBrandon Keepers
 
Introduction to VueJS & The WordPress REST API
Introduction to VueJS & The WordPress REST APIIntroduction to VueJS & The WordPress REST API
Introduction to VueJS & The WordPress REST APICaldera Labs
 
Introduction to WordPress REST API
Introduction to WordPress REST APIIntroduction to WordPress REST API
Introduction to WordPress REST APISimone D'Amico
 
[GeekTalk#2] Takaaki Mizuno - Api Url Design
[GeekTalk#2] Takaaki Mizuno - Api Url Design[GeekTalk#2] Takaaki Mizuno - Api Url Design
[GeekTalk#2] Takaaki Mizuno - Api Url DesignNexus FrontierTech
 
Optimizing Your Site for Holiday Traffic
Optimizing Your Site for Holiday TrafficOptimizing Your Site for Holiday Traffic
Optimizing Your Site for Holiday TrafficWP Engine UK
 
Techical Workflow for a Startup
Techical Workflow for a StartupTechical Workflow for a Startup
Techical Workflow for a StartupSébastien Saunier
 
Angular js full stack development
Angular js   full stack developmentAngular js   full stack development
Angular js full stack developmentDarius Riggins
 
React For Vikings
React For VikingsReact For Vikings
React For VikingsFITC
 

La actualidad más candente (20)

Phonegap Day 2016: Ember/JS & Hybrid Apps Tips
Phonegap Day 2016: Ember/JS & Hybrid Apps TipsPhonegap Day 2016: Ember/JS & Hybrid Apps Tips
Phonegap Day 2016: Ember/JS & Hybrid Apps Tips
 
React JS
React JSReact JS
React JS
 
Why Would A Programmer Fall In Love With SPA?
Why Would A Programmer Fall In Love With SPA?Why Would A Programmer Fall In Love With SPA?
Why Would A Programmer Fall In Love With SPA?
 
Using CI for continuous delivery Part 2
Using CI for continuous delivery Part 2Using CI for continuous delivery Part 2
Using CI for continuous delivery Part 2
 
Java spring mysql without hibernate(2) (1)
Java spring mysql without hibernate(2) (1)Java spring mysql without hibernate(2) (1)
Java spring mysql without hibernate(2) (1)
 
Ionic CLI Adventures
Ionic CLI AdventuresIonic CLI Adventures
Ionic CLI Adventures
 
WP REST API - Building a simple Web Application
WP REST API - Building a simple Web ApplicationWP REST API - Building a simple Web Application
WP REST API - Building a simple Web Application
 
Step by Step Guide on Lazy Loading in Angular 11
Step by Step Guide on Lazy Loading in Angular 11Step by Step Guide on Lazy Loading in Angular 11
Step by Step Guide on Lazy Loading in Angular 11
 
Behavior Driven Development with Cucumber
Behavior Driven Development with CucumberBehavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
 
Introduction to VueJS & The WordPress REST API
Introduction to VueJS & The WordPress REST APIIntroduction to VueJS & The WordPress REST API
Introduction to VueJS & The WordPress REST API
 
Introduction to WordPress REST API
Introduction to WordPress REST APIIntroduction to WordPress REST API
Introduction to WordPress REST API
 
[GeekTalk#2] Takaaki Mizuno - Api Url Design
[GeekTalk#2] Takaaki Mizuno - Api Url Design[GeekTalk#2] Takaaki Mizuno - Api Url Design
[GeekTalk#2] Takaaki Mizuno - Api Url Design
 
Oracle APEX & PhoneGap
Oracle APEX & PhoneGapOracle APEX & PhoneGap
Oracle APEX & PhoneGap
 
Optimizing Your Site for Holiday Traffic
Optimizing Your Site for Holiday TrafficOptimizing Your Site for Holiday Traffic
Optimizing Your Site for Holiday Traffic
 
Techical Workflow for a Startup
Techical Workflow for a StartupTechical Workflow for a Startup
Techical Workflow for a Startup
 
Angular js full stack development
Angular js   full stack developmentAngular js   full stack development
Angular js full stack development
 
Building a WordPress plugin
Building a WordPress pluginBuilding a WordPress plugin
Building a WordPress plugin
 
Tech Talk on ReactJS
Tech Talk on ReactJSTech Talk on ReactJS
Tech Talk on ReactJS
 
Pundit
PunditPundit
Pundit
 
React For Vikings
React For VikingsReact For Vikings
React For Vikings
 

Similar a Client Side Applications with WP-API WordPress - WCMTL 2015

You Got React.js in My PHP
You Got React.js in My PHPYou Got React.js in My PHP
You Got React.js in My PHPTaylor Lovett
 
API Technical Writing
API Technical WritingAPI Technical Writing
API Technical WritingSarah Maddox
 
API Workshop: Deep dive into REST APIs
API Workshop: Deep dive into REST APIsAPI Workshop: Deep dive into REST APIs
API Workshop: Deep dive into REST APIsTom Johnson
 
Theming websites effortlessly with Deliverance (CMSExpo 2010)
Theming websites effortlessly with Deliverance (CMSExpo 2010)Theming websites effortlessly with Deliverance (CMSExpo 2010)
Theming websites effortlessly with Deliverance (CMSExpo 2010)Jazkarta, Inc.
 
Integrating Social Apps with Content Driven Sites using Apache Rave and Sprin...
Integrating Social Apps with Content Driven Sites using Apache Rave and Sprin...Integrating Social Apps with Content Driven Sites using Apache Rave and Sprin...
Integrating Social Apps with Content Driven Sites using Apache Rave and Sprin...ate.douma
 
Course CodeSchool - Shaping up with Angular.js
Course CodeSchool - Shaping up with Angular.jsCourse CodeSchool - Shaping up with Angular.js
Course CodeSchool - Shaping up with Angular.jsVinícius de Moraes
 
Front End Development for Back End Developers - Devoxx UK 2017
 Front End Development for Back End Developers - Devoxx UK 2017 Front End Development for Back End Developers - Devoxx UK 2017
Front End Development for Back End Developers - Devoxx UK 2017Matt Raible
 
243329387 angular-docs
243329387 angular-docs243329387 angular-docs
243329387 angular-docsAbhi166803
 
WordCamp Greenville 2018 - Beware the Dark Side, or an Intro to Development
WordCamp Greenville 2018 - Beware the Dark Side, or an Intro to DevelopmentWordCamp Greenville 2018 - Beware the Dark Side, or an Intro to Development
WordCamp Greenville 2018 - Beware the Dark Side, or an Intro to DevelopmentEvan Mullins
 
MongoDB.local Seattle 2019: MongoDB Stitch Tutorial
MongoDB.local Seattle 2019: MongoDB Stitch TutorialMongoDB.local Seattle 2019: MongoDB Stitch Tutorial
MongoDB.local Seattle 2019: MongoDB Stitch TutorialMongoDB
 
Using the new WordPress REST API
Using the new WordPress REST APIUsing the new WordPress REST API
Using the new WordPress REST APICaldera Labs
 
Survival Strategies for API Documentation: Presentation to Southwestern Ontar...
Survival Strategies for API Documentation: Presentation to Southwestern Ontar...Survival Strategies for API Documentation: Presentation to Southwestern Ontar...
Survival Strategies for API Documentation: Presentation to Southwestern Ontar...Tom Johnson
 
WordPress as a Platform - talk to Bristol Open Source Meetup, 2014-12-08
WordPress as a Platform - talk to Bristol Open Source Meetup, 2014-12-08WordPress as a Platform - talk to Bristol Open Source Meetup, 2014-12-08
WordPress as a Platform - talk to Bristol Open Source Meetup, 2014-12-08Tim Stephenson
 
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 PortalHimanshu Mendiratta
 
Ruby on Rails + AngularJS + Twitter Bootstrap
Ruby on Rails + AngularJS + Twitter BootstrapRuby on Rails + AngularJS + Twitter Bootstrap
Ruby on Rails + AngularJS + Twitter BootstrapMarcio Marinho
 
ASP.NEt MVC and Angular What a couple
ASP.NEt MVC and Angular What a coupleASP.NEt MVC and Angular What a couple
ASP.NEt MVC and Angular What a coupleAlexandre Marreiros
 
End to-End SPA Development Using ASP.NET and AngularJS
End to-End SPA Development Using ASP.NET and AngularJSEnd to-End SPA Development Using ASP.NET and AngularJS
End to-End SPA Development Using ASP.NET and AngularJSGil Fink
 
Front End Development for Back End Developers - vJUG24 2017
Front End Development for Back End Developers - vJUG24 2017Front End Development for Back End Developers - vJUG24 2017
Front End Development for Back End Developers - vJUG24 2017Matt Raible
 
Accelerated Mobile Pages (AMP) in Magento
Accelerated Mobile Pages (AMP) in MagentoAccelerated Mobile Pages (AMP) in Magento
Accelerated Mobile Pages (AMP) in MagentoMagecom UK Limited
 

Similar a Client Side Applications with WP-API WordPress - WCMTL 2015 (20)

You Got React.js in My PHP
You Got React.js in My PHPYou Got React.js in My PHP
You Got React.js in My PHP
 
API Technical Writing
API Technical WritingAPI Technical Writing
API Technical Writing
 
API Workshop: Deep dive into REST APIs
API Workshop: Deep dive into REST APIsAPI Workshop: Deep dive into REST APIs
API Workshop: Deep dive into REST APIs
 
Theming websites effortlessly with Deliverance (CMSExpo 2010)
Theming websites effortlessly with Deliverance (CMSExpo 2010)Theming websites effortlessly with Deliverance (CMSExpo 2010)
Theming websites effortlessly with Deliverance (CMSExpo 2010)
 
Integrating Social Apps with Content Driven Sites using Apache Rave and Sprin...
Integrating Social Apps with Content Driven Sites using Apache Rave and Sprin...Integrating Social Apps with Content Driven Sites using Apache Rave and Sprin...
Integrating Social Apps with Content Driven Sites using Apache Rave and Sprin...
 
Course CodeSchool - Shaping up with Angular.js
Course CodeSchool - Shaping up with Angular.jsCourse CodeSchool - Shaping up with Angular.js
Course CodeSchool - Shaping up with Angular.js
 
Front End Development for Back End Developers - Devoxx UK 2017
 Front End Development for Back End Developers - Devoxx UK 2017 Front End Development for Back End Developers - Devoxx UK 2017
Front End Development for Back End Developers - Devoxx UK 2017
 
243329387 angular-docs
243329387 angular-docs243329387 angular-docs
243329387 angular-docs
 
WordCamp Greenville 2018 - Beware the Dark Side, or an Intro to Development
WordCamp Greenville 2018 - Beware the Dark Side, or an Intro to DevelopmentWordCamp Greenville 2018 - Beware the Dark Side, or an Intro to Development
WordCamp Greenville 2018 - Beware the Dark Side, or an Intro to Development
 
MongoDB.local Seattle 2019: MongoDB Stitch Tutorial
MongoDB.local Seattle 2019: MongoDB Stitch TutorialMongoDB.local Seattle 2019: MongoDB Stitch Tutorial
MongoDB.local Seattle 2019: MongoDB Stitch Tutorial
 
Using the new WordPress REST API
Using the new WordPress REST APIUsing the new WordPress REST API
Using the new WordPress REST API
 
Survival Strategies for API Documentation: Presentation to Southwestern Ontar...
Survival Strategies for API Documentation: Presentation to Southwestern Ontar...Survival Strategies for API Documentation: Presentation to Southwestern Ontar...
Survival Strategies for API Documentation: Presentation to Southwestern Ontar...
 
WordPress as a Platform - talk to Bristol Open Source Meetup, 2014-12-08
WordPress as a Platform - talk to Bristol Open Source Meetup, 2014-12-08WordPress as a Platform - talk to Bristol Open Source Meetup, 2014-12-08
WordPress as a Platform - talk to Bristol Open Source Meetup, 2014-12-08
 
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
 
Ruby on Rails + AngularJS + Twitter Bootstrap
Ruby on Rails + AngularJS + Twitter BootstrapRuby on Rails + AngularJS + Twitter Bootstrap
Ruby on Rails + AngularJS + Twitter Bootstrap
 
ASP.NEt MVC and Angular What a couple
ASP.NEt MVC and Angular What a coupleASP.NEt MVC and Angular What a couple
ASP.NEt MVC and Angular What a couple
 
End to-End SPA Development Using ASP.NET and AngularJS
End to-End SPA Development Using ASP.NET and AngularJSEnd to-End SPA Development Using ASP.NET and AngularJS
End to-End SPA Development Using ASP.NET and AngularJS
 
Front End Development for Back End Developers - vJUG24 2017
Front End Development for Back End Developers - vJUG24 2017Front End Development for Back End Developers - vJUG24 2017
Front End Development for Back End Developers - vJUG24 2017
 
Accelerated Mobile Pages (AMP) in Magento
Accelerated Mobile Pages (AMP) in MagentoAccelerated Mobile Pages (AMP) in Magento
Accelerated Mobile Pages (AMP) in Magento
 
Web api
Web apiWeb api
Web api
 

Más de Roy Sivan

WordPress in Enterprise
WordPress in EnterpriseWordPress in Enterprise
WordPress in EnterpriseRoy Sivan
 
Building Gutenberg Applications & WebOPS Case Study
Building Gutenberg Applications & WebOPS Case StudyBuilding Gutenberg Applications & WebOPS Case Study
Building Gutenberg Applications & WebOPS Case StudyRoy Sivan
 
Building Headless Applications with WordPress & Gutenberg
Building Headless Applications with WordPress & GutenbergBuilding Headless Applications with WordPress & Gutenberg
Building Headless Applications with WordPress & GutenbergRoy Sivan
 
Gutenberg & Custom Applications powered by WordPress
Gutenberg & Custom Applications powered by WordPressGutenberg & Custom Applications powered by WordPress
Gutenberg & Custom Applications powered by WordPressRoy Sivan
 
WordPress SFO Meetup - Gutenberg FAQ
WordPress SFO Meetup - Gutenberg FAQWordPress SFO Meetup - Gutenberg FAQ
WordPress SFO Meetup - Gutenberg FAQRoy Sivan
 
WCSD - GutenWhat? A Gutenberg FAQ
WCSD - GutenWhat? A Gutenberg FAQWCSD - GutenWhat? A Gutenberg FAQ
WCSD - GutenWhat? A Gutenberg FAQRoy Sivan
 
A Crash Course in WordPress Gutenberg
A Crash Course in WordPress GutenbergA Crash Course in WordPress Gutenberg
A Crash Course in WordPress GutenbergRoy Sivan
 
Powering Content Driven Applications with the World’s Most Popular CMS #ngconf
Powering Content Driven Applications with the World’s Most Popular CMS #ngconfPowering Content Driven Applications with the World’s Most Popular CMS #ngconf
Powering Content Driven Applications with the World’s Most Popular CMS #ngconfRoy Sivan
 
WPCampus Online - The Case for the WordPress REST API
WPCampus Online - The Case for the WordPress REST APIWPCampus Online - The Case for the WordPress REST API
WPCampus Online - The Case for the WordPress REST APIRoy Sivan
 
Angular Remote Conf - Building with Angular & WordPress
Angular Remote Conf - Building with Angular & WordPressAngular Remote Conf - Building with Angular & WordPress
Angular Remote Conf - Building with Angular & WordPressRoy Sivan
 
The Case for the WordPress REST API | WordCamp Montreal 2016
The Case for the WordPress REST API | WordCamp Montreal 2016The Case for the WordPress REST API | WordCamp Montreal 2016
The Case for the WordPress REST API | WordCamp Montreal 2016Roy Sivan
 
Building a JavaScript App powered by WordPress & AngularJS
Building a JavaScript App powered by WordPress & AngularJSBuilding a JavaScript App powered by WordPress & AngularJS
Building a JavaScript App powered by WordPress & AngularJSRoy Sivan
 
Becoming a WordPress Artisan - Developer
Becoming a WordPress Artisan - DeveloperBecoming a WordPress Artisan - Developer
Becoming a WordPress Artisan - DeveloperRoy Sivan
 

Más de Roy Sivan (13)

WordPress in Enterprise
WordPress in EnterpriseWordPress in Enterprise
WordPress in Enterprise
 
Building Gutenberg Applications & WebOPS Case Study
Building Gutenberg Applications & WebOPS Case StudyBuilding Gutenberg Applications & WebOPS Case Study
Building Gutenberg Applications & WebOPS Case Study
 
Building Headless Applications with WordPress & Gutenberg
Building Headless Applications with WordPress & GutenbergBuilding Headless Applications with WordPress & Gutenberg
Building Headless Applications with WordPress & Gutenberg
 
Gutenberg & Custom Applications powered by WordPress
Gutenberg & Custom Applications powered by WordPressGutenberg & Custom Applications powered by WordPress
Gutenberg & Custom Applications powered by WordPress
 
WordPress SFO Meetup - Gutenberg FAQ
WordPress SFO Meetup - Gutenberg FAQWordPress SFO Meetup - Gutenberg FAQ
WordPress SFO Meetup - Gutenberg FAQ
 
WCSD - GutenWhat? A Gutenberg FAQ
WCSD - GutenWhat? A Gutenberg FAQWCSD - GutenWhat? A Gutenberg FAQ
WCSD - GutenWhat? A Gutenberg FAQ
 
A Crash Course in WordPress Gutenberg
A Crash Course in WordPress GutenbergA Crash Course in WordPress Gutenberg
A Crash Course in WordPress Gutenberg
 
Powering Content Driven Applications with the World’s Most Popular CMS #ngconf
Powering Content Driven Applications with the World’s Most Popular CMS #ngconfPowering Content Driven Applications with the World’s Most Popular CMS #ngconf
Powering Content Driven Applications with the World’s Most Popular CMS #ngconf
 
WPCampus Online - The Case for the WordPress REST API
WPCampus Online - The Case for the WordPress REST APIWPCampus Online - The Case for the WordPress REST API
WPCampus Online - The Case for the WordPress REST API
 
Angular Remote Conf - Building with Angular & WordPress
Angular Remote Conf - Building with Angular & WordPressAngular Remote Conf - Building with Angular & WordPress
Angular Remote Conf - Building with Angular & WordPress
 
The Case for the WordPress REST API | WordCamp Montreal 2016
The Case for the WordPress REST API | WordCamp Montreal 2016The Case for the WordPress REST API | WordCamp Montreal 2016
The Case for the WordPress REST API | WordCamp Montreal 2016
 
Building a JavaScript App powered by WordPress & AngularJS
Building a JavaScript App powered by WordPress & AngularJSBuilding a JavaScript App powered by WordPress & AngularJS
Building a JavaScript App powered by WordPress & AngularJS
 
Becoming a WordPress Artisan - Developer
Becoming a WordPress Artisan - DeveloperBecoming a WordPress Artisan - Developer
Becoming a WordPress Artisan - Developer
 

Client Side Applications with WP-API WordPress - WCMTL 2015

  • 1. 1 Building Client Side Web Applications with WordPress and WP-API Roy Sivan Twitter/Github - @royboy789 roysivan.com | arcctrl.com
  • 2. I really don’t like Windows
  • 3. There will be code There will be learning There will be cats Be Warned
  • 4. WordPress developer at Disney and the co-founder of My first install of WordPress was 0.7 and been a user & developer since Roy Sivan Twitter/Github - @royboy789 roysivan.com | arcctrl.com Who is this geek?
  • 5. Why build Web Applications with WordPress? Why not?
  • 7.
  • 8. Single Page Web Application S.P.A Not all client side apps need to be full S.P.A’s.
  • 9. Client Side? Client = Browser POP QUIZ What is the fastest file a web server can serve?
  • 10. CLIENT VS. SERVER SIDE - REQUESTS AND RESPONSE One request to rule them all “I want my blog posts” SERVER CLIENT
  • 11. PHP is the language behind WordPress SERVERCLIENT Client: Sends request for template Server: Processes PHP code turning it into HTML. Returns full HTML
  • 12. Benefits of Loading Client Side Less load on the server CDN all template files Easier to cache JS and HTML VERY Scalable AJAX - can transform your UI / UX
  • 13. Code Example: Server Side Loop <?php //list all posts - this is PHP & HTML while ( have_posts() ) : the_post(); ?> <article class="postWrapper"> <h3 class="page_title text-center"> <a href=“<?php the_permalink(); ?>” class="content"> <?php the_title(); ?> </a> </h3> <?php the_content(); ?> </article> <?php endwhile; ?>
  • 14. Living on the client side
  • 15. Code Example: Client Side Loop (using AngularJS) //list all posts - this is HTML <article class="postWrapper" ng-repeat="post in posts” > <h3 class="page_title text-center"> <a href=“/coh/#/post/{{post.ID}}” class="content"> {{post.title}} </a> </h3> {{post.content}} </article>
  • 16. AngularJS - the important bits <?php the_title(); ?> PHP AngularJS HTML Template {{post.title}} <?php the_content(); ?> {{post.title}} <?php the_permalink(); ?> {{post.link}}
  • 17. WP-API Response Example /posts - WP-API endpoint { ID: 1 content: '<p>Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!</p>', title: 'Hello world!', status: 'publish', author : {..}, ... }, …
  • 18. ASK NOT HOW, but WHY?
  • 20. Client WordPress for: Users
 User Authentication
 Custom Post Types
 Data Storage WP-API / S.P.A for: DOM Memory
 User Profiles
 Inline Commenting
 Inline Bookmarks
  • 22. CodeCavalry.com WordPress for: Users
 User Authentication
 Custom Post Types
 Data Storage S.P.A for: Session (CPT) Create
 Firebase - WebSocket
 User Dashboard
 User Profiles
  • 23. Awesome Resources Roy Sivan Twitter/Github - @royboy789 roysivan.com | arcctrl.com WP-API on GitHub https://github.com/WP-API/WP-API CodeCavalry http://www.codecavalry.com AngularJS WP Theme http://www.roysivan.com/angular-wordpress-theme AngularJS For WP Plugin http://www.roysivan.com/angularjs-for-wordpress Community Built WP App with AngularJS & Slides http://www.roysivan.com/blog
  • 24. Thank You Find me online: Twitter: @royboy789 Github: @royboy789 CodeCavalry.com/royboy789 Roy Sivan Twitter/Github - @royboy789 roysivan.com | arcctrl.com