Table of contents

bill-appleton-author-mobile-archWe are thrilled to announce that the DreamFactory open source REST API Platform now runs great on IBM Bluemix. DreamFactory supports a large community of modern developers working on phone and tablet applications. In many cases, client developers want the backend platform to "just work" so that they can focus on user experience and application design. Platform as a Service (PaaS) systems are a perfect platform for them, because they can upload an image of their local development environment and scale the backend instances without having to worry about server-side hosting issues. But up until now, there was no REST API platform available that installs on PaaS systems like Bluemix.

DreamFactory also supports the Cloudant NoSQL document store and the DB2 relational database. We instantly generate a sophisticated REST API for these data sources with many advanced features. For example, you can filter Cloudant documents with SQL filter strings. On DB2 we support data CRUD, metadata, filters, pagination, rollback, views, and stored procedures. When you hook up a local or remote data source, we dynamically generate Client SDK libraries for every major development environment, including Android, AngularJS, Titanium, JavaScript, Windows Phone, and iOS.

I am writing this blog to step you through installing DreamFactory on Bluemix, and explaining some of the basics along the way. I have also included a few short movies that show an overview of the installation process. The second movie shows how to connect the Cloudant NoSQL database to your account as well.

Movie One: Installing DreamFactory on Bluemix

Movie Two: Installing Cloudant on DreamFactory


Setting Up DreamFactory



With PaaS systems like Bluemix there is no persistent storage on the server side. Because of this, your application must be bound to an external SQL database, and Bluemix provides a number of options for this. You also cannot edit web application files or server-side scripts in the cloud. In this case, you would just be editing the file in temporary local storage.

There are two simple solutions for this. If you don't need local web files or server-side scripting, then just grab our source code from GitHub and push that. You can run the DreamFactory Admin Console on Bluemix and configure your platform from there. Your modifications are saved in the SQL database.

Or you can run DreamFactory on the local desktop, and develop and debug your applications from there. We have Bitnami installers for Linux, OS X, and Windows. When you push the desktop folder your local web application files and server-side scripts will be included in the Bluemix image. Both of these methods are covered in the instructions, below.

bluedream

Push To Bluemix

There are some "one time" tasks setting up your development environment that need to happen before you can push to Bluemix. These are outlined in detail below, but here are the major items:

  • Get an account with IBM Bluemix
  • Install the Cloud Foundry command line tools
  • Move a database configuration file in your DreamFactory directory
  • Edit the application manifest file in your DreamFactory directory
  • Push the DreamFactory image to Bluemix
  • Connect a MySQL database to the application

After this, you can develop applications locally and update any changes with the "cf push" command. This is super convenient. You can edit your application with desktop tools, and push the image to Bluemix with one command! Here are the detailed step-by-step instructions to set up your development environment and push DreamFactory to your Bluemix account.

bluemix1

Detailed Instructions

STEP ONE

Get a IBM Bluemix account.

https://ace.ng.bluemix.net/

Read the Bluemix documentation.

https://www.ng.bluemix.net/docs/#starters/BuildingWeb.html

Install the Cloud Foundry CLI tool on your local machine.

https://console.run.pivotal.io/tools

STEP TWO

Get the DreamFactory source code,

https://github.com/dreamfactorysoftware/dsp-core

Or the desktop installer.

https://bitnami.com/stack/dreamfactory/installer

Run the installer or unpack the source into a desktop folder.

STEP THREE

Locate the DreamFactory source code folder:

For the GitHub source code, this will be the "dsp-core-master" folder

For the desktop install, this will be the ".../apps/dreamfactory/htdocs" folder

Make the following changes:

1) Copy htdocs/config/manifests/manifest.bluemix.yml-dist to htdocs/manifest.yml

2) Edit manifest.yml and change [app-name] and [host-name] to your app name

3) Copy config/database.bluemix.config.php-dist to config/database.config.php

STEP FOUR

Navigate to the source code folder with the Command Prompt and type the following:

1) cf api https://api.ng.bluemix.net

2) cf login

Followed by your Bluemix email and password

3) cf push

STEP FIVE

Log into your Bluemix account.

Create a new MySQL service and bind it to your app using the Bluemix user interface.

Restart your application and run. In the future, you just have to do the login and push to update.