About Smithereen

Federated, ActivityPub-compatible social network with friends, walls, and groups.

At last something written in a strongly typed language :slight_smile:

@grishka What’s about #activitypub:c2s support in your server? Is any running instance available for developers testing?

I’m an Android developer, too, and making sense of HTML/CSS/JS hurts my head. There is definitely logic to it but it’s all so different from what I’m used to.

To be honest, I don’t really believe in c2s. It is too generalized to make any semblance of a good UX possible. Sure, you can make an email-style client where you have your inbox with incoming activities and you can send outgoing activities to other places. It encourages duplicating complex server-side logic on the client — for example, all the capability detection associated with friend requests or wall posts. It prevents protocol optimizations because you can’t, for example, expose multiple sizes and formats for images. I have 5 sizes and 2 formats (jpeg and webp) for photos, but using ActivityPub objects directly forces the use of the biggest size and jpeg, even though Android supports webp natively since about forever.

There’s going to be a proper client API at some point. There’s my private instance but I’ll set up a couple of demo ones with open signups when I’ll have the option to have open signups lol

“Smart” server can add all necessary sizes and formats based on one size sent by a client app… And also a server can and should “enrich” what client app missed… I think there should be symbiosis here between a Sever and a Client :slight_smile:
Client app is really complex, you can check number of lines of code in my app (about 53k Java lines according to SonarCloud), but this is not a problem :slight_smile:

… So, no #activitypub:c2s as I got :frowning:

waves in Golang :slight_smile:

Go is also a statically typed language! I would be happy to help discuss the various pitfalls with trying to map ActivityStreams to statically typed languages and the different approaches (if that’s even a problem for the project).

I did have some weird questions related to that, because AP objects can theoretically have more than one type. Realistically though, you still need either reflection or a big honking switch statement to map AP types to your own classes, and from there you could as well treat those multiple-type objects as special cases.

JSON-LD processing algorithms on the other hand… I just gave up and made them use JSONObjects, JSONArrays, and simple Objects throughout. In the spec, there are many places where something accepts an input that could be a number, a string, a JSON object, or an array — clearly written with something like JavaScript in mind. This was nightmarish to deal with.

I made special general purpose class that helps parsing exactly such cases: when value is either a string, an object or an array, or doesn’t exist at all.
Using this “parser” main parsing flow is quite compact, see the class: https://github.com/andstatus/andstatus/blob/91514e994bd51b2a2edfff9954f36ef4ec1f5a47/app/src/main/java/org/andstatus/app/util/ObjectOrId.java

Smithereen is now available as a docker container! See readme for details.

1 Like

Just letting you know I’m also a Java developer working on adding ActivityPub to my own project. Is there a place I can see Smithereen in action? or screenshots of the GUI? I already combed thru your Java for AP and it looks nice and clean (unlike a lot of mine!). Nice work.

I do have an instance but it’s invite-only as I don’t want to bother myself with content moderation (and I don’t have any tools for that yet). I’ll PM you an invite.

It wasn’t always like that, took a lot of refactoring to get there

Does smithereen have sever to server communication?I created two smithereen docker instance .My doubt is about how user from one instance follow user on other instance?is that possible?

Of course it does. You can enter the URL of that user into the search box to open their profile.

I am running one instance at 4567 and other instance at 4569.Each instance have its own database.I entered url of user1 ( instance1) in instance2 search box (eg: /user1).but it didnt show me anything?am I missing anything?

You need to enter the full url, e.g. http://localhost:4569/user1, and you need both instances to have correctly set domain parameter in the config, it must include the port in your case.