willCode2Surf / ember-parse-adapter

An Ember Data Adapter for Parse

Home Page:http://clintjhill.github.com/ember-parse-adapter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ember Data Adapter for Parse

An Ember Data Adapter built to use the Parse REST API. This is a full Ember implementation against the Parse REST API without the use of the Parse JavaScript SDK. It is implemented against revision 11 of the Ember Data framework.

Features

ParseConnector: Ember Mixin
  • Provides the AJAX connectivity to the Parse REST API.
  • CORS implementation
ParseJSONSerializer: Ember Data JSONSerializer
ParseAdapter: Ember Data Adapter
  • Implements the persistence layer to Parse.
  • Provides either bulk/batch persistence or granular (bulkCommit by default).
ParseMixin: Ember Mixin
  • Provides created/updated date attributes.
ParseModel: Ember Data Model
  • Provides an easy way to setup a Parse object.

Get Started

Grab the latest version of ember-parse-adapter from the /dist directory in this project and include it in your HTML after the Ember dependencies.

<script src="jquery.min.js"></script>
<script src="handlebars-1.0.rc.1.js"></script>
<script src="ember.js"></script>
<script src="ember-data.js"></script>
<script src="ember-parse-adapter-0.0.9.js"></script>

Next you'll want to get an account at Parse: https://parse.com/. After this you will be provided with three keys:

  • Application ID
  • JavaScript Key
  • REST API Key

You will need each of these to configure the ParseAdapter.

  var App = Ember.Application.create();

  App.Store = DS.Store.extend({
    revision: 11,
    adapter: ParseAdapter.create({
      applicationId: '<YOUR APP ID HERE>',
      restApiId: '<YOUR REST API KEY HERE>',
      javascriptId: '<YOUR JAVASCRIPT KEY HERE>'
    })
  });

Once you have your adapter configured now you can create ParseModels just as you would create DS.Models.

  App.Post = ParseModel.extend({
    title: DS.attr('string'),
    body: DS.attr('string')
  });

Issues

  • Demo is rough due to Parse acct dependency.
  • findQuery implementation is a bit weak/brittle. Needs full Parse Query.
  • Error conditions are handled only by logging the error.

Roadmap

  • Parse User implementation
  • Parse Roles implementation
  • Parse ACL implementation
  • Parse Relation for many-to-many associations.
  • Implement Store record error states.
  • Implement full type encodings in ParseSerializer supported by Parse (Bytes/Pointer/Relation).

Dev Notes

  • To get a build simply grunt. You'll find builds inside the /dist folder.

About

An Ember Data Adapter for Parse

http://clintjhill.github.com/ember-parse-adapter