Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jun 26, 2020. It is now read-only.

An Angular(v5)-based QuickStart single-page app utilizing Amazon Cognito, S3, and DynamoDB (Serverless architecture)

License

NotificationsYou must be signed in to change notification settings

amazon-archives/aws-cognito-angular-quickstart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Creator: Vladimir Budilov

Note: This repo is deprecated. It was created before theAmplify SDK was available which performs a lot of the plumbing for you. Please use theAmplify SDK going forward.Here's an example of its use with ReactJS as well.

What does this app do?

QuickStart Angular2 Cognito App

Tech Stack

Required Tools

Frameworks

AWS Setup

Install the required tools (the installation script only runs on Linux and Mac)

Getting the code and running it locally

This uses the pre-configured AWS resources hosted by AWS

# Clone it from githubgit clone --depth 1 git@github.com:awslabs/aws-cognito-angular2-quickstart.git
# Install the NPM packagescd aws-cognito-angular2-quickstartnpm install
# Run the app in dev modenpm start

Creating AWS Resources

This sample application can be deployed to either Elastic Beanstalk or S3. S3 will host this application as a static sitewhile Elastic Beanstalk gives you the capability of adding backend operations to the application.

createResources.sh requires youraws cli to be configured for JSON output.

# Install the AWS resources and deploy your application to either Elastic Beanstalk or S3cd aws./createResources.sh

Running the above command will create the necessary AWS resources and build & deploy your code to AWS.It will prompt you to choose your deployment target (S3 or Elastic Beanstalk). Choosing 'S3' makes your deploymentcompletely serverless, while choosing Elastic Beanstalk will create an EC2 instance that will host this NodeJS app.

Caution: You might incur AWS charges after running the setup script

After initially running thecreateResources.sh script, use the below commands to rebuild and redeploy

S3: Update, Build and Deploy

# Build the project and sync the output with the S3 bucketnpm run build; cd dist; aws s3 sync . s3://[BUCKET_NAME]/
# Test your deployed applicationcurl –I http://[BUCKET_NAME].s3-website-[REGION].amazonaws.com/

NOTE: You might want to reshuffle some of the "package.json" dependencies and move the ones that belong to devDependenciesfor a leaner deployment bundle. At this point of time, AWS Beanstalk requires all of the dependencies,including the devDependencies to be under the dependencies section. But if you're not using Beanstalk then you canoptimize as you wish.

or

Beanstalk: Update, Build and Deploy

# Commit your changes in order to deploy it to your environmentgit add .git commiteb deploy
# View your deployed application in a browsereb open

Local Testing

This section contains instructions on how to test the application locally (using mocked services instead of the real AWS services).

LocalStack

To test this application usingLocalStack, you can use theawslocal CLI (https://github.com/localstack/awscli-local).

pip install awscli-local

Simply parameterize the./createResources.sh installation script withaws_cmd=awslocal:

cd aws; aws_cmd=awslocal ./createResources.sh

Once the code is deployed to the local S3 server, the application is accessible viahttp://localhost:4572/cognitosample-localapp/index.html (Assuming "localapp" has been chosen as resource name in the previous step)

About

An Angular(v5)-based QuickStart single-page app utilizing Amazon Cognito, S3, and DynamoDB (Serverless architecture)

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors9


[8]ページ先頭

©2009-2025 Movatter.jp