- Notifications
You must be signed in to change notification settings - Fork297
An Angular(v5)-based QuickStart single-page app utilizing Amazon Cognito, S3, and DynamoDB (Serverless architecture)
License
amazon-archives/aws-cognito-angular-quickstart
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
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.
- Create an AWS account
- Installnpm
- Install or update your aws cli
- Install or update your eb cli
- Install angular-cli
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 startThis 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.shRunning 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
# 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
# Commit your changes in order to deploy it to your environmentgit add .git commiteb deploy# View your deployed application in a browsereb openThis section contains instructions on how to test the application locally (using mocked services instead of the real AWS services).
To test this application usingLocalStack, you can use theawslocal CLI (https://github.com/localstack/awscli-local).
pip install awscli-localSimply parameterize the./createResources.sh installation script withaws_cmd=awslocal:
cd aws; aws_cmd=awslocal ./createResources.shOnce 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
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Contributors9
Uh oh!
There was an error while loading.Please reload this page.
