Skip to content

fedify-dev/content-sharing

Repository files navigation

Federated image sharing example using Fedify and Nuxt

Warning

This program is for educational purposes only. Do not use it for any other purpose, since it has not been tested for security.

This is a small Pixelfed-style federated image sharing service built with Fedify and Nuxt. It is the companion example to the Creating a federated image sharing service tutorial. Each chapter that touches the example app lands as its own commit, with a small number of follow-up commits at the tip that fix issues spotted during the end-to-end rehearsal.

The features of this program are:

  • A single user can create an account on their own instance
  • The user can be followed by other actors in the fediverse
  • A follower can unfollow the user
  • The user can see the list of their followers
  • The user can upload image posts with captions
  • Posts made by the user are visible to their followers in the fediverse
  • The user can follow other actors in the fediverse
  • The user can see the list of actors they are following
  • The user can see posts made by actors they follow in a home timeline
  • The user can like posts, and remote actors' likes are recorded
  • The user can leave comments on posts, and remote replies are recorded

Since it is a small example for educational purposes, it has a lot of limitations:

  • Only one local account per instance
  • One image per post (no carousels)
  • The user cannot edit or delete posts
  • No boosts (reposts), no direct messages, no search
  • No pagination
  • No authentication beyond “whoever opened the browser first owns this instance”

Dependencies

This program is written in TypeScript and uses Node.js. You need Node.js 22.0.0 or later installed on your system.

It depends on a few libraries besides Fedify:

How to run

To run this program, install the dependencies first:

npm install

Create the SQLite database schema:

npm run db:push

Then start the development server:

npm run dev

This starts the server on port 3000. You can visit http://localhost:3000/ in your web browser. However, since this program is an ActivityPub server, you probably need to expose it to the public internet to talk to other servers in the fediverse. In that case, use fedify tunnel:

fedify tunnel 3000

fedify tunnel prints a public URL; open it in a browser to use the app, and other fediverse servers will be able to reach your instance at the same URL.

License

This program is licensed under the MIT License. See the LICENSE file for details.