Moku

December 1, 2019 ยท View on GitHub

Moku is an ActivityPub server written in Crystal and backed by Neo4j. It is primarily an experiment to see how Neo4j works as the data store for a social graph.

One primary difference between Moku and Mastodon is that Moku tries as much as possible to do everything in server-rendered HTML rather than having an API and a JS front end. This is just an experiment, so this may change in the future. We may try the "sprinkles of JS" approach or maybe even move to full-on back-end/front-end separation.

Installation

git clone https://github.com/jgaskins/moku.git
shards

Usage

crystal src/moku.cr

Development

Database

A few notes about how the database is structured:

Node Labels

LabelMeaning
PartialAccountA remote account whose data has not been fully loaded yet
AccountA fully reified account, either local or remote
UnverifiedLocalAccountAn account on this instance whose email address has not been verified
LocalAccountAn account on this instance. These can be queried by handle, which is guaranteed unique.
RemoteAccountAn account on another instance. Handles are not guaranteed unique, so they must be queried by id.
PersonAny person this instance knows about, a superset of all accounts (Account, PartialAccount, and LocalAccount)
ModeratorCan moderate this instance
AdminCan administer this instance
KeyPairA public/private keypair. For remote accounts, this is probably only going to contain a public key.

Relationship types

TypeMeaning
WANTS_TO_FOLLOWThe origin account has sent a follow request to the target account
FOLLOWSThe target account has accepted the origin account's follow request
HAS_KEY_PAIRThe origin node has the target keypair
POSTEDThe origin node has posted the target note

Contributing

  1. Fork it (https://github.com/jgaskins/moku/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors