Question

The last week i started working on a small startup company,which is developing an iOS app. My position in the team is backend developer. I spoke with the mobile developers of they told me that they use Stackmob Backend-as-a-Service provider for the mobile application. Now,as a backend dev,i have to create a custom php (using CakePHP framework,if it matters) API which will store all data exchanged in the mobile app (in a MongoDB database,if it matters),run some algorithms that are required (including taking an input from the mobile app and then returning back a response,after filtering the input via the backend algorithms) and implement a user-to-user messaging feature for the mobile app again.

As you understand,the php part will be totally invisible for the user,it only contains algorithms.

Now,i'm a bit perplexed at the Stackmob part. How can i "connect" (or what?) the stackmob platform with my backend php algorithms,so that the mobile app makes use of both? I mean, the Auth users feature for example is powered by Stackmob. But how would i save into the database (into our infrastructure) the users' info? And also manage users' data and much other stuff? As they explained me, the iOS app has to use both stackmob services AND our custom algorithms (via our private API) which runs on our servers..

Please,any tips about anything about that would be highly appreciated,or anything that could help me understand how should i work.

Thank you in advance guys!

Was it helpful?

Solution

I am working exactly on that, writing PHP cron daemon to import third party data and upload to Stackmob. They have a PHP library and I wrote a simplified shorter version.

The whole database communication breaks down to simple CRUD interface. Good luck.

EDIT. The code I am working on has the following structure.

  • 3 Storage objects: inStore, locStore, outStore. Incoming data, local Cache and outgoing. See my locStore code here.

  • 3 Proxy objects: inProxy, locProxy, outProxy to talk to their corresponding stores. They provide my app specific methods as they have access to my config, where the Stores don't.

  • Config object to deal with config-related methods, used by the proxies.

  • Top level Data Mover objects that only talk to the Proxies.

OTHER TIPS

It looks like you can use StackMob's REST API from your PHP to access the list of users. The full API is described https://developer.stackmob.com/rest-api/api-docs#a-rest_full_api_reference, and you can get a list of users with GET http://api.stackmob.com/user.

But exactly what you need to do depends on your requirements. It also looks like StackMob allows you to implement your own code on their platform, but it has to be written in Java, Scala or Clojure (ie it runs on a JVM). I suspect this might be a much better idea for you to investigate, that to be trying to configure your PHP to talk to their API...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top