[Video] What is Parse Cloud Code?

Parse.com has recently launched Cloud Code.  Cloud Code lets you host cloud functions on the Parse Cloud accessible to your Parse clients.  This video demo/tutorial below shows what Cloud Code is and why/when it would make sense to use it.

Here’s the link the post on how to set up your Parse Cloud Code in Windows.  If you’re new to Parse, I posted an intro video tutorial of that as well.

Setting up Parse Cloud Code tool in Windows

*UPDATE 2012-11-01 – Parse has released an official Windows tool for Cloud Code.  Check it here*

Parse is a Backend-As-A-Service (BAAS) for your mobile apps.  It promotes a development model where you can worry less about the server (backend) side of your application and focus more on the client side (Javascript, iOS, Android).  I posted a video here that briefly explains what Parse is and how to get started.

They have recently rolled out a feature called Cloud Code which lets you build code on the Parse cloud and expose them as functions (APIs) that can be called in your client-side Parse code.  This allows for the same benefits that we enjoy in a traditional API model.

Below are the steps on how to get your Parse Cloud Code tool running on Windows – we’re using Cygwin.  (The original steps can be found in the Parse Cloud Code Guide page).

  1. Install Cygwin from this page.  Just click the setup.exe link on that page and go through normal installation process (keep clicking Next unless you know what you’re doing) until you get to the “Select Packages” window that allows you to pick the packages for your Cygwin installation (see image below to see what this looks like).  Cygwin allows you to run Unix-based tools in Windows.
Cygwin Select Packages window

Cygwin Select Packages window

2.  We’re now going to install the Python and curl packages.  We need Python because the Parse Cloud code tool was coded in Python.  We need curl because it is called in the installer script that we will run later.

Start by searching “Python” in the search field and navigating to the Python hierarchy below when the results come up.  (Note:  Be careful not to hit “Enter” after typing in Python.  It will search as you type.  You might accidentally start downloading if you hit Enter).  Click on the “Default” word beside it until it says “Install”.  Mine looks like this (see image below). (Frankly I’m not sure which specific Python to install so I installed the whole branch.  It worked for me, but it would be great if anyone can correct me here).

Select the Python branch and install

Select the Python branch and install

After Python, do the same thing with curl.  I clicked to “Install” on All (again because I’m not sure 😛 – appreciate if anyone can correct me here)

curl

curl

Once these packages are chosen, click “Next” to start the download.

If everything’s successful, you should have an application called “Cygwin Terminal”  If you run it, it would look similar to the image below.  This gives us a Unix environment where we can type in the commands in the Cloud Code guide.  Type “pwd” to show you your current directory.

Cygwin Terminal

Cygwin Terminal

3.  Download the installer script (installer.sh) by clicking here.  This installer script downloads the actual Parse Cloud Code tool, and puts it in the proper folder so we can call it from anywhere inside Cygwin.  Note that this script cannot be executed inside a DOS command prompt – it should be inside Cygwin, and in a folder accessible by the Cygwin terminal.

In my case, the “/home/Chris” folder from the image above maps to “C:\Users\Chris\Documents\cygwin\home\Chris” because I chose to install Cygwin inside the My Documents folder.  Normally, you’d install it in your root drive (e.g. C:\\).  In my case, I placed the installer.sh file in a “parse” folder I created inside “/home/Chris”.  See image below to see what this looks like.

Now that looks familiar

Now that looks familiar

4.  Before we run the installer.sh in Cygwin, we need to make a minor change.  Open up the installer.sh file with your favorite text editor (I use TextPad).  Replace “https” with “http”, without the ‘s’.  Save the file.

installer.sh - change https to http

installer.sh – change https to http

We’re doing this because you’ll run into a certificate error when you try to run the script.  I can’t be bothered fixing that part, so I’d rather be just a bit unsecure, with http 🙂

5.  Last step!  Go back to the Cygwin terminal and navigate to the folder where you placed installer.sh.  Once you’re there type “bash installer.sh”.  This will start a quick installation.  See mine below.

Run installer.sh then "parse"

Run installer.sh then “parse”

Type “parse” to check if the installation was successful.  If you get the parse parameters info, you’re good to go!  You can go back to the Parse Cloud Code guide and start from “Setting Up Cloud Code

[VIdeo] Firebase – No more server-side coding for your apps

There are a bunch of cloud services out there offering the promise of letting you build applications without server-side coding.  Each have different flavors.  Firebase approach takes advantage of the idea of subscribing to data and reacting to changes to this data by setting up callbacks in your client-side coding.  In the video below, I quickly walk through the benefits of using Firebase if you intend to use collaborative and real-time applications.  After watching the video, give Firebase a spin, at http://www.firebase.com