Become a member
to unlock all features

Level Up!

Access all courses & lessons on egghead today and lock-in your price for life.


    Deploying Existing AWS Amplify Projects using the Amplify CLI

    react-nativeReact Native

    In this video, we'll learn how to deploy an existing React Native application with user authentication powered by AWS Amplify and a navigation flow built around the authentication state using React Navigation.



    Become a Member to view code

    You must be a Pro Member to view code

    Access all courses and lessons, track your progress, gain confidence and expertise.

    Become a Member
    and unlock code for this lesson
    orLog In




    Instructor: To get started, we'll need to begin with an existing Amplify project. For this example, we'll head over to the AWS samples repository and clone the AWS Amplify Auth Starters repo.

    Next, we'll change into the cloned repo and check out the React to Native branch. In this project, we'll notice that we have an existing Amplify project that contains a back-end folder. To deploy this project, we can now run Amplify in it. Here, we'll choose the environment name, the default text editor, and the AWS profile we'd like to use.

    Once the Amplify project has been initialized, we can run Amplify status to see the current status of the project. To deploy the resources into our account, we can now run Amplify push. If the deployment is successful, we'll see a message that says that all resources are updated in the cloud.

    We can now test the application now by running it locally. To do so, we'll first need to install the dependencies by running MPM install. Next, we can run the React Native application by running either React Native Run iOS or React Native Run Android.

    When the app launches, we should now see a sign-in screen. Let's click Sign Up to create a new account. After signing up, check your email for an MFA code. Enter your MFA code, and click Confirm Sign-up. We should now be able to sign in using the user name and password we used when we signed up.

    After we've logged into the application, we can now navigate between the routes. After signing in, if we refresh the application, we notice that the user stays signed in because the user information has persisted locally. If we click Sign Out, we're redirected back to the sign-in screen.