Developer Reference

Getting started with CloudyRec

Using CloudyRec to implement and deploy a mobile backend service is really simple. It works like this. First we define what to store for our app. Once we are happy with the data model, load the app to the development sandbox environment. Then choose what’s our target mobile development platform and generate code for it. CloudyRec does not provide separate SDKs. All the code needed for our specific app will be generated at this code generation phase. Code generation currently support platforms such as iOS, Android, Windows Phone 7, PhoneGap, Java and Ruby among others.

So first of all, please go ahead and register for an account. Then sign in to developer dashboard to start defining the data model for our app.

1. Data model definition

By default, once signed in, you’ll be under “Define” tab of dashboard page. The first step is to create a new app. Then select the app you just created to define resources you want to store for that app.

1.1. Defining user accounts

If we want to have authenticable user accounts for our app, we can check “is authenticable” option for that resource. This will automatically setup user id and encrypted password attributes for that resource as well as “authenticate” helper function in code generation. We can add more attributes like email, full name, etc if we want.

Defining data model
Fig 1.1: Defining the data model

1.2. Relationships

We can use “belongs to” option to indicate the relationship between two resources. Create a new resource and click edit to modify the “belongs to” setting. Select the master resource that the current resource belongs to from the list.

Relationships
Fig 1.2: “belongs to” relation between user resource and blog_post resource

Such relationship will enforce to supply for master ID when uploading data to CloudyRec servers. Generated code will check for such relationships and will throw an exception if there’s a relationship and no master ID is provided.

2. Code generation

Before we generate the code we have to load our app to the development sandbox servers so that we can test our app within the test environment.

Load to sandbox
Fig 2.1: Load to sandbox environment

Once our app is on a sandbox instance, we can check its properties under the “Sandbox” tab. We can find app key and resource keys. Using these information and the API reference documentation we can implement our own client side code should there be any platform that CloudyRec currently doesn’t support.

Sandbox environment
Fig 2.2: Sandbox environment

Next go to “Generate” tab. Click generate to submit a code generation request for your target mobile platform to CloudyRec server. After a short while, generated code will be ready to download.

Code generation
Fig 2.3: Code generation

Download the code once the generation process is done. Now we are ready to move on to actually use it from actual app. Choose your target platform to learn more:

Developing for Android

Developing for iOS