• Stars
    star
    137
  • Rank 266,121 (Top 6 %)
  • Language
    Objective-C
  • Created over 8 years ago
  • Updated about 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Offline first mobile syncing library

KiteSync

**KiteSync has been deprecated in favor of the new Realm Mobile Platform

We had an ambitious goal of building a library that makes creating offline first apps that sync with RealmDB easy. Syncing is hard, but we built a solution and had some early traction! However, after literally syncing up with Realm to get an early preview of their polished solution for this problem, we're happy to deprecate this repository and let them handle syncing.

About KiteSync

KiteSync Enables Developers to Sync Offline-First Applications Using Realm

We believe that offline-first applications make for the best user experience:

  • Applications should work offline as seamlessly as possible with little or no disruption to the user.
  • Once a user is authenticated and online, his/her data should be synchronized and persistent on the device.
  • Apps should provide syncronization across multiple devices.

Products like Evernote, Google Keep, and Kindle have syncing solutions that highlight the merits of ensuring user data is available across devices and have thus raised users' expectations of how they interact with their mobile apps. Syncing is a challenging technical problem and many businesses have developed proprietary syncing technology that can be used as a competitive advantage. KiteSync’s goal is to make syncing an easy experience both for developers and users alike.

Realm provides an exciting mobile database with a low memory and space footprint. We built an API wrapper over Realm to give full remote syncing functionality for react-native apps.

What is KiteSync?

KiteSync is an open-source solution to syncing realm.io react-native databases by using an external remote service. This library empowers developers to focus on offline first functionality in their mobile apps.

KiteSync is built on top of Realm.io and consists of two components:

  • KiteSync API -- a JavaScript library that allows syncing by using create, delete, update, and delete methods. Syncing is initiated via the sync method coordinating synchronization with the remote service.
  • KiteSync Remote-Service -- a cloud-based solution for adding applications.

KiteSync provides the following service to developers:

  • Full Sync -- provides a full synchronization of user data from mobile device to mobile device.
  • Auth -- an authentication API that connects to common auth providers (Facebook).
  • Incremental Sync -- only synchronizes changes since the users last sync reducing the amount of data transferred.
  • Conflict Management -- resolves conflicts between identical objects on the client's device.
  • Testing -- automated testing suite and sample test app to interface with the both databases.
  • Proof-of-Concept Application -- a production notes application that leverages the node module.

KiteSync was first built by Alamu Palaniappan, Colin Goltra, David Ogor, and Mike Jonas

Getting Started

###Requirements

  • realm
  • react-native

###Installation

$ npm install realm-sync-js

Link to realm-sync-js on NPM

###API Documentation You can use KiteSync methods in a similar manner to how you would use realm CRUD methods.

new RealmSync(schema[, path])

Instantiate an instance of realm and realm sync.

.create(type, properties[, update])

Create an object that can be synchronized.

.delete(realmObject)

Delete an object from the local realm storage database.

.getRealmInstance()

Provides an instantiated instance of the Realm library.

.sync(callback [,serviceWinsPolicy])

Synchronizes changes with remote service based on . Node style callback that return true for success.

##Example

const Realm = require('realm');
const RealmSync = require('realm-sync-js');

const remoteDBPath = 'REMOTE_DATABASE_PATH';
const localDBPath = 'sample.realm';

module.exports.sample = function() {
  // Create your schema
  class Person {}

  Person.schema = {
    name: 'Person',
    properties: {
      name: Realm.Types.STRING,
      address: Realm.Types.STRING,
      realmSyncId: Realm.Types.STRING
    }
  };

  // Instantiate KiteSync

  const realmSync = new RealmSync([Person], remoteDBPath, localDBPath);
  const realm = realmSync.getRealmInstance();

  // Function used to create a person in realm
  realm.write(() => {
    realmSync.create('Person', {
      name: 'Brian Smith',
      address: '123 Main St'
    });
  });

  realmSync.sync(function(error, success) {
    if (error) {
      throw new Error(error);
    } else {
      console.log(success);
    }
  });
};

Development & Contributing

Get Involved

This library was made possible by the creative efforts of developers like you and we would be happy to have you contribute to KiteSync's future success. If you'd like to be a contributor, check out our Contributing guide.

Also, checkout out KiteSync.io periodically for updates.

Git Workflow

Testing

Style Guide

Roadmap & Wishlist

  • Public/Private Routing -- allows developers to choose which data is privately synced per user and data synced to all mobile users.
  • Event Notification -- provides notification when syncing is initialized, in progress, and completed.
  • Backend Expansion -- an API/protocol to create custom backend solution.

Additional

External Resources

Community

Founding Team

License

MIT License

Copyright (c) 2016 KiteSync Team (Alamu Palaniappan, Colin Goltra, David Ogor, Mike Jonas)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


___  __    ___  _________  _______           ________       ___    ___ ________   ________     
|\  \|\  \ |\  \|\___   ___\\  ___ \         |\   ____\     |\  \  /  /|\   ___  \|\   ____\    
\ \  \/  /|\ \  \|___ \  \_\ \   __/|        \ \  \___|_    \ \  \/  / | \  \\ \  \ \  \___|    
\ \   ___  \ \  \   \ \  \ \ \  \_|/__       \ \_____  \    \ \    / / \ \  \\ \  \ \  \       
 \ \  \\ \  \ \  \   \ \  \ \ \  \_|\ \       \|____|\  \    \/  /  /   \ \  \\ \  \ \  \____  
  \ \__\\ \__\ \__\   \ \__\ \ \_______\        ____\_\  \ __/  / /      \ \__\\ \__\ \_______\
   \|__| \|__|\|__|    \|__|  \|_______|       |\_________\\___/ /        \|__| \|__|\|_______|
                                               \|_________\|___|/