# Ktistec - an ActivityPub Server

**URL:** <https://forum.crystal-lang.org/t/ktistec-an-activitypub-server/3010>\
**Category:** News\
**Created:** [March 8, 2021, 3:40pm UTC](https://forum.crystal-lang.org/t/ktistec-an-activitypub-server/3010 "2021-03-08T15:40:53Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![tsundsted](https://avatars.discourse-cdn.com/v4/letter/t/ecccb3/32.png) [@tsundsted](https://forum.crystal-lang.org/u/tsundsted)\
**Post date:** [March 8, 2021, 3:40pm UTC](https://forum.crystal-lang.org/t/ktistec-an-activitypub-server/3010/1 "2021-03-08T15:40:53Z")

</div>

I’m posting this here for project feedback.

[Ktistec](https://github.com/toddsundsted/ktistec) is an [ActivityPub](https://www.w3.org/TR/activitypub/) server. I’ve gotten it to the point where it meets my needs – it federates with Mastodon and most other mature servers, it handles posting, following, sharing/boosting/announcing, liking, etc. and it performs well. I’ve been running it in production at [Epiktistes](https://epiktistes.com/) for ~6 months with no real snags. I’m interested in your thoughts on what it needs.

Note: a few limitations are features – it’s not intended to support large numbers of users, and it’s not designed to support databases other than SQLite. It is meant to be the perfect home for a single-user in the Fediverse.

Thanks!

---

<div class="post-metadata">

**Author:** ![wrq](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/wrq/32/761_2.png) [@wrq](https://forum.crystal-lang.org/u/wrq)\
**Post date:** [March 10, 2021, 11:33am UTC](https://forum.crystal-lang.org/t/ktistec-an-activitypub-server/3010/2 "2021-03-10T11:33:15Z")

</div>

Very cool! I’ve been meaning to try and find time for an ActivityPub implementation in crystal, so great that you’re bringing it to the ecosystem.

I’d love to read a blog post or something a bit more in-depth about the development process.

---

<div class="post-metadata">

**Author:** ![sdogruyol](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/sdogruyol/32/38_2.png) [@sdogruyol](https://forum.crystal-lang.org/u/sdogruyol)\
**Post date:** [March 10, 2021, 11:42am UTC](https://forum.crystal-lang.org/t/ktistec-an-activitypub-server/3010/3 "2021-03-10T11:42:03Z")

</div>

Wow, good job! I’m surprised to see an ActivityPub related project in Crystal…plus you’re using Kemal 🙂 Keep up the good work.

---

<div class="post-metadata">

**Author:** ![tsundsted](https://avatars.discourse-cdn.com/v4/letter/t/ecccb3/32.png) [@tsundsted](https://forum.crystal-lang.org/u/tsundsted)\
**Post date:** [March 10, 2021, 3:25pm UTC](https://forum.crystal-lang.org/t/ktistec-an-activitypub-server/3010/4 "2021-03-10T15:25:08Z")

</div>

Thanks! [Kemal](https://github.com/kemalcr/kemal) has been perfect for this project. That and [Spectator](https://gitlab.com/arctic-fox/spectator) are my two most relied upon projects is Crystal-land.

---

<div class="post-metadata">

**Author:** ![erdnaxeli](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/erdnaxeli/32/1242_2.png) [@erdnaxeli](https://forum.crystal-lang.org/u/erdnaxeli)\
**Post date:** [April 13, 2021, 8:42pm UTC](https://forum.crystal-lang.org/t/ktistec-an-activitypub-server/3010/5 "2021-04-13T20:42:57Z")

</div>

Nice project!

I once tried to implement ActivityPub in Go… not a great succes 😅

Is there a way to use your project as a lib? Like using the part that talks ActivityPub, sends and receives messages, without the UI. This could be useful to make any project talks ActivityPub.

---

<div class="post-metadata">

**Author:** ![jhass](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/jhass/32/1779_2.png) [@jhass](https://forum.crystal-lang.org/u/jhass)\
**Post date:** [April 14, 2021, 7:51am UTC](https://forum.crystal-lang.org/t/ktistec-an-activitypub-server/3010/6 "2021-04-14T07:51:47Z")

</div>

The complexity in ActivityPub isn’t very reusable though. The issue is that people think, understandable so since it’s wrongly promoted as such everywhere and by everyone, that it’s a standard or protocol for federated social networking, something that defines entities and interactions well, while in reality it really doesn’t achieve being much more than a wire protocol. That is a way to encode entities and interactions and so it leaves defining those entities and interactions to being whatever implementation details a particular author chooses. So you’re still left with figuring out what the projects you want to be compatible with actually do. The reusable part of encoding and decoding stuff isn’t the hard part here unfortunately.

---

<div class="post-metadata">

**Author:** ![tsundsted](https://avatars.discourse-cdn.com/v4/letter/t/ecccb3/32.png) [@tsundsted](https://forum.crystal-lang.org/u/tsundsted)\
**Post date:** [April 14, 2021, 1:53pm UTC](https://forum.crystal-lang.org/t/ktistec-an-activitypub-server/3010/7 "2021-04-14T13:53:53Z")

</div>

@erdnaxeli it could in theory, but in practice, it’s not general enough – i implemented enough for my use cases, but there’s a lot it doesn’t do. and as @jhass points out, there would still be a lot of work to do to implement the interactions.

---

<div class="post-metadata">

**Author:** ![erdnaxeli](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/erdnaxeli/32/1242_2.png) [@erdnaxeli](https://forum.crystal-lang.org/u/erdnaxeli)\
**Post date:** [April 14, 2021, 5:17pm UTC](https://forum.crystal-lang.org/t/ktistec-an-activitypub-server/3010/8 "2021-04-14T17:17:01Z")

</div>

> [@jhass](#):
>
> So you’re still left with figuring out what the projects you want to be compatible with actually do. The reusable part of encoding and decoding stuff isn’t the hard part here unfortunately.

True. While I was experimenting in go it was actually more “reverse engineering Mastodon” than implementing ActivityPub.

@tsundsted ok, I would look at it anyway, maybe it will motivate me to actually do that project 🙂

---

<div class="post-metadata">

**Author:** ![tsundsted](https://avatars.discourse-cdn.com/v4/letter/t/ecccb3/32.png) [@tsundsted](https://forum.crystal-lang.org/u/tsundsted)\
**Post date:** [April 15, 2021, 3:19pm UTC](https://forum.crystal-lang.org/t/ktistec-an-activitypub-server/3010/9 "2021-04-15T15:19:54Z")

</div>

One loose goal of mine is to add scripting capability into Ktistec. (Ideally Ruby syntax, but probably something like Lua because I don’t want to yak-shave an interpreter side project.) If your goal is to build tools on top of ActivityPub, this may help accomplish that. But it wouldn’t be enough to, for example, build a PeerTube alternative in Crystal on top of Ktistec.

---

<div class="post-metadata">

**Author:** ![tsundsted](https://avatars.discourse-cdn.com/v4/letter/t/ecccb3/32.png) [@tsundsted](https://forum.crystal-lang.org/u/tsundsted)\
**Post date:** [April 25, 2021, 3:38pm UTC](https://forum.crystal-lang.org/t/ktistec-an-activitypub-server/3010/10 "2021-04-25T15:38:46Z")

</div>

@wrq i’ve finally linked together all of my posts about ktistec into a devlog of sorts. the tail of the series starts here:

[https://epiktistes.com/tags/ktistec](https://epiktistes.com/tags/ktistec)
