A feedback app in minutes with Ionic and Cloudant

An Ionic feedback app using Cloudant NoSQL service on IBM Bluemix. An easy to configure mobile app for receiving feedback at Meetups, Events etc.,

Ionic is a complete open-source SDK for hybrid mobile app development. Built on top of AngularJS and Apache Cordova, Ionic provides tools and services for developing hybrid mobile apps using Web technologies like CSS, HTML5, and Sass.

Cloudant is the distributed database as a service (DBaaS) built from the ground up to deliver fast-growing application data to the edge.

The App Runs on iOS and Android and build using Ionic Version 1.7.13
iOS:

Android:

Creating a Cloudant NoSQL DB service on IBM Bluemix

  • Don’t have Bluemix account? Sign up to create a free trial account.
  • Have a Bluemix account? Use this link.

Add a new Cloudant data service in just a few clicks:

  1. Visit your Bluemix dashboard.
  2. Click Catalog.
  3. On the left Pane, Click on Data & Analytics under Services.
  4. Click Cloudant NoSQL DB tile.
  5. Enter a unique descriptive name in the Service name field.
  6. Check Features, Images and Pricing Plans.
  7. Click the Create button.

Cloudant Dashboard 2.0

Once the Cloudant service is created,

  • Click on LAUNCH button to launch the Cloudant Dashboard 2.0 (Powerful querying, analytics, replication, and syncing happens here) on a seperate tab
  • Create a new database by clicking on Create Database on the top ribbon. Your database is created.
  • From the left Pane, Click on Account -> CORS Tab -> Check All domains ( * ).

*Not recommended for all usecases, this being a simple mobile app taking this liberty. Check CORS Documentation

Configuring Ionic app with a configuration file

Install Ionic

Clone the repo

  • Open the unzipped folder in an IDE (I use Brackets) of your Choice and Navigate to www/js folder.
  • Create a new Javascript file app.config. With extension the file will be app.config.js
  • Paste the below code in app.config.js,

  • DBName – Name of the Cloudant NoSQL DB your created on Dashboard 2.0.
  • For hostname,username and password – Navigate to the Cloudant Service page on Bluemix and Click on Service Credentials tab.
  • Click on View Credentials under Actions.
    placeholder Cloudant Service

The CLOUDANTDB_CONFIG constant values are utilised in controllers.js

Customize the App UI

  • Images can be replaced with the same name under img folder.
  • Customize the feedback fields in feedback.html
  • There are validations on the fields based on the type. E.g., Email checks for @ in the entry. Submit will be disabled until the form is completely valid.

Testing the App

Desktop browser Testing

On an iOS Simulator or Android Emulator

Note: Follow the Android and iOS platform guides to install required tools for development.

App in Action

A feedback Ionic app storing data to Cloudant NoSQL DB from Vidyasagar MSC on Vimeo.

If you see this Error

Resolution:

  1. Check Node version on your system

  1. If you see  v7.5.0, run the below commands one after another to add v6

Notes:

Polyglot & Pragmatic Programmer • Developer Advocate, IBM Cloud • Microsoft MVP • Intel software Innovator • DZone MVB
(Visited 63 times, 2 visits today)

You may also like...

Show Buttons
Hide Buttons