A minimial activitypub server written for Bun.js
Find a file
2023-09-27 14:13:10 +10:00
.vscode Initial commit 2023-09-16 10:28:06 +10:00
_content Added dislikes, shares/boosts, replies and deleting posts 2023-09-21 17:04:27 +10:00
src Utilize 11ty to build static pages and modify server to serve them 2023-09-27 14:13:10 +10:00
.eleventy.js Utilize 11ty to build static pages and modify server to serve them 2023-09-27 14:13:10 +10:00
.gitignore Utilize 11ty to build static pages and modify server to serve them 2023-09-27 14:13:10 +10:00
bun.lockb Utilize 11ty to build static pages and modify server to serve them 2023-09-27 14:13:10 +10:00
package.json Utilize 11ty to build static pages and modify server to serve them 2023-09-27 14:13:10 +10:00
README.md Update the readme 2023-09-16 11:24:47 +10:00
tsconfig.json Initial commit 2023-09-16 10:28:06 +10:00

bun-activitypub

This is a basic ActivityPub server written in JavaScript, using Bun.
It is very much based on existing work but has been re-written to work with Bun instead of Node/Express. This is as much about a personal learning experience as anything.

In the beginning, this server only supports following/unfollowing (and being followed/unfollowed in return), as well as posting simple notes - which do get sent out to followers.

Rather than store data in a database, it currently stores create activity data in json files, and created posts in markdown files with YAML frontmatter for metadata.
The hope is this will allow me to use something like 11ty to generate my own website for people to view and interact with my posts in the future.
I may also experiment with pushing the content to a seperate git repository so I can utilize automated scripts to build and publish the web front-end.

Dependencies

  • Bun has it's own built-in http server, so this project uses that rather than something like Express.
  • It uses node-forge for signing and verifying signed posts, as Bun does not yet implement the required node:crypto methods
  • It uses gray-matter for writing and parsing YAML frontmatter in Markdown files

Development

To install dependencies:

bun install

To run:

bun run start

This project was created using bun init in bun v1.0.0. Bun is a fast all-in-one JavaScript runtime.