Pre-alpha: Technical Design


#1

Source code release at pre-alpha launch on August 10, 2015.

This is a brief introduction to the technical design of Heartbeat, Waystone, and Pulse.

See the conceptual design document for how the various bits fit together.

The Ind.ie pre-alpha has three main parts:

  1. Heartbeat: a peer-to-peer messaging and file synchronisation app.
  2. Waystone: an identity server and public post aggregator.
  3. Pulse: a peer-to-peer file synchronisation service (used in Heartbeat and Waystone).

1. Heartbeat

Heartbeat is a peer-to-peer messaging and file synchronisation app.

It has three main components:

  1. Native UI in Swift and Cocoa.
  2. Cross-platform business logic in Node.js.
  3. Peer-to-peer file synchronisation service (Pulse Go) in Go.

1. Native UI in Swift and Cocoa

(View Source)

Heartbeat’s audience is regular people who want to communicate with their friends in a private manner. It also enables everyday people to have their own independent web presence via public posts. If we want people to use Heartbeat, it must be a great experience. Heartbeat must respect the culture — norms, conventions, expectations, etc. — of the platforms that it runs on. The only way to achieve this is with a native UI. So, for every supported platform, Heartbeat will have a native UI.

In the pre-alpha, we are only supporting Mac OS X Yosemite. When Apple releases Mac OS X El Capitan, we will support that also.

This is a pragmatic decision based on resources. I’m the only developer on Heartbeat and Waystone and I currently don’t have the capacity to tackle other platforms.

For more information on this, read my reasoning behind choosing OS X as the first platform for Ind.ie. [LINK!]

2. Cross-platform business logic in Node.js.

(View Source)

I want to keep the codebase as simple and as portable as possible.

Having a Native UI is essential but we don’t need all the business logic to be in native code. Heartbeat is a hybrid app but not in the traditional sense of the term.

Hybrid is usually used to refer to web apps wrapped in native shells. This can never be a good experience as it does not respect the culture of the platform it runs on. I call this ‘hybrid wrong’.

Heartbeat is hybrid in that it embeds Node.js and runs a Node.js process to handle much of the business logic. The UI, however, is native.

Let’s call this hybrid right to distinguish it from hybrid wrong.

By having our business logic in Node.js we make it easier to port Heartbeat to other platforms in the future. We also lower the barrier of entry for people who want to contribute to development.

3. Peer-to-peer file synchronisation service (Pulse) in Go.

See Pulse.

More information

Find out more about Heartbeat in the Heartbeat category on this forum and check out the source (Cocoa, Node.js).

Waystone

(View Source)

Waystone has two main components:

  1. Business logic in Node.js.
  2. Peer-to-peer file synchronisation service (Pulse) in Go.

Business logic in Node.js

Waystone uses Node.js and, like Heartbeat, manages a Pulse Go process.

Peer-to-peer file synchronisation service (Pulse) in Go.

Pulse’s restarts are huge problem for Waystone. My long-term goal is to remove Waystone altogether from the design of the system. This is both to make Heartbeat scalable and completely decentralised.

More information

Find out more about Waystone in the Waystone category on this forum and check out the source.

Pulse

(View Source — Go, Swift)

About

Pulse is a fork of Syncthing. It is an efficient service for synchronising files between peers.

In the pre-alpha, the Node.js process in Heartbeat and Waystone launch and manage the Pulse process.

Limitations

One of the limitations of the pre-alpha is that Pulse requires restarts. There is a lot of logic in the Node codebase to work around these restarts with as much grace as possible. Our plan is to move from the Go version of Pulse to the Swift version of Syncthing that Mark and Stefan are working on. This will remove much of the complexity from the Node side of things. Once this transition is complete, Pulse will refer only to the Swift version of Syncthing.

Read a longer discussion of the Ind.ie pre-alpha limitations.

More information

The best source of information for the Go version of Pulse is the Syncthing documentation and forums. (The Go version of Pulse is a fork of Syncthing.)

Once the Swift version is ready, we’re going to drop Pulse Go. If you want peer-to-peer file synchronisation
outside of Heartbeat, I highly recommend using Syncthing instead.


Heartbeat pre-alpha release
#2

Please note: this is preliminary documentation in preparation for the pre-alpha launch. Source code links may lead to private repositories until August 10, 2015.


#3

I think you meant the Swift version of Pulse, no?


#4

Pulse is a fork of Syncthing.


#5

I know that but they still have different project names. And I’m fairly sure that Mark and Stefan are working on Pulse (swift)


#6

Sorry to confuse — right now:

  • Pulse = Syncthing fork (in Go). Basically, the last MIT-licensed version of Syncthing with a few additional commandline arguments.

  • Pulse Swift = Swift implementation of the Block Exchange Protocol. Syncthing compatible. In progress.

When Pulse Swift is ready, we will start calling that “Pulse“ and retire our Go fork.

Hope that clears it up a bit :smiley: