Coder Social home page Coder Social logo

jww / create-react-app-auth-amplify Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aws-samples/create-react-app-auth-amplify

0.0 2.0 0.0 5.78 MB

Implements a basic authentication flow for signing up/signing in users as well as protected client side routing using AWS Amplify.

License: MIT No Attribution

HTML 18.37% CSS 9.80% JavaScript 71.83%

create-react-app-auth-amplify's Introduction

Create-react-app with AWS Amplify Auth

This auth starter implements withAuthenticator HOC to provide a basic authentication flow for signing up signing in users as well as protected client side routing using AWS Amplify. Auth features: User sign up, User sign in, Multi-factor Authentication, User sign-out.

View Demo

Amplify Auth

Getting started

  1. Fork repo

  2. Clone locally

git clone [email protected]:<your-username>/create-react-app-auth-amplify.git
  1. Change into the new directory
cd create-react-app-auth-amplify
  1. Install dependencies
yarn
# or
npm install
  1. Install & configure the AWS Amplify CLI.
npm install -g @aws-amplify/cli

amplify configure

To see a video of how to configure the CLI, click here

  1. Create a new AWS Amplify Project
amplify init

Here, walk through the following steps. At the end of the init command a project will be initialized in the cloud for you.

  • Enter a name for the environment master
  • Choose your default editor: Sublime Text (or your editor of choice)
  • Do you want to use an AWS profile? y (choose default)
  1. Run amplify status. The status should reflect as below. This indicates that an Auth resource is configured and ready to be created.
| Category | Resource name   | Operation | Provider plugin   |
| -------- | --------------- | --------- | ----------------- |
| Auth     | cognito2140b2f3 | Create    | awscloudformation |
  1. Push the updated project configuration to AWS. It will deploy a CloudFormation template that has an Amazon Cognito resource that enables user authentication.
amplify push
  1. Then you can run it by:
npm start

Hosting with the AWS Amplify Console

The AWS Amplify Console provides continuous deployment and hosting for modern web apps (single page apps and static site generators). Continuous deployment allows developers to deploy updates to their frontend and backend on every code commit to their Git repository. If the build succeeds, the app is deployed and hosted on a global CDN with an amplifyapp.com domain. The Amplify Console offers globally available CDNs, easy custom domain setup, feature branch deployments, and password protection.

  1. Push your code to Git.
  2. Login to the AWS Amplify Console and choose Connect app
  3. Connect repository and select master branch.
  4. Accept the default build settings.
  5. Give the Amplify Console permission to deploy backend resources with your frontend. This will allow the Console to detect changes to your backend on every code commit. If you do not have a service role, follow the prompts to create one.
  6. Review your changes and then choose Save and deploy. You app will now be available in a few minutes at https://master.unique-id.amplifyapp.com.

The Amplify Console will first check for changes to your backend, and then build and deploy your frontend to a managed hosting environment. You can now continuously deploy changes to your frontend or backend and Amplify will automatically deploy those changes. Learn how to customize the sign-in UI here.

Amplify Console

create-react-app-auth-amplify's People

Contributors

hyandell avatar swaminator avatar

Watchers

 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.