- TypeScript 79.7%
- Svelte 10.2%
- HTML 6.4%
- CSS 1.9%
- JavaScript 1.4%
- Other 0.4%
feedsin.space!
This is the code for a service to host accounts on the fediverse that post messages from RSS feeds. It's currently being used to run feedsin.space.
Using the service
I run an instance of this code at feedsin.space. Before you can setup a feed, you need to send a fediverse message to @admin@feedsin.space with the word "help". This is an automated account, and it will respond with a link that you can use to authenticate with the service. Once you're logged in, you can create a feed. The feed requires a username and the feed URL. Once you've specified those, there will be an account at @username@feedsin.space. feedsin.space will scan the RSS feed every now and then, and if there's a new entry, it'll be posted as a status by the account.
Running the code
This is a node-based app so you will need to be comfortable with that or with using the docker-based setup. It's also almost entirely written in Typescript.
Hey I thought this was a rust-based application?
It was! I migrated it to node for a couple of reasons. As much as I like rust, I was experiencing some random challenges that were becoming more and more frustrating. I wanted to try Fedify, and I wanted to make it easier to maintain the codebase and to implement new features, so I decided to make the switch. The old code is still available.
Environment variables
There are several environment variables which you must set to run the service:
DATABASE_URLspecifies the database, and will look something likepostgres://username:password@host/dbnameINSTANCE_DOMAINis the host name of the instance, for example:feedsin.space. NOTE: Once you set this, there's no system in place to change it!LINK_BASEis used to generate links and should point to the app, for examplehttps://feedsin.space. In theory, this would be something else if the codebase ever supports being run from a subdirectory or subdomain.
Database
The database backend uses postgres, and is built with drizzle. In theory it wouldn't be very difficult to add support for other databases.
You should be able to setup the database by running npm run db:migrate or
npm run db:migrateprod (which works in production environments that might not
have all the development packages installed).
Drizzle also has a neat web-based 'studio' tool you can access by running npm run db:studio.
Web and Background Jobs
The web app is built on SvelteKit, uses the Fedify AP framework to handle federation, and pg-boss to handle background jobs.
You can run the web app locally with npm run dev.
You can run background jobs locally with npx vite-node bin/run-jobs.ts.
You can get an idea of how to run things in production by taking a look at docker-compose.yml