Skip to main content

Lemmy

Lemmy is a link aggregator for the Fediverse, similar to Reddit.

Overview

PropertyValue
LanguageRust (backend), TypeScript (frontend)
DatabasePostgreSQL
LicenseAGPL-3.0
Repositorygithub.com/LemmyNet/lemmy
Documentationjoin-lemmy.org/docs

ActivityPub Implementation

Actor Types

Lemmy uses multiple actor types:

Person (User):

{
"type": "Person",
"id": "https://lemmy.ml/u/alice",
"preferredUsername": "alice",
"inbox": "https://lemmy.ml/u/alice/inbox"
}

Group (Community):

{
"type": "Group",
"id": "https://lemmy.ml/c/programming",
"name": "!programming@lemmy.ml",
"preferredUsername": "programming",
"inbox": "https://lemmy.ml/c/programming/inbox",
"followers": "https://lemmy.ml/c/programming/followers",
"attributedTo": ["https://lemmy.ml/u/moderator"],
"publicKey": { ... }
}

Content Types

Page (Post):

{
"type": "Page",
"id": "https://lemmy.ml/post/12345",
"attributedTo": "https://lemmy.ml/u/alice",
"to": ["https://lemmy.ml/c/programming"],
"name": "Post Title",
"content": "<p>Post body</p>",
"url": "https://external-link.com",
"commentsEnabled": true,
"sensitive": false
}

Note (Comment):

{
"type": "Note",
"id": "https://lemmy.ml/comment/67890",
"attributedTo": "https://lemmy.ml/u/bob",
"inReplyTo": "https://lemmy.ml/post/12345",
"content": "<p>Great post!</p>"
}

Supported Activities

ActivityContextNotes
CreatePage, NotePosts and comments
UpdatePage, NoteEditing
DeletePage, NoteRemoval
LikePage, NoteUpvotes
DislikePage, NoteDownvotes
UndoLike, DislikeRemove vote
FollowGroupJoin community
AnnouncePageCross-posting
BlockPersonUser blocks
Add/RemoveModeratorMod actions

Community Federation

Communities federate when users from other instances:

  1. Search for the community
  2. Subscribe (Follow the Group)
  3. Posts sync to subscribers
┌──────────────┐     Follow      ┌──────────────┐
│ lemmy.ml │◀────────────────│ lemmy.world │
│ /c/programming│ │ (subscriber) │
└──────────────┘ └──────────────┘
│ ▲
│ Announce(Create(Page)) │
└────────────────────────────────┘

Custom Extensions

PropertyTypeDescription
commentsEnabledBooleanAllow comments
stickiedBooleanPinned post
languageStringContent language
sensitiveBooleanNSFW content

API Endpoints

Actor Endpoints

GET /u/{username}          # Person
GET /c/{community} # Group
GET /post/{id} # Page
GET /comment/{id} # Note

Collections

GET /c/{community}/followers
GET /c/{community}/outbox

Voting System

Unlike Mastodon's Like-only system, Lemmy supports both upvotes and downvotes:

Upvote:

{
"type": "Like",
"actor": "https://lemmy.ml/u/alice",
"object": "https://lemmy.ml/post/12345"
}

Downvote:

{
"type": "Dislike",
"actor": "https://lemmy.ml/u/alice",
"object": "https://lemmy.ml/post/12345"
}

Compatibility Notes

Interoperability

  • Posts from Mastodon appear as top-level posts
  • Lemmy comments federate as Notes
  • Groups work with platforms supporting Group actors

Known Limitations

  • Images hosted on Lemmy, not embedded in AP
  • Markdown converted to HTML for federation
  • Some vote synchronization delays

See Also