This document discusses building a modern application using Symfony API Platform and GatsbyJS. It introduces Symfony API Platform as a framework for building API-driven projects with REST and GraphQL support. It also discusses using GatsbyJS, a React framework, to build fast websites and apps that can pull data from the Symfony API via GraphQL. User authentication with JWT and integrating the two frameworks is also covered at a high level.
17. 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
20. GraphQL is an open-source
data query and manipulation
language for APIs.
GraphQL
21. To enable GraphQL and GraphiQL interface
in your API, simply require
“webonyx/graphql-php”
package using composer
GraphQL
GraphQL demo
22. 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.
24. FOSUserBundle || Doctrine User Provider
LexikJWTAuthenticationBundle
JWTRefreshTokenBundle
User Authentication
25. Use Doctrine ORM Filters
Register EventListeners for JWT & Auth
Use Serialization Groups (encode/decode)
Create custom GraphQL Queries or Mutations
Tips
26. GatsbyJS
Gatsby is a free and open source
framework based on React that
helps developers build blazing
fast websites and apps