An API-First Internet of Things Platform

Zetta is an open source platform built on Node.js for creating Internet of Things servers that run across geo-distributed computers and the cloud. Zetta combines REST APIs, WebSockets and reactive programming – perfect for assembling many devices into data-intensive, real-time applications.

Install

Docs & Source

var zetta = require('zetta');

zetta()
 .name('beaglebone')
 .link('http://cloud.herokuapp.com')
 .listen(3000);

Run Everywhere

Zetta servers run in the cloud, on PCs and on single-board computers. With Zetta you can link Raspberry Pis, BeagleBones and PCs together with cloud platforms like Heroku to create geo-distributed networks.


GET /servers/321/devices/123
Host: cloud.herokuapp.com
Accept: application/vnd.siren+json

{
  "class": [
   "device"
  ],
  "properties": {
   "id": "123",
   "type": "arm",
   "name": "Robot Arm",
   "state": "standby"
  },
  "actions": [{
   "name": "move-claw",
   "method": "POST",

...

API Every Thing

Zetta turns any device into an API. Zetta servers communicate with microcontrollers like Arduino and Spark Core giving every device a REST API both locally and in the cloud. Zetta's reactive hypermedia design marries reactive programming with Siren hypermedia APIs so that you can assemble distributed systems of devices that communicate and react via APIs.


module.exports = function(server) {
  var alarmQuery = server
    .from('office')
    .where({type: 'alarm'});
  var motionDetectorQuery = server
    .from('warehouse')
    .where({type: 'motionDetector'});

  server.observe([alarmQuery, motionDetectorQuery],
    function(alarm, motionDetector) {
      motionDetector.on('motion', function() {
        alarm.call('activate', function() {});
      });
    });
}

Code with Joy

Building Internet of Things systems is complex. Zetta provides helpful abstractions for increased developer productivity while also giving direct access to underlying protocols and conventions allowing you to focus on the big picture without losing track of the details so that you joyfully transform sensors, actuators and controllers into big, creative applications.


server
 .observe([sound, arm, huelight],
  function(sound, arm, huelight) {
   var gocrazy = new GoCrazy(arm, huelight);
   sound.streams.level.on('data', function(msg) {
     gocrazy.notify();}
   );
 });

Stream Big Data

Zetta's architecture is optimized for data-intensive, real-time applications. Zetta allows you to observe and react to device and system behavior in code and using visualization tools so that you gain actionable insights and take insightful actions. You can also stream data into machine analytics platforms like Splunk.

Device Time-Series Data over WebSockets

Device States and Transitions over WebSockets


var zetta = require('zetta');

var ConnectedCarApp = require('./apps/connected_car');
var HomeAutomationApp = require('./apps/home_automation');
var WearablesApp = require('./apps/wearables');
var MarsRoverSwarmApp = require('./apps/mars_rover_swarm');

zetta()
  .name('cloud')
  .use(ConnectedCarApp)
  .use(HomeAutomationApp)
  .use(WearablesApp)
  .use(MarsRoverSwarmApp)
  .listen(PORT);

Dream Big Apps

IoT developers work on projects with multiple devices across multiple locations running multiple apps made by multiple companies. Yet they must create harmonious experiences that benefit people.

Zetta allows you to assemble smartphone apps, device apps and cloud apps together into large, complex adaptive 'systems of systems' that operate at scale in the physical world of home automation, smart transportation, wearable computing and wherever your imagination leads.

Install Zetta