Git Product home page Git Product logo

tiparse's Introduction

tiParse


Overview

Parse lib for Appcelerator Titanium - iOS & Android

I am using the open source Parse-Server in some of my Titanium Apps so i needed a way to access my data easily and with ease. I've looked at some other projects like RESTe or the Kinvey Backbone SDK to get an idea of how i want to structure my stuff.

The result is a small lib which allows access to Parse with all the stuff we love like Backbone Models and Collections support. Besides that it supports caching using LokiDB (coming soon)

The lib based on a "active_user" lifecycle. So after you init the lib and logged in with a specific user every call uses the specific session_token to authenticate.


Dependencies:

  • LokiDB (Database for caching and store session_token & active_user)
  • Q.js (Promises)

Features

  • User

    • Login
    • Logout
    • Registration
    • Refreshing ( "me" )
    • Retrieve the active_user
  • Data

    • CRUD Operations (Create, Read, Update, Delete);
    • Query for Data (urlparams at the moment, functions for more comfort are in the pipeline)
  • Files

    • Full Support for Uploading Files
  • Push

    • Push-Support is coming soon

Parse Server

At the moment I am using Sashido for hosting my Parse-Server. I really can recommand you to try their service. If you do - maybe use Refferal ;) Of course you can setup your own installation on Providers like AWS, Heroku etc. At least it's a great starting point to develop your new Application.


Examples


// Parse Init
TiParse.init({
  base_url : "https://www.yourparseserver.com/1/)",
  app_key : "your_app_key",
  rest_key : "your_rest_key",
  usermodel : M_User
}).then(function(active_user){
  if( active_user ){
    console.log("I am already available - Jeah :)");
  }else{
    var user = new M_User();
    user.login({
      username : "username",
      password : "password"
    }).then(function(response){
      console.log("Login success - Jeah :)")
    });
  }
});

Your alloy.js should look similar to this:

var Q = require('q');
var TiParse = require('TiParse');

/**
 * User-Model
 */
var M_User = Backbone.Model.extend({
  // Custom Functions and Properties
  //fullname : function(){
  //  return this.get('first_name') + " " + this.get("last_name");
  //}
});
_.extend(M_User.prototype, TiParse.Backbone.UserMixin);

As you can see, I've created a global Reference to "my" User-Model. You can extend it with custom functions and properties as you need them. In this case there is a commented function to get the fullname of an user based on his/her first_name and last_name attributes. This way you can modify your Base Classes at one place and use them anywhere in your application.


Releases

  • ###1.0.0 (02.11.2016)
    • inital Release
    • Basic Support for User Functions
    • Basic Support for Data Functions

tiparse's People

Contributors

nuborian avatar pivanov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tiparse's Issues

livequery

Hi, is livequery supported ? if yes how ?
thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.