• Stars
    star
    249
  • Rank 162,987 (Top 4 %)
  • Language
    Elm
  • Created about 6 years ago
  • Updated over 5 years ago

Reviews

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

Repository Details

🌱 Grow delightful software

Farm

Farm is an experiment in distributed peer-to-peer computing. Farm is an extensible, programmable environment with real-time and offline collaboration with other users and no mandatory infrastructure. You can program Farm using the Elm programming language, and changes you make to the code will be shared in real-time with users anywhere in the world.

Farm also includes a demonstration application inspired by tools like Google Keep, Milanote, or Trello.

It partners particularly well with our vscode plugin.

Caveat Emptor

Warning! Farm is experimental software. It makes no guarantees about performance, security, or stability. Farm will probably consume all the memory on your computer, leak your data to your worst enemy, and then delete it.

That said, if you encounter Farm bugs or defects, please let us know. We're interested in hearing from people who try the software.

Trying Farm

Clone this repo, then start the application.

yarn
yarn start

You should see a "welcome" board with a navigation URL. This is the Farm demonstration application. Everything you see is self-hosted in Farm and can be edited by you, from the navigation bar at the top to the typeface used on the welcome card.

Using FarmPin

FarmPin is a tool for collecting and sharing ideas. You can use it to plan a trip or a project, create a mood board, or to improvise an ad-hoc user interface for an application you're working on.

  • You can right-click to create new notes on your board or resize and drag notes around by clicking on the bar at the top.
  • You can make the current card full-screen by double clicking on the top 20px of the card navigate back (or forward) to the previous view with the arrow buttons left of the title bar.
  • Delete a card by right-clicking on the top 20px and clicking "Remove".
  • Share a link to your current view (and it's code!) by copying the URL out of the title bar and pasting it to another user. Be careful -- anyone with the link to a Farm document can not only view it now but all future versions as well and their modifications to the code or data will be merged with your own.

Working on Farm Applications

Farm applications are built out of Gizmos. A Gizmo is the combination of some data with a small Elm program to render it as a Web Component. Changes to the Elm code for a Gizmo are compiled automatically into Javascript by the Farm runtime, and changes to the data document will trigger a re-rendering of the content as well.

All documents in Farm, both data and code, are Hypermerge documents. A Hypermerge document is identified by its URL, and anyone with the URL is able to make changes to it and should expect them to be synchronized everwhere in the world. All hypermerge documents are constructed out of their full history.

The best supported way of working on a Farm application is through the Hypermerge VSCode extension. To import your data and code into the VSCode extension, paste it into the "Open Document" dialogue for the extension. Further details on this process are describe in the README for that project.

A farm:// URL has two parts -- the first half tells Farm which code to run, and the second half describes the data document to render with that code. You can pair any code with any document and Farm will do its best to make it work.

When editing Farm code in VSCode changes made to a Source.elm key will be synchronized to Farm which will attempt to compile them with the Elm compiler. If the compile is successful, the result will be written to Source.js. If the compile fails, the errors will be written to a hypermergeFsDiagnostics key which VSCode will render as code error highlighting within the relevant buffer.

Good luck! If you have questions, don't hesitate to ask here in the Github Issues or on the automerge slack.

Starting multiple instances of Farm on one machine

Each instance of Farm must have it's own Repo directory. By setting the REPO_ROOT environment variable, we can open a second instance of Farm:

REPO_ROOT=.data2 yarn start

The default REPO_ROOT value is .data.

Code highlighting & formatting for Elm code in Hypermerge

The upstream Elm extension assumes files are written to disk, which Hypermerge documents are not. As a result, when working on Hypermerge documents you'll want to use our patched version of the Elm vscode extension. Download the latest Release. Install by selecting "Extensions: Install from VSX..." from the Command Palette, and selecting the downloaded .vsx file.

Windows

Farm uses several packages which will require a native rebuild on Windows. You should only need to do this once. To rebuild, from the repo root run:

npx electron-rebuild

More Repositories

1

peritext

A CRDT for asynchronous rich-text collaboration, where authors can work independently and then merge their changes.
TypeScript
654
star
2

cambria-project

Schema evolution with bi-directional lenses.
TypeScript
616
star
3

tiny-essay-editor

simple markdown editor w inline comments, on latest automerge stack
TypeScript
214
star
4

livebook

IPython notebook-compatible live coding experiment
Python
200
star
5

capstone

An experimental, tablet-based tool for developing your ideas
TypeScript
175
star
6

potluck

TypeScript
74
star
7

ksp-browser

Connect the things you already know in your browser.
TypeScript
71
star
8

backchannel

Local-first address book
TypeScript
67
star
9

ksp

Reference implementation of Knowledge Server Protocol (KSP)
Rust
48
star
10

backchat

A relationship-based digital identity system.
TypeScript
31
star
11

vscode-hypermerge

A VSCode plugin to edit Hypermerge documents
TypeScript
28
star
12

upwelling-code

The Upwelling research prototype.
TypeScript
23
star
13

interactive-shape-recognition

Implementaion of "A Simple Approach to Recognise Geometric Shapes Interactively" by Joaquim A. Jorge and Manuel J. Fonseca.
JavaScript
18
star
14

eup-experiment-pipes

JavaScript
16
star
15

flutter-hello

A sample flutter drawing app
Objective-C
16
star
16

cambria-automerge

TypeScript
16
star
17

here

resilient location sharing
TypeScript
12
star
18

inkling

archived prototype for sketching dynamic models
TypeScript
8
star
19

automerge-todomvc-http

An automerge TodoMVC interop demo
Rust
5
star
20

cambria-express

use cambria to migrate API requests as express middleware
TypeScript
5
star
21

farm-peer

A cloud peer for farm to keep data warm while your computer is sleeping.
TypeScript
4
star
22

discovery-cloud-client

TypeScript
4
star
23

Inkteractions

JavaScript
1
star