Fedify: an ActivityPub server framework's avatar

Fedify: an ActivityPub server framework

@[email protected] · 7 following · 374 followers

Fedify is a TypeScript library for building federated server apps powered by ActivityPub and other standards, so-called fediverse. It aims to eliminate the complexity and redundant boilerplate code when building a federated server app, so that you can focus on your business logic and user experience.

WebsiteGitHubJSRnpm

https://fedify.dev/

https://github.com/dahlia/fedify

https://jsr.io/@fedify/fedify

https://www.npmjs.com/package/@fedify/fedify

Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@[email protected]

Released Fedify 0.14.1 & 0.13.2, which fix a few bugs in the fedify inbox command:

洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@[email protected]

If you'd like to support the development of or , you can sponsor me on GitHub!

github.com/sponsors/dahlia

洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@[email protected]

This frustration later became the impetus for creating @fedify:

todon.eu/@hongminhee/110971265

Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@[email protected]

We've released v0.14.0 of , the server framework, with the following key changes:

Fedify v0.14.0 is available from JSR and npm. See also the full changelog for details.

Happy !

Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@[email protected] · Reply to John Spurlock's post

We've added the Inspecting ActivityPub objects section to the docs, introducing BrowserPub and the fedify lookup command!

https://unstable.fedify.dev/manual/test#inspecting-activitypub-objects

Inspecting ActivityPub objects

BrowserPub

BrowserPub is a browser for debugging ActivityPub and the fediverse. You can punch in any ActivityPub discoverable web URL or fediverse handle, and it will discover and display the underlying ActivityPub.

For example:

• hollo.social/@fedify
• @hongminhee@fosstodon.org

If you want to know further details about BrowserPub, read the creator's Mastodon thread.

fedify lookup command

Fedify provides a CLI toolchain for testing and debugging. The fedify lookup command is a simple tool for looking up an ActivityPub object by its URL or fediverse handle.
Inspecting ActivityPub objects BrowserPub BrowserPub is a browser for debugging ActivityPub and the fediverse. You can punch in any ActivityPub discoverable web URL or fediverse handle, and it will discover and display the underlying ActivityPub. For example: • hollo.social/@fedify • @[email protected] If you want to know further details about BrowserPub, read the creator's Mastodon thread. fedify lookup command Fedify provides a CLI toolchain for testing and debugging. The fedify lookup command is a simple tool for looking up an ActivityPub object by its URL or fediverse handle.
Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@[email protected] · Reply to John Spurlock's post

We've added the Inspecting ActivityPub objects section to the docs, introducing BrowserPub and the fedify lookup command!

https://unstable.fedify.dev/manual/test#inspecting-activitypub-objects

Inspecting ActivityPub objects

BrowserPub

BrowserPub is a browser for debugging ActivityPub and the fediverse. You can punch in any ActivityPub discoverable web URL or fediverse handle, and it will discover and display the underlying ActivityPub.

For example:

• hollo.social/@fedify
• @hongminhee@fosstodon.org

If you want to know further details about BrowserPub, read the creator's Mastodon thread.

fedify lookup command

Fedify provides a CLI toolchain for testing and debugging. The fedify lookup command is a simple tool for looking up an ActivityPub object by its URL or fediverse handle.
Inspecting ActivityPub objects BrowserPub BrowserPub is a browser for debugging ActivityPub and the fediverse. You can punch in any ActivityPub discoverable web URL or fediverse handle, and it will discover and display the underlying ActivityPub. For example: • hollo.social/@fedify • @[email protected] If you want to know further details about BrowserPub, read the creator's Mastodon thread. fedify lookup command Fedify provides a CLI toolchain for testing and debugging. The fedify lookup command is a simple tool for looking up an ActivityPub object by its URL or fediverse handle.
Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@[email protected]

Do you know that? Some of the properties in Activity Vocabulary have been renamed in 's JavaScript APIs. Below are some examples:

洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@[email protected] · Reply to 洪 民憙 (Hong Minhee)'s post

I'm sharing a prototype of written in , codenamed “FediKit.” Many of the ideas for Fedify were already implemented in this prototype, albeit in a different language.

github.com/dahlia/fedikit

Винт Прокс's avatar
Винт Прокс

@[email protected] · Reply to Йошильда :CrabVerified:'s post

@cybertailor @oleg_ru

Касаясь систем управления контентом с поддержкой , хотелось бы отметить и библиотеку для построения собственного федеративного сервера @fedify. Отлично подходит, когда "все эти ваши вордпрессы мне нафиг не сдались". :blobcatmeltthumbsup:

洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@[email protected]

For educational purpose, I've created a federated microblog example using , with a total of about 30 commits, which you can follow step by step.

Now, I'm starting to write a hands-on Fedify tutorial based on this example code. I'll make it public when I'm done!

github.com/dahlia/microblog

洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@[email protected]

I've rewritten several times and in several languages. The first time it was written in , then , then C#, then back to TypeScript. (It was codenamed FediKit at the time of development.) I settled on TypeScript for the following reasons:

• It has a decent JSON-LD implementation.
• Lots of people use it. (I wanted Fedify to be widely used.)
• It's type-safe enough.

Even if I were to build Fedify again, I would choose TypeScript.

Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@[email protected]

Did you know? not only fully supports .js, but also and !

Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@[email protected]

Security alert for Fedify users

We've patched a vulnerability in the getActorHandle() function. Versions prior to 0.13.1 and 0.12.3 are affected.

Upgrade immediately:

Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@[email protected]

In the next version (v0.14.0) of , the performance of the Object.toJsonLd() method will be dramatically (~3k ×) faster. This is expected to improve the overall performance of Fedify apps!

Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@[email protected] · Reply to Fedify: an ActivityPub server framework's post

Oh, and in the template for Deno, compilerOptions is added to the deno.json file (if needed).

Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@[email protected]

The next version of fedify init will also generate a tsconfig.json file with decent default settings.

洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@[email protected]

I feel that the current abstraction level of is not high enough which makes the tutorial lengthy, so I'm considering adding a higher-level API. One way would be to add a façade to the @fedify/fedify package, and another way would be to create a sort of metaframework as a separate package (e.g., @fedify/start?). Which way would be better?

OptionVoters
Façade0 (0%)
Metaframework0 (0%)
Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@[email protected]

Fedify, the server framework, has released v0.13.0. Key changes include:

v0.13.0 is available now from JSR and npm.

https://github.com/dahlia/fedify/releases/tag/0.13.0

Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@[email protected]

What other web frameworks would you like to see integrate with more?

OptionVoters
Koa4 (16%)
Fastify5 (20%)
Oak3 (12%)
Elysia3 (12%)
Next.js6 (24%)
Nuxt.js4 (16%)
Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@[email protected]

What other web frameworks would you like to see integrate with more?

OptionVoters
Koa4 (16%)
Fastify5 (20%)
Oak3 (12%)
Elysia3 (12%)
Next.js6 (24%)
Nuxt.js4 (16%)
Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@[email protected]

Introducing @fedify/express, a package that integrates Express, a popular web framework in Node.js, with Fedify. You can install it with the following command:

npm add @fedify/express

This package provides a middleware called integrateFederation() that allows you to integrate with :

import express from "express";
import { integrateFederation } from "@fedify/express";
import { federation } from "./federation";  // Your `Federation` instance

export const app = express();

app.set("trust proxy", true);

app.use(integrateFederation(federation, (req) => "context data goes here"));

https://github.com/dahlia/fedify-express

洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@[email protected]

I'm unsure whether to adopt an emerging JavaScript runtime like or for 's tutorial, or stick with traditional .js. 🤔

If I choose Bun/Deno, it comes with built-in support, hot reloading, and a fetch-style HTTP server, so I don't have to explain much about it, but I need to deal with installing Bun/Deno itself.

On the other hand, Node.js can be assumed to be already installed on the reader's system, but they will need to set up TypeScript, hot reloading, etc.

OptionVoters
Bun0 (0%)
Deno0 (0%)
Node.js0 (0%)
Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@[email protected]

Starting with the next release, v0.13.0, the fedify tunnel command will be added. The following command exposes a local HTTP server running on port 3000 to the public internet:

fedify tunnel 3000

https://unstable.fedify.dev/cli#fedify-tunnel-exposing-a-local-http-server-to-the-public-internet

洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@[email protected]

I ended up implementing the `fedify tunnel` command to eliminate the ngrok installation and sign-up part of the tutorial. 😂

unstable.fedify.dev/cli#fedify

Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@[email protected] · Reply to Fedify: an ActivityPub server framework's post

() 개발을 단순화할 준비가 되셨나요? 프레임워크를 확인해보세요!

더욱 연결된, 더욱 분산된 웹을 만드는 데 동참해주세요! 🌐

Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@[email protected] · Reply to Fedify: an ActivityPub server framework's post

프레임워크는 실제 쓰임에 집중하고 있습니다. 문서에는 같은 주요 구현체들이 만든 사실상의 표준에 맞춘 어휘 API 사용법에 대한 가이드가 포함되어 있습니다. 더 적은 고민으로 상호 운용 가능한 앱을 만드세요! 🤝

Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@[email protected] · Reply to Fedify: an ActivityPub server framework's post

인터랙션 디버깅은 꽤 까다롭죠. 그렇지만 툴체인이 도와드립니다! 테스트와 디버깅을 위한 CLI 툴체인을 포함하고 있어 개발과 트러블슈팅이 쉬워집니다. 머리 싸매는 시간을 줄이고 멋진 기능을 만드는 데 더 많은 시간을 쓰세요! 🔍

Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@[email protected] · Reply to Fedify: an ActivityPub server framework's post

프레임워크는 () 개발에 중요한 기능들을 기본으로 내장하고 있습니다:

Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@[email protected] · Reply to Fedify: an ActivityPub server framework's post

유연성은 중요하죠! 프레임워크는 풀 스택 솔루션이 아닙니다—여러분이 좋아하는 웹 프레임워크와 함께 작동하도록 설계되었죠. 등, Fedify는 여러 웹 프레임워크와의 쉬운 통합 옵션을 제공합니다. 여러분만의 방식으로 () 앱을 만드세요! 🛠️

Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@[email protected] · Reply to Fedify: an ActivityPub server framework's post

Fedify의 가장 강력한 기능 중 하나는 타입 안전한 어휘 객체입니다. 이는 Activity Vocabulary와 벤더 별 확장을 표현하는데, ActivityPub 객체와 액티비티를 다룰 때 견고하고 안전한 코드를 보장합니다. 런타임 오류와 작별하고 자신 있는 코딩을 시작하세요! 💪🏼

Older →