100% found this document useful (1 vote)
12 views

Serverless Web Applications with AWS Amplify: Build Full-Stack Serverless Applications Using Amazon Web Services 1st Edition Akshat Paul download

Ebook installation

Uploaded by

hajzilikoka
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
12 views

Serverless Web Applications with AWS Amplify: Build Full-Stack Serverless Applications Using Amazon Web Services 1st Edition Akshat Paul download

Ebook installation

Uploaded by

hajzilikoka
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 52

Serverless Web Applications with AWS Amplify:

Build Full-Stack Serverless Applications Using


Amazon Web Services 1st Edition Akshat Paul pdf
download
https://ebookmeta.com/product/serverless-web-applications-with-
aws-amplify-build-full-stack-serverless-applications-using-
amazon-web-services-1st-edition-akshat-paul/

Download more ebook from https://ebookmeta.com


We believe these products will be a great fit for you. Click
the link to download now, or visit ebookmeta.com
to discover even more!

Programming AWS Lambda Build and Deploy Serverless


Applications with Java 1st Edition John Chapin

https://ebookmeta.com/product/programming-aws-lambda-build-and-
deploy-serverless-applications-with-java-1st-edition-john-chapin/

Practical Rust Projects: Build Serverless, AI, Machine


Learning, Embedded, Game, and Web Applications 2nd
Edition Shing Lyu

https://ebookmeta.com/product/practical-rust-projects-build-
serverless-ai-machine-learning-embedded-game-and-web-
applications-2nd-edition-shing-lyu/

Beginning Django API with React Build Django 4 Web APIs


with React Full Stack Applications 1st Edition Greg Lim
Daniel Correa

https://ebookmeta.com/product/beginning-django-api-with-react-
build-django-4-web-apis-with-react-full-stack-applications-1st-
edition-greg-lim-daniel-correa/

Polymorphism in Crystals Jingxiang Yang Xin Huang

https://ebookmeta.com/product/polymorphism-in-crystals-jingxiang-
yang-xin-huang/
Economics of Public Health: Measuring the Economic
Impact of Diseases Burton A. Weisbrod

https://ebookmeta.com/product/economics-of-public-health-
measuring-the-economic-impact-of-diseases-burton-a-weisbrod/

Electric Vehicles and Renewable Generation Power System


Operation and Planning Under Uncertainty 1st Edition
Luis Baringo Miguel Carrión Ruth Domínguez

https://ebookmeta.com/product/electric-vehicles-and-renewable-
generation-power-system-operation-and-planning-under-
uncertainty-1st-edition-luis-baringo-miguel-carrion-ruth-
dominguez/

Defeating The Black Worm 1st Edition Paul Flewitt

https://ebookmeta.com/product/defeating-the-black-worm-1st-
edition-paul-flewitt/

Algebras Lattices Varieties Volume II 1st Edition Ralph


S. Freese

https://ebookmeta.com/product/algebras-lattices-varieties-volume-
ii-1st-edition-ralph-s-freese/

Insight Guides Explore Singapore Travel Guide eBook


2nd Edition Insight Guides

https://ebookmeta.com/product/insight-guides-explore-singapore-
travel-guide-ebook-2nd-edition-insight-guides/
Business Financial Planning With Microsoft Excel 1st
Edition Gavin Powell

https://ebookmeta.com/product/business-financial-planning-with-
microsoft-excel-1st-edition-gavin-powell/
Serverless Web

Applications with

AWS Amplify

Build Full-Stack Serverless

Applications Using Amazon

Web Services

Akshat Paul

Mahesh Haldar

Serverless Web Applications with AWS Amplify: Build Full-


Stack Serverless

Applications Using Amazon Web Services

Akshat Paul

Mahesh Haldar

Gurgaon, Haryana, India

Bahraich, Uttar Pradesh, India

ISBN-13 (pbk): 978-1-4842-8706-4

ISBN-13 (electronic): 978-1-4842-8707-1

https://doi.org/10.1007/978-1-4842-8707-1

Copyright © 2023 by Akshat Paul, Mahesh Haldar

This work is subject to copyright. All rights are reserved by the


