01 - Introduction

What is freedom.js, and why should I care?

freedom.js is a JavaScript framework that facilitates developing peer-to-peer (P2P) applications. These sorts of applications have been around for awhile and can be pretty nifty - they give the developer a low-cost way to scale up a resilient application, and they give users more control over their own data. But building them can be challenging, requiring a sophisticated understanding of networking and security. Doing so in the browser - the increasingly important yet constantly changing application platform - is even harder.

This is where freedom.js comes in - we provide a framework where common functionality (social, storage, network transport, etc.) has a standard interface and a suite of providers that run across typical JavaScript platforms (currently Chrome, Firefox, and Node.js). Want to write an app that lets people connect directly to each other in their browsers, choosing their friends from existing social networks? freedom.js takes care of the details, letting you focus on your application logic.

How does this work? You’ll learn more throughout the tutorial, but the core of it is that a freedom.js app specifies its API and dependencies via a manifest, and then freedom.js uses web workers to run the application and related modules. These modules run independently and so must communicate (message passing via the specified API), but this isolation and abstraction allows for applications to run across computers and users - resulting in decentralized peer-to-peer applications.

freedom.js is open source (Apache License 2.0) and you can find our repositories on GitHub. We’re actively developing and enhancing the platform, and welcome community contributions. One of the best ways to get started is to just use freedom.js to develop an application - so think some about what you want to make, and read on!

What are some apps that have been built using freedom.js?

To get an idea of the sorts of things you can do with freedom.js, here are some existing applications:

freedom.js also has demo apps that can serve as useful examples while developing (including a chat demo that is the base of Dorabella).

Tutorial outline

The tutorial steps through the development of Dorabella, mentioned above. If you’re a new developer then soldiering on in order is probably a good idea, but if you’re already comfortable with the JavaScript ecosystem then picking and choosing or skipping through may make sense. The topics of the remaining sections are:

--- 02 - Dev Environment Setup