Recently, I tried amazon’s aws-serverless-auth-reference-app app to check best practices to connect with DynamoDB from a mobile or web-app. While the concept (and the app) is cool, and there is a video (https://www.youtube.com/watch?v=n4hsWVXCuVI) to explain it all, I still felt a need to have a quick-start quide to help spin it fast.
The App consists of two parts:
- API part will get deployed to AWS. It comes with a CloudFormation template to make is easier for you.
- APP is your Ionic2 app.
Deploying API to AWS
- Install node.js and python (You will need ‘pip’ to install aws-cli)
- Create a user in AWS IAM and give appropriate permissions. If you are not sure what permission to give and only deploying the app for testing purpose, then give ‘AdministratorAccess’ permission. Further, it’s a good practice to create separate groups for permission management.
- Install AWS-CLI and run ‘aws configure’ to configure API access.
- Then follow the instruction on this page ( https://github.com/awslabs/aws-serverless-auth-reference-app/blob/master/DevGuide.md ) to setup the API part.
Once the API part is done, we can quickly spin our Ionic2 app to test the setup.
Run the App
- Go to the app directory ‘cd aws-serverless-auth-reference-app/app’.
- Install required packages ‘npm install’
- run the app ‘ionic serve’
Hurray! All set.
Have questions or suggestions? Please let me know in the comments below.