Full Stack Serverless

Book description

Cloud computing is typically associated with backend development and DevOps. But with the rise of serverless technologies and a new generation of services and frameworks, frontend and mobile developers can build robust applications with production-ready features such as authentication and authorization, API gateways, chatbots, augmented reality scenes, and more. This hands-on guide shows you how.

Nader Dabit, developer advocate at Amazon Web Services, guides you through the process of building full stack applications using React, AWS, GraphQL, and AWS Amplify. You’ll learn how to create and incorporate services into your client applications while learning general best practices, deployment strategies, rich media management, and continuous integration and delivery along the way.

  • Learn how to build serverless applications that solve real problems
  • Understand what is (and isn’t) possible when using these technologies
  • Create a GraphQL API that interacts with DynamoDB and a NoSQL database
  • Examine how authentication works—and learn the difference between authentication and authorization
  • Get an in-depth view of how serverless functions work and why they’re important
  • Build full stack applications on AWS and create offline apps with Amplify DataStore

Table of contents

  1. Preface
    1. Why I Wrote This Book
    2. Who This Book Is For
    3. How This Book Is Organized
    4. Conventions Used in This Book
    5. Using Code Examples
    6. O’Reilly Online Learning
    7. How to Contact Us
    8. Acknowledgments
  2. 1. Full Stack Development in the Era of Serverless Computing
    1. Modern Serverless Philosophy
      1. Characteristics of a Serverless Application
      2. Benefits of a Serverless Architecture
      3. Different Implementations of Serverless
    2. Introduction to AWS
      1. About AWS
      2. Full Stack Serverless on AWS
      3. Amplify CLI
    3. Introduction to the AWS Amplify CLI
      1. Installing and Configuring the Amplify CLI
      2. Initializing Your First Amplify Project
      3. Creating and Deploying Your First Service
      4. Deleting the Resources
    4. Summary
  3. 2. Getting Started with AWS Amplify
    1. Creating and Deploying a Serverless Function
      1. Creating the React Application and Installing the Dependencies
      2. Creating a New Serverless Function with the Amplify CLI
      3. Walking Through the Code
      4. Creating the /coins Route
    2. Adding the API
      1. Creating a New API
      2. Deploying the API and the Lambda Function
    3. Interacting with the New API
      1. Configuring the Client App to Work with Amplify
      2. The Amplify Client API Category
      3. Calling the API and Rendering the Data in React
    4. Updating the Function to Call Another API
      1. Installing Axios
      2. Updating the Function
      3. Updating the Client App
    5. Summary
  4. 3. Creating Your First App
    1. Introduction to GraphQL
      1. What Is GraphQL?
      2. What Makes Up a GraphQL API?
      3. GraphQL Operations
    2. Creating the GraphQL API
    3. Viewing and Interacting with the GraphQL API
    4. Building the React Application
      1. Listing Notes (GraphQL Query)
      2. Creating Notes (GraphQL Mutation)
      3. Deleting Notes (GraphQL Mutation)
      4. Updating Notes (GraphQL Mutation)
      5. Real-Time Data (GraphQL Subscriptions)
    5. Summary
  5. 4. Introduction to Authentication
    1. Introduction to Amazon Cognito
      1. How Amazon Cognito Works
      2. Amazon Cognito Integration with AWS Amplify
    2. Creating the React App and Adding Amplify
      1. Client Authentication Overview
    3. Building the App
      1. Creating the File and Folder Structure
      2. Creating the First Component
      3. Public Component
      4. Nav Component
      5. Protected Component
      6. Router Component
      7. Profile Component
      8. Styling the UI Components
      9. Configuring the App
      10. Testing the App
    4. Summary
  6. 5. Custom Authentication Strategies
    1. Creating the protectedRoute Hook
    2. Creating the Form
      1. SignIn Component
      2. SignUp Component
      3. ConfirmSignUp Component
      4. ForgotPassword Component
      5. ForgotPasswordSubmit Component
      6. Completing Form.js
      7. updateForm Helper Function
      8. renderForm Function
      9. Form Type Toggles
      10. Updating the Profile Component
      11. Testing the App
    3. Summary
  7. 6. Serverless Functions In-Depth: Part 1
    1. Event Sources and Data Structure
      1. API Gateway Event
      2. Amazon S3 Event
      3. Amazon Cognito Event
    2. IAM Permissions and Trigger Configuration
    3. Creating the Base Project
    4. Adding a Post-Confirmation Lambda Trigger
    5. Dynamic Image Resizing with AWS Lambda and Amazon S3
      1. Adding the Custom Logic for Resizing the Image
      2. Uploading Images from the React Application
    6. Summary
  8. 7. Serverless Functions In-Depth: Part 2
    1. What We’ll Build
    2. Getting Started
    3. Adding Authentication and Group Privileges
    4. Adding the Database
    5. Adding the API
    6. Creating the Frontend
      1. Container Component
      2. checkUser Function
      3. Nav Component
      4. Profile Component
      5. Router Component
      6. Admin Component
      7. Main Component
    7. Testing It Out
    8. Summary
  9. 8. AWS AppSync In-Depth
    1. Building Skills for GraphQL, AppSync API, and React Router
      1. Relationships Between GraphQL Types
      2. Multiple Authentication Types
      3. Authorization
      4. Custom Data Access Patterns Using GSIs
    2. Starting to Build the App
    3. Creating the Amplify App and Adding the Features
    4. Building the Backend
      1. Authentication
      2. The AppSync API
    5. Deploying the Services
    6. Building the Frontend
      1. Container
      2. Footer
      3. Nav
      4. Admin
      5. Router
      6. Performance
      7. Home
    7. Summary
  10. 9. Building Offline Apps with Amplify DataStore
    1. About Amplify DataStore
      1. Amplify DataStore Overview
      2. Amplify DataStore Operations
      3. DataStore Predicates
    2. Building an Offline and Real-Time App with Amplify DataStore
      1. Creating the Base Project
      2. Creating the API
      3. Writing the Client-Side Code
      4. Testing the Offline Functionality
      5. Testing the Real-Time Functionality
    3. Summary
  11. 10. Working with Images and Storage
    1. Using Amazon S3
      1. Creating the Base Project
      2. Adding Authentication
      3. Creating the API
      4. Writing the Client-Side Code
    2. Summary
  12. 11. Hosting: Deploying Your Application to the Amplify Console with CI and CD
    1. CLI-Based Deployments
    2. Git-Based Deployments
      1. Creating the GitHub Repository
      2. Git-Based CI/CD
    3. Access Control
    4. Custom Domains
    5. Summary
  13. Index

Product information

  • Title: Full Stack Serverless
  • Author(s): Nader Dabit
  • Release date: July 2020
  • Publisher(s): O'Reilly Media, Inc.
  • ISBN: 9781492059844