main amadaluzia/justsocial / docs / design.md

justsocial's design

The problem, and why justsocial is being made

The fediverse loves inflation, and the proof is in the ActivityPub implementations. Case in point: Mastodon is written with Ruby on Rails, Wafrn, Misskey and therefore Sharkey are written in TypeScript, with frameworks like Angular and React, and they all and GoToSocial and snac use SQL, OpenSSL and even worse as dependencies. The problem is not that the Fediverse likes inflation, the problem is that it's affecting our clients. The solution is to have a server embraces minimalism and extensibility.

How to achieve minimalism

Firstly, and this is the most important step, do not add any extra features. Add the core features that everyone uses for Fediverse and don't even think of adding anything else. This keeps justsocial minimal, cheap and robust, because we won't have any extra features, and therefore any extra code. Adding features that's more of a want than a need will result in justsocial becoming bloated, and therefore against anything the project stands for.

Another statement I should make is that reducing code will also include dependencies. For example: while we can use OpenSSL, we shouldn't because OpenSSL is absolutely massive. To elaborate, while it is battle-tested and has TLSv1.3 support, something like BearSSL is much smaller and therefore should be more secure, even with it being stuck to TLSv1.2. Likewise, replacing curl with a more minimal HTTP library would be a good call to reduce the amount of code that's included into the project.

The conclusion should be that there should be enough code for a barebones Fediverse server. However, I believe that others will absolutely want to add their own stuff DWM-style into justsocial, and while it is nice, I don't trust that users know how to do that responsibly. Which is why I want to include Lua support, despite it not being necessary for the sake of a Fediverse server. We need to achieve extensibility to make this project nice for people to use, while not introducing any bloat to the Fediverse server itself.

How to achieve extensibility

Of course, a minimal fediverse server will be boring as it will be missing many of the features that are found in already established servers like Sharkey and Wafrn. It absolutely should stay that way by default, but allowing users to extend it with a plugin system will be much neater than forcing users to fork and maintain their changes with any new updates to our project. Furthermore, it would save maintainers the extra effort and time spent on features that do not and should not for our philosophy be in a Fediverse server.

The solution to this is to have a plugin system for justsocial, allowing users to add their own changes on top of justsocial. Plugins will be written in Lua, and stored in a structure similar to this:

  plugins/
  - reactions.lua
  - .disabled-plugin.lua
  - status/
    - init.lua
    - util.lua

We expect users to check the plugins they use, and any security issue that happens as a result of a malicious plugin is not our problem.

How do people even use the Fediverse?

(WIP)