Giter Site home page Giter Site logo

kristianmandrup / aws-amplify-graphql Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aws-samples/aws-amplify-graphql

0.0 3.0 0.0 5.98 MB

Sample using AWS Amplify and AWS AppSync together for user login and authorization when making GraphQL queries and mutations. Also includes complex objects for uploading and downloading data to and from S3 with a React app.

License: Other

HTML 10.04% CSS 2.75% JavaScript 87.20%

aws-amplify-graphql's Introduction

AWS AppSync GraphQL Photo Sample

Please submit issues to the appsync-sdk-js repository.

Demo

This sample application shows how to use GraphQL to build an application that a user can login to the system, then upload and download photos which are private to them. The sample is written in React and uses AWS AppSync, Amazon Cognito, Amazon DynamoDB and Amazon S3 as well as the AWS Mobile CLI.

Architecture Overview

Architecture

Prerequisites

  • AWS Account

  • NodeJS with NPM

  • AWS Mobile CLI v1.1.0

    • npm install -g awsmobile-cli
    • awsmobile configure aws
      • Configure your access and secret keys of your aws account that has AppSync permissions (or AdminAccess) and your preferred region.
      • If you never used AWS MobileHub before, awsmobile-cli will pop-up a Web Browser Window to enable MobileHub on your account.

Getting Started

  1. Clone this repo locally.

  2. Go to the photo-client folder inside of the cloned repo.

cd ./photo-client
  1. Run awsmobile init with default settings
awsmobile init --yes
  1. Configure Amazon Cognito User Pool as authentication type
awsmobile appsync configure
  • Select AMAZON_COGNITO_USER_POOLS
  • Confirm defaults
  1. Update changes
awsmobile push
  1. Run your app
awsmobile run

The awsmobile-cli will create your Amazon Cognito User Pool and Identity Pool, an Amazon S3 bucket with private directories to store each user's photo and an AWS AppSync API that uses Amazon DynamoDB to store data.

The sample uses AWS Amplify to perform the Sign-Up and Sign-In flows with a Higher Order Component.

If the application runs successfully you should be able to enter the name of a photo, choose a file and then press Add photo. This will make a GraphQL call to enter the record into the database and simultaneously upload the object to S3. An immediate fetch of the record will then be at the bottom of the screen.

aws-amplify-graphql's People

Contributors

elorzafe avatar jordanranz avatar ryan-mars avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.