Skip to content

Build federated content sharing example and tutorial (Nuxt + Node.js) #693

@dahlia

Description

@dahlia

Sub-issue of #99. Deliver the federated content sharing platform scenario as a paired example repository and fedify.dev tutorial, as set in #99 (comment).

Scenario

A federated image-sharing platform, Pixelfed-like in shape. Users sign up for accounts, upload images with short captions, follow remote accounts, and see an image-focused timeline. The didactic centerpiece is Announce (boost) semantics: how to model, emit, receive, and render boosted content in a Fedify-based service.

Image posts are represented as Create(Note) with attachment: [Image, ...], matching the convention that Mastodon and Pixelfed already use for interoperability. The example focuses on images; short video is noted as a viable extension but is not implemented here, since transcoding and adaptive-bitrate concerns quickly dominate the federation-learning value.

Stack

  • Framework: Nuxt (Nitro server routes for ActivityPub)
  • Integration package: @fedify/nuxt
  • Runtime: Node.js
  • ORM: Drizzle ORM
  • Database: PostgreSQL
  • Media storage: local filesystem for the first pass. The tutorial notes how to swap in S3-compatible object storage for production use.

Feature checklist

  • Signup / login: minimal username-and-password auth.
  • Per-user actor (Person) with avatar (icon) and optional header (image). WebFinger, persisted key pair per user, followers and following collections.
  • Image upload and post: accepts one or more image files, optional caption, persists files to local storage, and federates to followers as Create(Note) with attachment: [Image]. Image objects carry url, mediaType, and width / height.
  • Edit / delete own posts: Update(Note) and Delete(Note) with Tombstone.
  • Boost (Announce) and unboost (Undo(Announce)) of any visible post.
  • Likes (Like / Undo(Like)) on any visible post.
  • Follow / unfollow remote or local actors.
  • Inbox handlers: Follow (auto-accept), Undo(Follow), Create(Note) (including attached media from remote servers), Announce, Undo(Announce), Like, Undo(Like), Delete(Note), Update(Note).
  • Home timeline: own posts, followed accounts' posts, and boosts from followed accounts (boosted posts clearly attributed to the original author).
  • Local timeline: public posts authored on this instance.

Deliverables

  1. Create fedify-dev/nuxt-content-sharing under the fedify-dev org. Full runnable Nuxt app implementing the feature checklist above.
  2. Write docs/tutorial/content-sharing.md on fedify.dev as a step-by-step walkthrough of building the example from scratch. The tutorial should cover @fedify/nuxt setup in Nitro, attaching images to Create(Note), Announce emission and inbox handling, and rendering boosted content in a timeline.
  3. Add the new tutorial to TUTORIAL.items in docs/.vitepress/config.mts.
  4. README of fedify-dev/nuxt-content-sharing links back to the tutorial.
  5. Tutorial cross-links the Node.js section of the Deployment docs (Best practices for production deployments #689) and the @fedify/nuxt integration docs.
  6. Add an entry to CHANGES.md.

Out of scope

  • Video transcoding, adaptive bitrate, or video-specific post types. The example is image-focused.
  • Object storage adapters (S3, R2, etc.) as first-class features. The tutorial mentions the swap, but the example ships with local filesystem storage.
  • Direct messages, moderation (blocks, mutes, reports), admin UI, lists, notifications UI.
  • Deep threading. One level of inReplyTo is accepted from remote servers and rendered, but nested threads are not a focus.

Metadata

Metadata

Assignees

Labels

examplesExample code relatedtype/documentationImprovements or additions to documentation

Type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions