Skip to content

Latest commit

 

History

History
110 lines (64 loc) · 4.04 KB

File metadata and controls

110 lines (64 loc) · 4.04 KB

React Container App Deployment

React Container App is the App responsible for Micro-Frontend Apps integration. Both React and Angular apps are being imported as a remote and leveraged in the Container App.

React Container App also uses AWS Cognito for user Authentication.

AWS Amplify is leveraged hosting the app, configuring the CI/CD, and setting up AWS Cognito for user Authentication.

Prerequisite

Deployment on AWS

React Container App Architecture

Deployment of the above architecture on AWS

Step 1: Clone Repository

git clone https://github.com/aws-samples/micro-frontend-using-polyglot-javascript-frameworks.git
cd micro-frontend-using-polyglot-javascript-frameworks/react-container-app

Step 2: Install Dependencies

npm install

Step 3: Initialize AWS Amplify

amplify init

react-container-app-init

Step 4: Add Authentication

amplify add auth

Select the options as present in the screenshot

react-container-app-auth

Step 5: Push local amplify changes to AWS

Push the local changes to AWS, and Amplify would create resources needed for the Authentication (AWS Cognito, IAM Role, Lambda Function)

amplify push

react-container-app-push-auth

Step 6: Add CI/CD and Deploy App

amplify add hosting

Amplify hosting will ask a few questions, select the answers as present in the screenshot:

react-container-app-add-hosting

After selecting the options, Amplify CLI would open Amplify console on the default web browser.

Step 6a: Setting up Hosting Environment

Click on Hosting environments and Select AWS CodeCommit. Click "Connect Branch"

react-container-app-hosting-environments

Step 6b: Setting up Repository

Select microfrontend-react-container-app repository from the drop down and select main branch.

react-container-amplify-setting-repository

Step 6c: Configure the Build Setting

react-container-amplify-build-setting-1 react-container-amplify-build-setting-2

Step 6d: Review the CI/CD and Build Setting

Review the setting and click on Save and Deploy

react-container-app-amplify-review-and-save

Step 7: Getting the React Container App endpoint

After completing Step 6d, come back to the existing terminal and hit enter. You can see the Frontend App Domain.

react-container-app-amplify-app-domain

Frontend Domain is the Container application, open it on the Browser and try out the Micro-Frontend App.

chart-app

Lets' go back.