Home

Awesome

<p align="center"> [![Build Status](https://travis-ci.org/neutrinoapp/neutrino.svg?branch=master)](https://travis-ci.org/neutrinoapp/neutrino) [![License](https://img.shields.io/badge/license-GNU%20AGPLv3-blue.svg)](https://github.com/neutrinoapp/neutrino/blob/master/LICENSE.md) [![Build with <3](https://img.shields.io/badge/built%20with-%E2%9D%A4-red.svg)]() [![Alpha](https://img.shields.io/badge/State-Alpha-orange.svg)]() [![](https://img.shields.io/badge/gitter-join%20chat-green.svg)](https://gitter.im/go-neutrino/neutrino-core?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) <p/> <p align="center">![Neutrino](http://v41.imgup.net/NEUTRINO-l3931.png)<p/>

Note: The project is still in its alpha stage, if you still want to see it running, check out the demo in the website.

Introduction

Neutrino is a service that allows developers to link their mobile and web applications with a real time cloud data storage. Every time you create a new application, you need to write code to authenticate users, store data, manage infrastructure, handle scalability. Neutrino gives you out-of-the-box solution to easily manage your application’s users and data. You can be sure that your data will always be available and scale along with your application.

Architecture

Note: The API and Realtime services can be scaled horizontally. E.g. they are currently running in Google Container Engine in Kubernetes pods.

Other components

API

var app = Neutrino.app('demo');
var collection = app.collection('demo-items');
app.auth.login('demo', 'demo').then(function () {
		//get all objects in the collection
		collection.objects({realtime: true})
    	.then(function (objects) {
      	//get notified when an object is added
    		objects.on(Neutrino.ArrayEvents.added, function (item) {
    			console.log(item); //{id: 'GUID', itemText: 'some-text'}
    		});  
      });

		//lets create an object
		collection.object({
    	itemText: 'some-text'
    }).then(function () {
    	console.log('item created!');
    });
    
    //we can also get an item by id
    
    //we can get both realtime and non-realtime objects
    collection.object('some-id', {realtime: true})
    	.then(function (object) {
      		//any change that happens on the server or on the client will affect this object
          //if we change its text all clients will receive the update
          object.on(Neutrino.ObjectEvents.propertyChanged, function () {
            console.log(object);
          });
          
          object.itemText = 'some-changed-text';
      });
      
     collection.object('some-id', {realtime:false})
     	.then(function (object) {
      		//changes will not automatically propagate to this object
          //we can still update it manually and all other clients will receive the update again
          object.itemText = 'manual-text';
          return object.update();
      });
});

Documentation

Coming soon

Local development

Tested only on linux

Start rethinkdb by downloading it for your distribution or if you have docker installed, run make dev

Start the api service by running make api

Start the realtime service by running make realtime

You can use the postman configurations from the postman folder until docs come out

Related projects