Publisher, whether the whole or part of the material is concerned,
specifically the rights of translation, reprinting, reuse of illustrations,
recitation, broadcasting, reproduction on microfilms or in any other
physical way, and transmission or information storage and retrieval,
electronic adaptation, computer software, or by similar or dissimilar
methodology now known or hereafter developed.

Trademarked names, logos, and images may appear in this book.


Rather than use a trademark symbol with every occurrence of a
trademarked name, logo, or image we use the names, logos, and
images only in an editorial fashion and to the benefit of the
trademark owner, with no intention of infringement of the trademark.

The use in this publication of trade names, trademarks, service


marks, and similar terms, even if they are not identified as such, is
not to be taken as an expression of opinion as to whether or not they
are subject to proprietary rights.

While the advice and information in this book are believed to be true
and accurate at the date of publication, neither the authors nor the
editors nor the publisher can accept any legal responsibility for any
errors or omissions that may be made. The publisher makes no
warranty, express or implied, with respect to the material contained
herein.

Managing Director, Apress Media LLC: Welmoed Spahr

Acquisitions Editor: James Robinson-Prior

Development Editor: James Markham

Coordinating Editor: Jessica Vakili

Distributed to the book trade worldwide by Springer


Science+Business Media New York, 233 Spring Street, 6th Floor, New
York, NY 10013. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail
orders-ny@springer-sbm.com, or visit www.springeronline.com.
Apress Media, LLC is a California LLC and the sole member (owner) is
Springer Science + Business Media Finance Inc (SSBM Finance Inc).
SSBM Finance Inc is a Delaware corporation.

For information on translations, please e-mail


booktranslations@springernature.com; for reprint, paperback, or
audio rights, please e-mail bookpermissions@springernature.com.

Apress titles may be purchased in bulk for academic, corporate, or


promotional use. eBook versions and licenses are also available for
most titles. For more information, reference our Print and eBook Bulk
Sales web page at http://www.apress.com/bulk-sales.

Any source code or other supplementary material referenced by the


author in this book is available to readers on the Github repository:
https://github.com/haldarmahesh/amplify-book. For more detailed
information, please visit http://www.apress.com/source-code.

Printed on acid-free paper

Table of Contents

About the Authors


�������������������������������
�������������������������������
�������������������������������
������� ix Acknowledgments
�������������������������������
�������������������������������
�������������������������������
������ xi Introduction
�������������������������������
�������������������������������
�������������������������������
�������������� xiii Chapter 1: Introduction to
Serverless���������������������������
�������������������������������
������������� 1
A Little Background
�������������������������������
�������������������������������
�������������������������������
�������������������������� 1

Rise of Cloud Computing


�������������������������������
�������������������������������
�������������������������������
������������������ 3

Key Advantages of Cloud Environments


�������������������������������
�������������������������������
�������������������� 4

The Emergence of Serverless Computing: A Game- Changer for Cloud


Development������������������� 5

Backend As a Service
(BaaS)����������������������������
�������������������������������
�������������������������������
��������� 6

Function As a Service/Serverless Computing


�������������������������������
�������������������������������
������������ 8

Benefits and Weaknesses of a Serverless Architecture


�������������������������������
������������������������� 10

Benefits of Serverless Architecture


�������������������������������
�������������������������������
������������������������� 10

Weaknesses of Serverless
�������������������������������
�������������������������������
�������������������������������
������� 12

AWS Amplify Introduction


�������������������������������
�������������������������������
�������������������������������
��������������� 13

Local Setup
�������������������������������
�������������������������������
�������������������������������
�������������������������������
����� 14

Setting Up AWS Amplify CLI


�������������������������������
�������������������������������
�������������������������������
������ 15

Summary���������������������������
�������������������������������
�������������������������������
�������������������������������
������������� 22

Chapter 2: UI Component and Authentication


�������������������������������
�������������������������� 23
Authentication Basics
�������������������������������
�������������������������������
�������������������������������
�������������������� 23

What Is Authentication?
�������������������������������
�������������������������������
�������������������������������
������������ 24

How Can Users Prove Credibility?


