Skip to content

Kartikpawar143/React-App-with-Amplify-Gen-1-Cognito-and-CI-CD

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Create a Quiz using AWS Amplify and Cognito (with CI/CD)

Setuping new user

Open VS Code and create the folder.
install amplify using npm command.
npm install -g @aws-amplify/cli

Screenshot 2025-01-13 224649

Screenshot 2025-01-13 225255

Enter to continue and select the region (ap-south-1)

Screenshot 2025-01-13 225612

Screenshot 2025-01-13 225947

Open IAM User and Specify user details.

Screenshot 2025-01-13 230029

Enter user name (Amplify-dev).
Enter next.

Screenshot 2025-01-13 230216

Step 2nd is to set the permissions.

Screenshot 2025-01-13 230225

Select the permission option - Attach policies directly.
Select permission policies - AdministratorAccess-Amplify.
Then Next.

Screenshot 2025-01-13 230338

Review and create the user.

Screenshot 2025-01-13 230530

Screenshot 2025-01-13 230542

Open User (Amplify-dev) the scroll down

Screenshot 2025-01-13 230739

click on create access key.

Screenshot 2025-01-13 230840

Select CLI then next

Screenshot 2025-01-13 230928

Click on create access key.

Screenshot 2025-01-13 231000

Copy the access key and secret access key.

Screenshot 2025-01-13 231016

Past both keys here.

Screenshot 2025-01-13 231110

Succesfully setup the new user.

Screenshot 2025-01-13 231224

npm create-react-app my-quiz-app

Screenshot 2025-01-14 214700

use- cd my-quiz-app

Screenshot 2025-01-14 215741

amplify init
yes

Screenshot 2025-01-14 215909

Screenshot 2025-01-14 220158

Screenshot 2025-01-14 220239

Search Amplify AWS.

Screenshot 2025-01-14 221524

Open Amplify Aws.

Screenshot 2025-01-14 221616

ther is myquizapp.

Screenshot 2025-01-14 221903

Screenshot 2025-01-14 221944

Screenshot 2025-01-14 222629

Search Cognito.

Screenshot 2025-01-14 223118

One user pool is created.

Screenshot 2025-01-14 223132

Open VS code.

Screenshot 2025-01-14 224207

Open the terminal.

Screenshot 2025-01-14 224223

Write npm start command to start the reactjs service.

Screenshot 2025-01-14 224937

Fill the Details.

Screenshot 2025-01-14 224948

Screenshot 2025-01-14 225018

Enter the code which is send on your email.

Screenshot 2025-01-14 225033

Screenshot 2025-01-14 225108

Screenshot 2025-01-14 225118

Sign in.

Screenshot 2025-01-14 225139

Screenshot 2025-01-14 225316

Screenshot 2025-01-14 225923

Screenshot 2025-01-14 230116

Screenshot 2025-01-14 230148

Create repository.
Name it "amplify-cogniti-quiz2".

Screenshot 2025-01-14 230605

git add .

Screenshot 2025-01-14 230854

git commit -m "Initial Commit"

Screenshot 2025-01-14 231042

git branch - to check the branch.
git branch -M main - to create main branch and keep it default.

Screenshot 2025-01-14 231340

follow the following commands 👇
git add .
git rebase --continue
git push origin main

Screenshot 2025-01-15 000227

Navigate to Amplify then myquizapp.

Screenshot 2025-01-15 000448

Choose source code provider.
Github
then click on next.

Screenshot 2025-01-15 000459

Install and Authorize on your git account.
click on only select repository.
select your repository.

Screenshot 2025-01-15 000542

Click on Install and Authorize.

Screenshot 2025-01-15 000557

Add repo and branch.

Screenshot 2025-01-15 000725

Give the app name "myquizapp",
Frontend build command "npm run build",
Build output directory "build".

Screenshot 2025-01-15 001017

For service role we have to create the role.

Screenshot 2025-01-15 001133

Go to IAM service
Select AWS Service
In the use case select the Amplify option.

Screenshot 2025-01-15 001157

Add permissions
AdministratorAccess-Amplify.
click on next

Screenshot 2025-01-15 001206

name the role "amplifyconsole-backend-role1"
review and create.

Screenshot 2025-01-15 001246

Screenshot 2025-01-15 001252

Go to the Amplify > myquizapp > Add branch
App settings - add service role "amplifyconsle-backend-role1"

Screenshot 2025-01-15 001338

Review
Save and Deploy

Screenshot 2025-01-15 001401

Deploying the app is in process

Screenshot 2025-01-15 001409

myquizeapp is deployed.
copy the domain and paste it on the browser.

Screenshot 2025-01-15 001757

Our application is running

Screenshot 2025-01-15 001839

Screenshot 2025-01-15 002007

Screenshot 2025-01-15 002022

Screenshot 2025-01-15 002157

Screenshot 2025-01-15 002212

Screenshot 2025-01-15 002656

You have successfully Builded a simple React app (a quiz app) using AWS Amplify Gen 1 and Cognito.

  • App.js: The React application that's configured to use Cognito for authentication
  • Quiz.js: The Quiz component
  • quizData.js: The hard-coded questions and answers for the quiz

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published