Paweł Jędrzejewski I really like Open Source I created Sylius I co-founded Lakion I help organize PHPers Łódź
? What does it mean to be rapid? @pjedrzejewski
rapid - [ rap -id] - adjec7ve Moving, acGng, or occurring with great speed. @pjedrzejewski
Every startup needs an MVP. @pjedrzejewski
*Minimum Viable Product
Many of them are unpleasantly surprised with the fact that they need to maintain it aLer going live. @pjedrzejewski
When you need to do a significant change in your „prototype”.
Value delivered Time This is not rapid. @pjedrzejewski
Value delivered Time This is rapid. @pjedrzejewski
Long-term flexibility over short-term graGficaGon from saGsfying the management or the investors. @pjedrzejewski
? What is an API? @pjedrzejewski
ApplicaGon Programming Interface @pjedrzejewski
SoLware-to-SoLware interfaces @pjedrzejewski
Machines talking to machines… You have been warned.
Why do we need APIs? API UI Amazon Your app User @pjedrzejewski
Why do we need APIs? • Sharing data and avoiding duplicaGon • Decoupling funcGonality (SRP, SeparaGon of Concerns etc.) • Allowing other people to consume our service @pjedrzejewski
? What kind of APIs are out there? @pjedrzejewski
CrappyAPI GET /createNewChargeV2 With the following data sent: „I\ don\’t\ want\ 2\ do\ this”!UserID:1!250!USD! test@example.com# @pjedrzejewski
SOAP POST / HTTP/1.1 Host: xyz.com Content-Type: applicaGon/soap+xml; charset=uo-8 <?xml version=„1.0” ?> <soap:Envelope …> <m:GetUserDetails> <m:UserID>41</m:UserID> </m:GetUserDetails> </soap:Envelope> @pjedrzejewski
REST GET /users/41 HTTP/1.1 Host: xyz.com Accept: applicaGon/json @pjedrzejewski
That being said, „REST or SOAP?” is a wrong quesGon. @pjedrzejewski
REST is not a protocol. It is an architectural style. @pjedrzejewski
REST API Principles Client-server architecture Stateless Cacheable Based on standards (HTTP, URL, XML, JSON) Independent from the plaoorm and language @pjedrzejewski
The Richardson Maturity Model Level 3: Hypermedia Controls Level 2: HTTP Verbs Level 1: Resources Level 0: Swamp of POX @pjedrzejewski
Install LIONFRAME $ composer create-project lakion/lionframe @pjedrzejewski @pjedrzejewski
DEMO @pjedrzejewski
How?
@pjedrzejewski @pjedrzejewski
@pjedrzejewski @pjedrzejewski
Bundles, Bundles, Bundles FOSRestBundle JMSSerializerBundle BazingaHateoasBundle SyliusResourceBundle @pjedrzejewski
It can be plugged into an exisGng Symfony app. @pjedrzejewski
Use case: Sylius E-Commerce API User API Mobile API Sylius API @pjedrzejewski
Extras! FOSOAuthServerBundle FOSHzpCacheBundle SyliusRbacBundle @pjedrzejewski
lakion.com/lionframe
DOCS.sylius.org - Sylius Resource Bundle
@pjedrzejewski @Sylius @Lakion pjedrzejewski.com sylius.org lakion.com THANK YOU!
Recommend
More recommend