�������������������������������
�������������������������������
��������������������������� 24

What Is Authorization?
�������������������������������
�������������������������������
�������������������������������
������������������� 25

Broken Authentication
�������������������������������
�������������������������������
�������������������������������
�������������� 27

Types of Authentication
�������������������������������
�������������������������������
�������������������������������
������������ 28

Why MFA Is Important


�������������������������������
�������������������������������
�������������������������������
�������������� 30

iii

Table of ConTenTs

Types of MFA
�������������������������������
�������������������������������
�������������������������������
���������������������������� 31

JSON Web Tokens


�������������������������������
�������������������������������
�������������������������������
��������������������� 32

JWT Authentication Flow


�������������������������������
�������������������������������
�������������������������������
���������� 33

JWT Structure
�������������������������������
�������������������������������
�������������������������������
��������������������������� 34

Setting Up Authentication Using AWS Amplify


�������������������������������
�������������������������������
�������������� 35
Creating Our React App
�������������������������������
�������������������������������
�������������������������������
������������ 36

Configuring the Backend for Our React Application


�������������������������������
�������������������������������
37

Setting Up Authentication
�������������������������������
�������������������������������
�������������������������������
�������������� 41

Creating an Auth Service


�������������������������������
�������������������������������
�������������������������������
���������� 42

Amplify UI React Components


�������������������������������
�������������������������������
�������������������������������
�� 43

Integrating Auth with React App


�������������������������������
�������������������������������
������������������������������ 45

Logging In and Logging Out


�������������������������������
�������������������������������
�������������������������������
������ 51

OAuth Social Login


�������������������������������
�������������������������������
�������������������������������
������������������������� 57

What Is OAuth?
�������������������������������
�������������������������������
�������������������������������
������������������������� 58

Setting Up React App


�������������������������������
�������������������������������
�������������������������������
���������������� 71

Summary���������������������������
�������������������������������
�������������������������������
�������������������������������
������������� 72

Chapter 3: CRUD and REST APIs – Pillars of Efficient Data Exchange


�������������������� 75

API Overview
�������������������������������
�������������������������������
�������������������������������
�������������������������������
��� 75
Why Do We Need an API?
�������������������������������
�������������������������������
�������������������������������
��������� 77

API Design
�������������������������������
�������������������������������
�������������������������������
�������������������������������
� 78

Types of APIs
�������������������������������
�������������������������������
�������������������������������
���������������������������� 79

API Specifications and Protocols


�������������������������������
�������������������������������
����������������������������� 79

Introduction to Lambda
�������������������������������
�������������������������������
�������������������������������
������������������ 80

Lambda Functions – The Serverless Functions


�������������������������������
�������������������������������
������� 80

Lambda Functions
�������������������������������
�������������������������������
�������������������������������
�������������������� 81

Use Cases of Lambda Functions


�������������������������������
�������������������������������
����������������������������� 82

Cons of Using Lambda Functions


�������������������������������
�������������������������������
���������������������������� 82

How Lambda Function Works


�������������������������������
�������������������������������
�������������������������������
��� 82

What Is the Lambda Layer?


�������������������������������
�������������������������������
�������������������������������
������ 83

iv

Table of ConTenTs

Working with REST APIs


�������������������������������
�������������������������������
�������������������������������
����������������� 85
Saving the File
�������������������������������
�������������������������������
�������������������������������
�������������������������� 92

PUT API to Update Items


�������������������������������
�������������������������������
�������������������������������
����������� 97

Using the Delete API to Delete an Item by ID


�������������������������������
�������������������������������
����������� 99

Summary���������������������������
�������������������������������
�������������������������������
�������������������������������
����������� 100

Chapter 4: Integrating REST APIs with a Frontend React App


������������������������������
101

Creating a Basic React ToDo App


�������������������������������
�������������������������������
�������������������������������
� 101

Adding a New Item


�������������������������������
�������������������������������
Exploring the Variety of Random
Documents with Different Content
back
back
back
back
back
back
back
back
back
back
back
back
back
back
back
back
back
back
back
back
back
back
back
back
back
back
back
back
back
back
back
back

You might also like