AWS and Ionic Team Up In Starter Project
Written by Nikos Vaggalis   
Thursday, 18 May 2017

Amazon is quick in recognizing that just offering support for a number of popular programing languages is not enough to lure hoards of developers to the platform. That's why we are seeing a move towards wrapping its AWS services with greater user-friendliness.

The start was made with the introduction of CodeStar, which aimed to simplify the setting up of a project's AWS infrastructure, especially  with regard to policy and authorization, as we examined in CodeStar to Simplify Development On AWS.

It continues this trend with the release of the open source Ionic AWS starter project Mobile Web and Hybrid Application which aims to act as a skeleton, or boilerplate, Ionic application tweaked in such a way to give developers a headstart in configuring their mobile Ionic front-end applications in relation to an AWS backend.

Amazon's new strategy towards streamlining its services is acknowledged by it officially admitting:

"Creating the backend services can be a time consuming and error prone endeavor."

which nowadays is certainly the case. A 'simple' but modern mobile app is not just about nice looking and usable UIs anymore, but in contrast it has to leverage quite a number of backend services for its needs, such as storage, databases, user management (sign-up, sign-in, identity, resource access control, and security), and messaging.

To ease this process, Amazon now enables developers to import just a single file into its AWS Mobile Hub (Amazon's platform for mobile apps) console, an action which will automatically create a new Mobile Hub project and take care of the necessary configuration as well as the instantiation of all essential backend components, like Amazon Cognito for the user identity management, DynamoDB for the application data, S3 for the file storage, and Pinpoint for the analytics.

The prerequisites to get started are an Ionic CLI version of 3.x RC, (or install it with npm install -g ionic@latest) as well as the latest AWS CLI (or install it with pip install awscli/).

With these in place then you can continue in creating your Ionic Project with:

 ionic start myApp aws

After that, log into your AWS Mobile Hub account and import the file (in essence a packed yml configuration file) which when loaded up will setup and configure, as already mentioned:

  • an Amazon Cognito User Pool for identity management, aka 'User Sign-in'

  • a single Amazon DynamoDB table called “ionic-mobile-hub-tasks” (since the boilerplate project is actually a 'to-do' app)

  • and an S3 bucket with resources such as aws-config.js, images and HTML files.

The last part is hooking up this configuration to the Ionic project you created in the beginning. You've now got to copy the generated aws-config.js file into your project's folder as well as copy the project's web assets residing in your myApp/www/ to the root of your S3 bucket.

To do this inside your Ionic project, run the following commands, substituting WEBSITE_BUCKET with the S3 content delivery bucket name that was created by the Mobile Hub project import.

npm run build aws s3 cp --recursive ./www s3://WEBSITE_BUCKET

You'll find more details on the project's official GitHub page.



More Information

Related Articles

Ionic Creator - Generate The Code

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.



Insights From AI Index 2024 Report

Published this week, the latest Stanford HAI AI Index report tracks worldwide trends in AI. A mix of its new research and findings from many other sources, it provides a wide ranging look at how  [ ... ]

ZLUDA Ports CUDA Applications To AMD GPUs

ZLUDA is a translation layer that lets you run unmodified CUDA applications with near-native performance on AMD GPUs. But it is walking a fine line with regards to legality.

More News

raspberry pi books



or email your comment to:

Last Updated ( Thursday, 18 May 2017 )