SlideShare a Scribd company logo
1 of 67
Download to read offline
© 2020, Amazon Web Services, Inc. or its Affiliates.
Full stack development
with AWS Amplify
Marcia Villalba
@mavi888uy
© 2020, Amazon Web Services, Inc. or its Affiliates.
About me
AWS Developer Advocate
Coding for more than 15 years
Host of FooBar YouTube Channel
https://youtube.com/foobar_codes
@mavi888uy
© 2020, Amazon Web Services, Inc. or its Affiliates.
AWS Amplify
© 2020, Amazon Web Services, Inc. or its Affiliates.
AWS Amplify overview
Developer tools for building, testing,
deploying, and hosting the entire app –
frontend and backend
The Amplify Framework, an open-
source client framework, includes
libraries, a CLI toolchain, and UI
components
The CLI toolchain enables easy
integration with AWS services such as
Amazon Cognito, AWS AppSync, and
Amazon Pinpoint
© 2020, Amazon Web Services, Inc. or its Affiliates.
Amplify – A Set of Open-Source Libraries
© 2020, Amazon Web Services, Inc. or its Affiliates.
Amplify Framework review
• Open source
• Among the top 5 fastest growing projects on
GitHub
• Opinionated
• Best practices built-in
• Infrastructure as code
• Categories-based high-level abstractions
© 2020, Amazon Web Services, Inc. or its Affiliates.
Amplify Framework
Analytics
Track user sessions, custom
user attributes and in-app
metrics
API
HTTP requests using REST
and GraphQL with support
for real-time data
Auth
AuthN + AuthZ library with
prebuilt UI components for
your app
DataStore
On-device persistent storage
that automatically
synchronizes data between
you apps and the cloud
Interactions
Conversational bots
powered by deep learning
technologies
PubSub
Connect your app to
message-oriented
middleware on the cloud
Notifications
Push notifications with
campaign analytics and
targeting
XR
Work with augmented
reality and virtual reality
content in your apps
Predictions
Add MI/ML capabilities to
your app powered by cloud
services
Storage
Manage user content securely
in public, protected, and
private storage
© 2020, Amazon Web Services, Inc. or its Affiliates.
Amplify Framework
Analytics
Track user sessions, custom
user attributes and in-app
metrics
API
HTTP requests using REST
and GraphQL with support
for real-time data
Auth
AuthN + AuthZ library with
prebuilt UI components for
your app
DataStore
On-device persistent storage
that automatically
synchronizes data between
you apps and the cloud
Interactions
Conversational bots
powered by deep learning
technologies
PubSub
Connect your app to
message-oriented
middleware on the cloud
Notifications
Push notifications with
campaign analytics and
targeting
XR
Work with augmented
reality and virtual reality
content in your apps
Predictions
Add MI/ML capabilities to
your app powered by cloud
services
Storage
Manage user content securely
in public, protected, and
private storage
© 2020, Amazon Web Services, Inc. or its Affiliates.
Amplify Framework review: CLI
Code generation
Local mocking and testing
Manage single/multi-environment
Convention over configuration
Native code Types & statements
Android iOS
© 2020, Amazon Web Services, Inc. or its Affiliates.
Amplify Framework recap: Libraries
JS framework-specific components
JavaScript (JS) client for web and
React Native
Amplify native for iOS and Android
Interact with services via client-side
© 2020, Amazon Web Services, Inc. or its Affiliates.
Let’s get building
© 2020, Amazon Web Services, Inc. or its Affiliates.
Let’s enrich a React web app
© 2020, Amazon Web Services, Inc. or its Affiliates.
Get the code
https://github.com/mavi888/demo-amplify-base
© 2020, Amazon Web Services, Inc. or its Affiliates.
Initialise amplify
$ amplify init
© 2020, Amazon Web Services, Inc. or its Affiliates.
© 2020, Amazon Web Services, Inc. or its Affiliates.
#1 add authentication
© 2020, Amazon Web Services, Inc. or its Affiliates.
$ amplify add auth & amplify push
AWS Cloud
Clients
AWS Cognito User Pool
Accounts
Multi Factor
Authentication
Signup & Signin
© 2020, Amazon Web Services, Inc. or its Affiliates.
Hosted UI & Federated Authentication
AWS Cloud
AWS Cognito User Pool
Accounts
Multi Factor
Authentication
Signup & Signin
Clients
© 2020, Amazon Web Services, Inc. or its Affiliates.
Provision the service
$ amplify add auth
© 2020, Amazon Web Services, Inc. or its Affiliates.
Provision the service
$ amplify push
© 2020, Amazon Web Services, Inc. or its Affiliates.© 2020, Amazon Web Services, Inc. or its Affiliates.
import …
import Amplify from 'aws-amplify';
import { AmplifyAuthenticator, AmplifySignOut } from '@aws-amplify/ui-react';
import awsExports from "./aws-exports";
Amplify.configure(awsExports);
…
class App extends Component {
render() {
return (
<AmplifyAuthenticator>
<div className="row">
<div className="col m-3">
<Header/>
</div>
</div>
</AmplifyAuthenticator>
);
}
}
export default App;
© 2020, Amazon Web Services, Inc. or its Affiliates.
#2 add an API
© 2020, Amazon Web Services, Inc. or its Affiliates.
/posts /comments /authors
REST API
posts comments authors
GraphQL API
What is GraphQL?
© 2020, Amazon Web Services, Inc. or its Affiliates.
Queries MutationsTypes
Subscriptions
GraphQL schema and operations
type User {
id: ID!
username: String!
firstName: String
lastName: String
daysActive: Int
}
A query language for APIs . . . and a runtime!
© 2020, Amazon Web Services, Inc. or its Affiliates.
A query language for APIs . . .
Queries
query GetPost {
getPost(id: ”1”) {
id
title
}
}
mutation CreatePost {
createPost(title: “Summit”) {
id
title
}
}
subscription OnCreatePost {
onCreatePost {
id
title
}
}
Mutations Subscriptions
© 2020, Amazon Web Services, Inc. or its Affiliates.
© 2020, Amazon Web Services, Inc. or its Affiliates.
AppSync, a runtime to execute the query
query GetPost {
getPosts(id: ”1”) {
id
title
comments {
content
}
author {
name
}
}
}
query GetPost {
getPosts(id: ”1”) {
id
title
comments {
content
}
author {
name
}
}
}
Amazon
EC2
{
"data" : {
"posts" : [
{
"id" : 1,
"title" : "Introduction to GraphQL",
"comments" : [
{
"content" : "I want GraphQL for my next App!"
}
],
"author" : {
"name" : "Sébastien Stormacq"
}
}
]
}
}
Amazon
DynamoDB
AWS
Lambda
© 2020, Amazon Web Services, Inc. or its Affiliates.
Provision the API
$ amplify add api
© 2020, Amazon Web Services, Inc. or its Affiliates.
A basic schema
type Note {
id: ID!
note: String!
}
© 2020, Amazon Web Services, Inc. or its Affiliates.
Transformers (aka annotations)
type Note
@model @auth(rules: [{allow: owner}]){
id: ID!
note: String!
}
© 2020, Amazon Web Services, Inc. or its Affiliates.
GraphQL Transform: Mix and match data sources
type Note {
id: ID!
note: String!
}
© 2020, Amazon Web Services, Inc. or its Affiliates.
GraphQL Transform: Mix and match data sources
type Note
@model {
id: ID!
note: String!
}
Amazon
DynamoDB
AWS AppSync
Mutations
Queries
createNote
readNote
updateNote
deleteNote
list
© 2020, Amazon Web Services, Inc. or its Affiliates.
GraphQL Transform: Mix and match data sources
type Note
@model
@auth(rules: [{allow: owner}]){
id: ID!
note: String!
}
Amazon
DynamoDB
AWS AppSync
Mutations
Queries
Amazon
Cognito
createNote
readNote
updateNote
deleteNote
list
© 2020, Amazon Web Services, Inc. or its Affiliates.
Provision the API
$ amplify push
© 2020, Amazon Web Services, Inc. or its Affiliates.
© 2020, Amazon Web Services, Inc. or its Affiliates.© 2020, Amazon Web Services, Inc. or its Affiliates.
addNote = async (note) => {
var result = await
API.graphql(graphqlOperation(createNote, {input:note}));
this.state.notes.push(result.data.createNote)
this.setState( { notes: this.state.notes } )
}
© 2020, Amazon Web Services, Inc. or its Affiliates.
GraphQL API
AWS Cloud
AWS AppSync Amazon DynamoDB
Table
Schemas Resolvers Data Sources
queries
mutations
getNote Note Table
Datasource
IAM Role
ARN
Note Role
ARN
type Query {
getNote(...): Note
listNotes(...): Note
}
type Mutation {
createNote(...): Note
updateNote(...): Note
deleteNote(...): Note
}
type Subscription {
onCreateNote (...): Note
onUpdateNote (...): Note
onDeleteNotet(...): Note
}
type Note {
id: ID!
value: String
}
Clients
listNotes
createNote
deleteNote
updateNote
© 2020, Amazon Web Services, Inc. or its Affiliates.
© 2020, Amazon Web Services, Inc. or its Affiliates.
#3 add search
capability
© 2020, Amazon Web Services, Inc. or its Affiliates.
Update GraphQL Transformer
type Note
@model @auth(rules: [{allow: owner}])
@searchable {
id: ID!
note: String!
}
© 2020, Amazon Web Services, Inc. or its Affiliates.
GraphQL Transform: Mix and match data sources
type Note
@model
@auth(rules: [{allow: owner}])
@searchable{
id: ID!
note: String!
}
Amazon
DynamoDB
AWS AppSync
Mutations
Queries
Amazon
Cognito
searchPosts
Amazon Elasticsearch
Service
Lambda
function
createNote
readNote
updateNote
deleteNote
list
© 2020, Amazon Web Services, Inc. or its Affiliates.
Provision the service
$ amplify push
© 2020, Amazon Web Services, Inc. or its Affiliates.
© 2020, Amazon Web Services, Inc. or its Affiliates.
© 2020, Amazon Web Services, Inc. or its Affiliates.© 2020, Amazon Web Services, Inc. or its Affiliates.
searchNote = async (note) => {
var result;
// when no search filter is passed, revert back to full list
if (note.note === "") {
result = await API.graphql(graphqlOperation(listNotes));
this.setState( { notes: result.data.listNotes.items } )
} else {
// search
const filter = {
note: {
match: note
}
}
result = await API.graphql(graphqlOperation(searchNotes, {filter : filter}));
if (result.data.searchNotes.items.length > 0) {
this.setState( { notes : result.data.searchNotes.items } );
} else {
// no search result, print help
this.setState( { notes : [ {id: "-1", note: "No Match: Clear the search to go
back to your Notes"} ] } );
}
}
}
© 2020, Amazon Web Services, Inc. or its Affiliates.
@searchable
AWS Cloud
AWS AppSync Amazon DynamoDB
Table
Schemas Resolvers Data Sources
queries
mutations
getNote Note Table
Datasource
IAM Role
ARN
Note Role
ARN
type Query {
getNote(...): Note
listNotes(...): Note
}
type Mutation {
createNote(...): Note
updateNote(...): Note
deleteNote(...): Note
}
type Subscription {
onCreateNote (...): Note
onUpdateNote (...): Note
onDeleteNotet(...): Note
}
type Note {
id: ID!
value: String
}
Clients
listNotes
createNote
deleteNote
updateNote
© 2020, Amazon Web Services, Inc. or its Affiliates.
@searchable
AWS Cloud
AWS AppSync Amazon DynamoDB
Table
Schemas Resolvers Data Sources
queries
mutations
getNote
Note Table
Datasource
IAM Role
ARN
Note Role
ARN
type Query {
getNote(...): Note
listNotes(...): Note
}
type Mutation {
createNote(...): Note
updateNote(...): Note
deleteNote(...): Note
}
type Subscription {
onCreateNote (...): Note
onUpdateNote (...): Note
onDeleteNotet(...): Note
}
type Note {
id: ID!
value: String
}
Clients
listNotes
createNote
deleteNote
updateNote
ElasticSearch
Datasource
IAM Role
ARN
ES
Domain
ARN
Amazon ElasticSearch
searchNotes
© 2020, Amazon Web Services, Inc. or its Affiliates.
© 2020, Amazon Web Services, Inc. or its Affiliates.
#4 deploy the app
© 2020, Amazon Web Services, Inc. or its Affiliates.
Amplify console: Full-stack deployments
$ amplify console
© 2020, Amazon Web Services, Inc. or its Affiliates.
© 2020, Amazon Web Services, Inc. or its Affiliates.
© 2020, Amazon Web Services, Inc. or its Affiliates.
© 2020, Amazon Web Services, Inc. or its Affiliates.
Let’s try this
https://bit.ly/3fTLQwG
© 2020, Amazon Web Services, Inc. or its Affiliates.
Get the code
https://github.com/mavi888/demo-amplify-base
© 2020, Amazon Web Services, Inc. or its Affiliates.
Thanks!
Q&A
Marcia Villalba
@mavi888uy

More Related Content

What's hot

What's hot (20)

Module 6-Serverless-GraphQL-API
Module 6-Serverless-GraphQL-APIModule 6-Serverless-GraphQL-API
Module 6-Serverless-GraphQL-API
 
Introduction to Mobile Development with AWS
Introduction to Mobile Development with AWSIntroduction to Mobile Development with AWS
Introduction to Mobile Development with AWS
 
Serverless Development Deep Dive
Serverless Development Deep DiveServerless Development Deep Dive
Serverless Development Deep Dive
 
Simpler by Design: Build a Better GraphQL API for Your Next App by Writing Le...
Simpler by Design: Build a Better GraphQL API for Your Next App by Writing Le...Simpler by Design: Build a Better GraphQL API for Your Next App by Writing Le...
Simpler by Design: Build a Better GraphQL API for Your Next App by Writing Le...
 
Build a Serverless Backend for Requesting a Ride
Build a Serverless Backend for Requesting a RideBuild a Serverless Backend for Requesting a Ride
Build a Serverless Backend for Requesting a Ride
 
Invite your prospects with an engaging email campaign
Invite your prospects with an engaging email campaignInvite your prospects with an engaging email campaign
Invite your prospects with an engaging email campaign
 
Serverless functions deep dive
Serverless functions deep diveServerless functions deep dive
Serverless functions deep dive
 
Modern Applications Web Day | Impress Your Friends with Your First Serverless...
Modern Applications Web Day | Impress Your Friends with Your First Serverless...Modern Applications Web Day | Impress Your Friends with Your First Serverless...
Modern Applications Web Day | Impress Your Friends with Your First Serverless...
 
Building your first GraphQL API with AWS AppSync
Building your first GraphQL API with AWS AppSyncBuilding your first GraphQL API with AWS AppSync
Building your first GraphQL API with AWS AppSync
 
Build a Serverless Application using GraphQL & AWS AppSync
Build a Serverless Application using GraphQL & AWS AppSyncBuild a Serverless Application using GraphQL & AWS AppSync
Build a Serverless Application using GraphQL & AWS AppSync
 
Building CICD Pipelines for Serverless Applications
Building CICD Pipelines for Serverless ApplicationsBuilding CICD Pipelines for Serverless Applications
Building CICD Pipelines for Serverless Applications
 
Introduction to Mobile Development with AWS
Introduction to Mobile Development with AWSIntroduction to Mobile Development with AWS
Introduction to Mobile Development with AWS
 
Introduction to AWS Amplify CLI
Introduction to AWS Amplify CLIIntroduction to AWS Amplify CLI
Introduction to AWS Amplify CLI
 
Deep Dive into Firecracker Using Lightweight Virtual Machines to Enhance the ...
Deep Dive into Firecracker Using Lightweight Virtual Machines to Enhance the ...Deep Dive into Firecracker Using Lightweight Virtual Machines to Enhance the ...
Deep Dive into Firecracker Using Lightweight Virtual Machines to Enhance the ...
 
20190521 AWS Black Belt Online Seminar Amazon Simple Email Service (Amazon SES)
20190521 AWS Black Belt Online Seminar Amazon Simple Email Service (Amazon SES)20190521 AWS Black Belt Online Seminar Amazon Simple Email Service (Amazon SES)
20190521 AWS Black Belt Online Seminar Amazon Simple Email Service (Amazon SES)
 
Build your APPs in Lean and Agile Way using AWS Amplify
Build your APPs in Lean and Agile Way using AWS AmplifyBuild your APPs in Lean and Agile Way using AWS Amplify
Build your APPs in Lean and Agile Way using AWS Amplify
 
Intro to AWS Amplify Toolchain: Mobile Week SF
Intro to AWS Amplify Toolchain: Mobile Week SFIntro to AWS Amplify Toolchain: Mobile Week SF
Intro to AWS Amplify Toolchain: Mobile Week SF
 
Introduction to Development for Mobile with AWS
Introduction to Development for Mobile with AWSIntroduction to Development for Mobile with AWS
Introduction to Development for Mobile with AWS
 
AWS Lambda Layers, the Runtime API, & Nested Applications: re:Invent 2018 Rec...
AWS Lambda Layers, the Runtime API, & Nested Applications: re:Invent 2018 Rec...AWS Lambda Layers, the Runtime API, & Nested Applications: re:Invent 2018 Rec...
AWS Lambda Layers, the Runtime API, & Nested Applications: re:Invent 2018 Rec...
 
Building a Serverless AI Powered Twitter Bot: Collision 2018
Building a Serverless AI Powered Twitter Bot: Collision 2018Building a Serverless AI Powered Twitter Bot: Collision 2018
Building a Serverless AI Powered Twitter Bot: Collision 2018
 

Similar to 20200513 Getting started with AWS Amplify

20200520 - Como empezar a desarrollar aplicaciones serverless
20200520 - Como empezar a desarrollar aplicaciones serverless 20200520 - Como empezar a desarrollar aplicaciones serverless
20200520 - Como empezar a desarrollar aplicaciones serverless
Marcia Villalba
 

Similar to 20200513 Getting started with AWS Amplify (20)

20200520 - Como empezar a desarrollar aplicaciones serverless
20200520 - Como empezar a desarrollar aplicaciones serverless 20200520 - Como empezar a desarrollar aplicaciones serverless
20200520 - Como empezar a desarrollar aplicaciones serverless
 
"Integrate your front end apps with serverless backend in the cloud", Sebasti...
"Integrate your front end apps with serverless backend in the cloud", Sebasti..."Integrate your front end apps with serverless backend in the cloud", Sebasti...
"Integrate your front end apps with serverless backend in the cloud", Sebasti...
 
GraphQL backend with AWS AppSync & AWS Lambda
GraphQL backend with AWS AppSync & AWS LambdaGraphQL backend with AWS AppSync & AWS Lambda
GraphQL backend with AWS AppSync & AWS Lambda
 
Simplify front end apps.pdf
Simplify front end apps.pdfSimplify front end apps.pdf
Simplify front end apps.pdf
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
AWS Meetup Brussels 3rd Sep 2019 Simplify Frontend Apps with Serverless Backends
AWS Meetup Brussels 3rd Sep 2019 Simplify Frontend Apps with Serverless BackendsAWS Meetup Brussels 3rd Sep 2019 Simplify Frontend Apps with Serverless Backends
AWS Meetup Brussels 3rd Sep 2019 Simplify Frontend Apps with Serverless Backends
 
AWS DevDay Berlin 2019 - Simplify your Web & Mobile apps with cloud-based ser...
AWS DevDay Berlin 2019 - Simplify your Web & Mobile appswith cloud-based ser...AWS DevDay Berlin 2019 - Simplify your Web & Mobile appswith cloud-based ser...
AWS DevDay Berlin 2019 - Simplify your Web & Mobile apps with cloud-based ser...
 
Monetize Your Mobile App with Amazon Mobile Ads (MOB311) - AWS reInvent 2018.pdf
Monetize Your Mobile App with Amazon Mobile Ads (MOB311) - AWS reInvent 2018.pdfMonetize Your Mobile App with Amazon Mobile Ads (MOB311) - AWS reInvent 2018.pdf
Monetize Your Mobile App with Amazon Mobile Ads (MOB311) - AWS reInvent 2018.pdf
 
Develop Cross-Platform Mobile Apps with React Native, GraphQL, & AWS (MOB324)...
Develop Cross-Platform Mobile Apps with React Native, GraphQL, & AWS (MOB324)...Develop Cross-Platform Mobile Apps with React Native, GraphQL, & AWS (MOB324)...
Develop Cross-Platform Mobile Apps with React Native, GraphQL, & AWS (MOB324)...
 
20200803 - Serverless with AWS @ HELTECH
20200803 - Serverless with AWS @ HELTECH20200803 - Serverless with AWS @ HELTECH
20200803 - Serverless with AWS @ HELTECH
 
Introduction to AWS Amplify and the Amplify CLI Toolchain
Introduction to AWS Amplify and the Amplify CLI ToolchainIntroduction to AWS Amplify and the Amplify CLI Toolchain
Introduction to AWS Amplify and the Amplify CLI Toolchain
 
Serverless APIs and you
Serverless APIs and youServerless APIs and you
Serverless APIs and you
 
Best practices for choosing identity solutions for applications + workloads -...
Best practices for choosing identity solutions for applications + workloads -...Best practices for choosing identity solutions for applications + workloads -...
Best practices for choosing identity solutions for applications + workloads -...
 
Solution-Lab-Serverless-Web-Application
Solution-Lab-Serverless-Web-ApplicationSolution-Lab-Serverless-Web-Application
Solution-Lab-Serverless-Web-Application
 
Introduzione a GraphQL
Introduzione a GraphQLIntroduzione a GraphQL
Introduzione a GraphQL
 
Build a Social News App with Android and AWS (MOB307) - AWS re:Invent 2018
Build a Social News App with Android and AWS (MOB307) - AWS re:Invent 2018Build a Social News App with Android and AWS (MOB307) - AWS re:Invent 2018
Build a Social News App with Android and AWS (MOB307) - AWS re:Invent 2018
 
What can you do with Serverless in 2020
What can you do with Serverless in 2020What can you do with Serverless in 2020
What can you do with Serverless in 2020
 
善用 GraphQL 與 AWS AppSync 讓您的 Progressive Web App (PWA) 加速進化 (Level 200)
善用  GraphQL 與 AWS AppSync 讓您的  Progressive Web App (PWA) 加速進化 (Level 200)善用  GraphQL 與 AWS AppSync 讓您的  Progressive Web App (PWA) 加速進化 (Level 200)
善用 GraphQL 與 AWS AppSync 讓您的 Progressive Web App (PWA) 加速進化 (Level 200)
 
Tips and Tricks for Building and Deploying Serverless Apps In Minutes - AWS O...
Tips and Tricks for Building and Deploying Serverless Apps In Minutes - AWS O...Tips and Tricks for Building and Deploying Serverless Apps In Minutes - AWS O...
Tips and Tricks for Building and Deploying Serverless Apps In Minutes - AWS O...
 
Amplifying fullstack serverless apps with AppSync & the Amplify Framework - M...
Amplifying fullstack serverless apps with AppSync & the Amplify Framework - M...Amplifying fullstack serverless apps with AppSync & the Amplify Framework - M...
Amplifying fullstack serverless apps with AppSync & the Amplify Framework - M...
 

More from Marcia Villalba

More from Marcia Villalba (16)

20210608 - Desarrollo de aplicaciones en la nube
20210608 - Desarrollo de aplicaciones en la nube20210608 - Desarrollo de aplicaciones en la nube
20210608 - Desarrollo de aplicaciones en la nube
 
20201012 - Serverless Architecture Conference - Deploying serverless applicat...
20201012 - Serverless Architecture Conference - Deploying serverless applicat...20201012 - Serverless Architecture Conference - Deploying serverless applicat...
20201012 - Serverless Architecture Conference - Deploying serverless applicat...
 
20201013 - Serverless Architecture Conference - How to migrate your existing ...
20201013 - Serverless Architecture Conference - How to migrate your existing ...20201013 - Serverless Architecture Conference - How to migrate your existing ...
20201013 - Serverless Architecture Conference - How to migrate your existing ...
 
Building a personal brand
Building a personal brandBuilding a personal brand
Building a personal brand
 
20200522 - How to migrate an existing app to serverless
20200522 - How to migrate an existing app to serverless20200522 - How to migrate an existing app to serverless
20200522 - How to migrate an existing app to serverless
 
20200513 - CloudComputing UCU
20200513 - CloudComputing UCU20200513 - CloudComputing UCU
20200513 - CloudComputing UCU
 
2020-04-02 DevConf - How to migrate an existing application to serverless
2020-04-02 DevConf - How to migrate an existing application to serverless2020-04-02 DevConf - How to migrate an existing application to serverless
2020-04-02 DevConf - How to migrate an existing application to serverless
 
JFokus 2020 - How to migrate an application to serverless
JFokus 2020 - How to migrate an application to serverlessJFokus 2020 - How to migrate an application to serverless
JFokus 2020 - How to migrate an application to serverless
 
Serverless <3 GraphQL - AWS UG Tampere 2020
Serverless <3 GraphQL - AWS UG Tampere 2020Serverless <3 GraphQL - AWS UG Tampere 2020
Serverless <3 GraphQL - AWS UG Tampere 2020
 
ReInvent 2019 reCap Nordics
ReInvent 2019 reCap NordicsReInvent 2019 reCap Nordics
ReInvent 2019 reCap Nordics
 
Serverless Days Milano - Developing Serverless applications with GraphQL
Serverless Days Milano - Developing Serverless applications with GraphQLServerless Days Milano - Developing Serverless applications with GraphQL
Serverless Days Milano - Developing Serverless applications with GraphQL
 
AWS Stockholm Summit 19- Building serverless applications with GraphQL
AWS Stockholm Summit 19- Building serverless applications with GraphQLAWS Stockholm Summit 19- Building serverless applications with GraphQL
AWS Stockholm Summit 19- Building serverless applications with GraphQL
 
Serverless <3 GraphQL | 2019 - Serverless Architecture Conference
Serverless <3 GraphQL | 2019 - Serverless Architecture ConferenceServerless <3 GraphQL | 2019 - Serverless Architecture Conference
Serverless <3 GraphQL | 2019 - Serverless Architecture Conference
 
Serverless Computing London 2018 - Migrating services to serverless in 10 steps
Serverless Computing London 2018 - Migrating services to serverless in 10 stepsServerless Computing London 2018 - Migrating services to serverless in 10 steps
Serverless Computing London 2018 - Migrating services to serverless in 10 steps
 
Octubre 2018 - AWS UG Montevideo - Intro a Serverless y buenas practicas
Octubre 2018 - AWS UG Montevideo - Intro a Serverless y buenas practicasOctubre 2018 - AWS UG Montevideo - Intro a Serverless y buenas practicas
Octubre 2018 - AWS UG Montevideo - Intro a Serverless y buenas practicas
 
Serverless Empowering people
Serverless Empowering peopleServerless Empowering people
Serverless Empowering people
 

Recently uploaded

Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
Kamal Acharya
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
MayuraD1
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
AldoGarca30
 

Recently uploaded (20)

Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Introduction to Data Visualization,Matplotlib.pdf
Introduction to Data Visualization,Matplotlib.pdfIntroduction to Data Visualization,Matplotlib.pdf
Introduction to Data Visualization,Matplotlib.pdf
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdf
 
PE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiesPE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and properties
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Learn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic MarksLearn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic Marks
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
 
457503602-5-Gas-Well-Testing-and-Analysis-pptx.pptx
457503602-5-Gas-Well-Testing-and-Analysis-pptx.pptx457503602-5-Gas-Well-Testing-and-Analysis-pptx.pptx
457503602-5-Gas-Well-Testing-and-Analysis-pptx.pptx
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 

20200513 Getting started with AWS Amplify

  • 1. © 2020, Amazon Web Services, Inc. or its Affiliates. Full stack development with AWS Amplify Marcia Villalba @mavi888uy
  • 2. © 2020, Amazon Web Services, Inc. or its Affiliates. About me AWS Developer Advocate Coding for more than 15 years Host of FooBar YouTube Channel https://youtube.com/foobar_codes @mavi888uy
  • 3. © 2020, Amazon Web Services, Inc. or its Affiliates. AWS Amplify
  • 4. © 2020, Amazon Web Services, Inc. or its Affiliates. AWS Amplify overview Developer tools for building, testing, deploying, and hosting the entire app – frontend and backend The Amplify Framework, an open- source client framework, includes libraries, a CLI toolchain, and UI components The CLI toolchain enables easy integration with AWS services such as Amazon Cognito, AWS AppSync, and Amazon Pinpoint
  • 5. © 2020, Amazon Web Services, Inc. or its Affiliates. Amplify – A Set of Open-Source Libraries
  • 6. © 2020, Amazon Web Services, Inc. or its Affiliates. Amplify Framework review • Open source • Among the top 5 fastest growing projects on GitHub • Opinionated • Best practices built-in • Infrastructure as code • Categories-based high-level abstractions
  • 7. © 2020, Amazon Web Services, Inc. or its Affiliates. Amplify Framework Analytics Track user sessions, custom user attributes and in-app metrics API HTTP requests using REST and GraphQL with support for real-time data Auth AuthN + AuthZ library with prebuilt UI components for your app DataStore On-device persistent storage that automatically synchronizes data between you apps and the cloud Interactions Conversational bots powered by deep learning technologies PubSub Connect your app to message-oriented middleware on the cloud Notifications Push notifications with campaign analytics and targeting XR Work with augmented reality and virtual reality content in your apps Predictions Add MI/ML capabilities to your app powered by cloud services Storage Manage user content securely in public, protected, and private storage
  • 8. © 2020, Amazon Web Services, Inc. or its Affiliates. Amplify Framework Analytics Track user sessions, custom user attributes and in-app metrics API HTTP requests using REST and GraphQL with support for real-time data Auth AuthN + AuthZ library with prebuilt UI components for your app DataStore On-device persistent storage that automatically synchronizes data between you apps and the cloud Interactions Conversational bots powered by deep learning technologies PubSub Connect your app to message-oriented middleware on the cloud Notifications Push notifications with campaign analytics and targeting XR Work with augmented reality and virtual reality content in your apps Predictions Add MI/ML capabilities to your app powered by cloud services Storage Manage user content securely in public, protected, and private storage
  • 9. © 2020, Amazon Web Services, Inc. or its Affiliates. Amplify Framework review: CLI Code generation Local mocking and testing Manage single/multi-environment Convention over configuration Native code Types & statements Android iOS
  • 10. © 2020, Amazon Web Services, Inc. or its Affiliates. Amplify Framework recap: Libraries JS framework-specific components JavaScript (JS) client for web and React Native Amplify native for iOS and Android Interact with services via client-side
  • 11. © 2020, Amazon Web Services, Inc. or its Affiliates. Let’s get building
  • 12. © 2020, Amazon Web Services, Inc. or its Affiliates. Let’s enrich a React web app
  • 13. © 2020, Amazon Web Services, Inc. or its Affiliates. Get the code https://github.com/mavi888/demo-amplify-base
  • 14. © 2020, Amazon Web Services, Inc. or its Affiliates. Initialise amplify $ amplify init
  • 15.
  • 16.
  • 17. © 2020, Amazon Web Services, Inc. or its Affiliates.
  • 18. © 2020, Amazon Web Services, Inc. or its Affiliates. #1 add authentication
  • 19. © 2020, Amazon Web Services, Inc. or its Affiliates. $ amplify add auth & amplify push AWS Cloud Clients AWS Cognito User Pool Accounts Multi Factor Authentication Signup & Signin
  • 20. © 2020, Amazon Web Services, Inc. or its Affiliates. Hosted UI & Federated Authentication AWS Cloud AWS Cognito User Pool Accounts Multi Factor Authentication Signup & Signin Clients
  • 21. © 2020, Amazon Web Services, Inc. or its Affiliates. Provision the service $ amplify add auth
  • 22.
  • 23.
  • 24.
  • 25. © 2020, Amazon Web Services, Inc. or its Affiliates. Provision the service $ amplify push
  • 26.
  • 27. © 2020, Amazon Web Services, Inc. or its Affiliates.© 2020, Amazon Web Services, Inc. or its Affiliates. import … import Amplify from 'aws-amplify'; import { AmplifyAuthenticator, AmplifySignOut } from '@aws-amplify/ui-react'; import awsExports from "./aws-exports"; Amplify.configure(awsExports); … class App extends Component { render() { return ( <AmplifyAuthenticator> <div className="row"> <div className="col m-3"> <Header/> </div> </div> </AmplifyAuthenticator> ); } } export default App;
  • 28. © 2020, Amazon Web Services, Inc. or its Affiliates. #2 add an API
  • 29. © 2020, Amazon Web Services, Inc. or its Affiliates. /posts /comments /authors REST API posts comments authors GraphQL API What is GraphQL?
  • 30. © 2020, Amazon Web Services, Inc. or its Affiliates. Queries MutationsTypes Subscriptions GraphQL schema and operations type User { id: ID! username: String! firstName: String lastName: String daysActive: Int } A query language for APIs . . . and a runtime!
  • 31. © 2020, Amazon Web Services, Inc. or its Affiliates. A query language for APIs . . . Queries query GetPost { getPost(id: ”1”) { id title } } mutation CreatePost { createPost(title: “Summit”) { id title } } subscription OnCreatePost { onCreatePost { id title } } Mutations Subscriptions
  • 32. © 2020, Amazon Web Services, Inc. or its Affiliates.
  • 33. © 2020, Amazon Web Services, Inc. or its Affiliates. AppSync, a runtime to execute the query query GetPost { getPosts(id: ”1”) { id title comments { content } author { name } } } query GetPost { getPosts(id: ”1”) { id title comments { content } author { name } } } Amazon EC2 { "data" : { "posts" : [ { "id" : 1, "title" : "Introduction to GraphQL", "comments" : [ { "content" : "I want GraphQL for my next App!" } ], "author" : { "name" : "Sébastien Stormacq" } } ] } } Amazon DynamoDB AWS Lambda
  • 34. © 2020, Amazon Web Services, Inc. or its Affiliates. Provision the API $ amplify add api
  • 35.
  • 36.
  • 37.
  • 38. © 2020, Amazon Web Services, Inc. or its Affiliates. A basic schema type Note { id: ID! note: String! }
  • 39. © 2020, Amazon Web Services, Inc. or its Affiliates. Transformers (aka annotations) type Note @model @auth(rules: [{allow: owner}]){ id: ID! note: String! }
  • 40. © 2020, Amazon Web Services, Inc. or its Affiliates. GraphQL Transform: Mix and match data sources type Note { id: ID! note: String! }
  • 41. © 2020, Amazon Web Services, Inc. or its Affiliates. GraphQL Transform: Mix and match data sources type Note @model { id: ID! note: String! } Amazon DynamoDB AWS AppSync Mutations Queries createNote readNote updateNote deleteNote list
  • 42. © 2020, Amazon Web Services, Inc. or its Affiliates. GraphQL Transform: Mix and match data sources type Note @model @auth(rules: [{allow: owner}]){ id: ID! note: String! } Amazon DynamoDB AWS AppSync Mutations Queries Amazon Cognito createNote readNote updateNote deleteNote list
  • 43. © 2020, Amazon Web Services, Inc. or its Affiliates. Provision the API $ amplify push
  • 44.
  • 45.
  • 46. © 2020, Amazon Web Services, Inc. or its Affiliates.
  • 47. © 2020, Amazon Web Services, Inc. or its Affiliates.© 2020, Amazon Web Services, Inc. or its Affiliates. addNote = async (note) => { var result = await API.graphql(graphqlOperation(createNote, {input:note})); this.state.notes.push(result.data.createNote) this.setState( { notes: this.state.notes } ) }
  • 48. © 2020, Amazon Web Services, Inc. or its Affiliates. GraphQL API AWS Cloud AWS AppSync Amazon DynamoDB Table Schemas Resolvers Data Sources queries mutations getNote Note Table Datasource IAM Role ARN Note Role ARN type Query { getNote(...): Note listNotes(...): Note } type Mutation { createNote(...): Note updateNote(...): Note deleteNote(...): Note } type Subscription { onCreateNote (...): Note onUpdateNote (...): Note onDeleteNotet(...): Note } type Note { id: ID! value: String } Clients listNotes createNote deleteNote updateNote
  • 49. © 2020, Amazon Web Services, Inc. or its Affiliates.
  • 50. © 2020, Amazon Web Services, Inc. or its Affiliates. #3 add search capability
  • 51. © 2020, Amazon Web Services, Inc. or its Affiliates. Update GraphQL Transformer type Note @model @auth(rules: [{allow: owner}]) @searchable { id: ID! note: String! }
  • 52. © 2020, Amazon Web Services, Inc. or its Affiliates. GraphQL Transform: Mix and match data sources type Note @model @auth(rules: [{allow: owner}]) @searchable{ id: ID! note: String! } Amazon DynamoDB AWS AppSync Mutations Queries Amazon Cognito searchPosts Amazon Elasticsearch Service Lambda function createNote readNote updateNote deleteNote list
  • 53. © 2020, Amazon Web Services, Inc. or its Affiliates. Provision the service $ amplify push
  • 54. © 2020, Amazon Web Services, Inc. or its Affiliates.
  • 55. © 2020, Amazon Web Services, Inc. or its Affiliates.
  • 56. © 2020, Amazon Web Services, Inc. or its Affiliates.© 2020, Amazon Web Services, Inc. or its Affiliates. searchNote = async (note) => { var result; // when no search filter is passed, revert back to full list if (note.note === "") { result = await API.graphql(graphqlOperation(listNotes)); this.setState( { notes: result.data.listNotes.items } ) } else { // search const filter = { note: { match: note } } result = await API.graphql(graphqlOperation(searchNotes, {filter : filter})); if (result.data.searchNotes.items.length > 0) { this.setState( { notes : result.data.searchNotes.items } ); } else { // no search result, print help this.setState( { notes : [ {id: "-1", note: "No Match: Clear the search to go back to your Notes"} ] } ); } } }
  • 57. © 2020, Amazon Web Services, Inc. or its Affiliates. @searchable AWS Cloud AWS AppSync Amazon DynamoDB Table Schemas Resolvers Data Sources queries mutations getNote Note Table Datasource IAM Role ARN Note Role ARN type Query { getNote(...): Note listNotes(...): Note } type Mutation { createNote(...): Note updateNote(...): Note deleteNote(...): Note } type Subscription { onCreateNote (...): Note onUpdateNote (...): Note onDeleteNotet(...): Note } type Note { id: ID! value: String } Clients listNotes createNote deleteNote updateNote
  • 58. © 2020, Amazon Web Services, Inc. or its Affiliates. @searchable AWS Cloud AWS AppSync Amazon DynamoDB Table Schemas Resolvers Data Sources queries mutations getNote Note Table Datasource IAM Role ARN Note Role ARN type Query { getNote(...): Note listNotes(...): Note } type Mutation { createNote(...): Note updateNote(...): Note deleteNote(...): Note } type Subscription { onCreateNote (...): Note onUpdateNote (...): Note onDeleteNotet(...): Note } type Note { id: ID! value: String } Clients listNotes createNote deleteNote updateNote ElasticSearch Datasource IAM Role ARN ES Domain ARN Amazon ElasticSearch searchNotes
  • 59. © 2020, Amazon Web Services, Inc. or its Affiliates.
  • 60. © 2020, Amazon Web Services, Inc. or its Affiliates. #4 deploy the app
  • 61. © 2020, Amazon Web Services, Inc. or its Affiliates. Amplify console: Full-stack deployments $ amplify console
  • 62. © 2020, Amazon Web Services, Inc. or its Affiliates.
  • 63. © 2020, Amazon Web Services, Inc. or its Affiliates.
  • 64. © 2020, Amazon Web Services, Inc. or its Affiliates.
  • 65. © 2020, Amazon Web Services, Inc. or its Affiliates. Let’s try this https://bit.ly/3fTLQwG
  • 66. © 2020, Amazon Web Services, Inc. or its Affiliates. Get the code https://github.com/mavi888/demo-amplify-base
  • 67. © 2020, Amazon Web Services, Inc. or its Affiliates. Thanks! Q&A Marcia Villalba @mavi888uy