This was originally posted on Tildes as a comment on ~comp's weekly "What have you been working on?" topic.

I mentioned 2 weeks ago I published my first crate for Rust and that it was because I needed the functionality for another project. Well, here I am now to talk about this other project, Fed.

Fed is a feed reader with RSS, Atom and JSON Feed all supported and a focus on a decent looking UI (at least in my mind).

Programming Details

Fed is built entirely with Rust, largely on top of the Rocket web framework with various other libraries on top of that:

  • Tera templating (basically Jinja2 in Rust).
  • Ammonia for content sanitization (basically Bleach in Rust).
  • Diesel as the database ORM.
  • feed-rs for feed parsing, it's really nice as it handles a bunch of formats and maps it all to one model.
  • OPML, the crate I made for easy importing and exporting of feed lists (I'm not about to manually enter 500 feeds, lemme tell you that).
  • Sass as the CSS pre-processor, specifically rsass. It's not a complete implementation but works fine for all the things I've needed so far.

However, because Fed's still very early in development, you can only run it locally and you need a working Rust and PostgreSQL installation to do it. There is no authentication of any kind, no HTTPS, a lot of error handling is missing...

So, it's extremely simple and delicate, and likely nobody (except for myself) will end up running it for the foreseeable future. But that's okay, because I have pictures to show you what it looks like and it's capable of so far.

If you are interested in running it yourself though, installation information is available.

The Homepage

So if you went to the homepage, you'd be greeted by this interface:

The Fed homepage.

Adding a feed is pretty simple, enter the title and URL and bam, it's added.

Adding the Inside Rust blog.

Clicking on the edit feed button will take you to a very similar interface, and deleting a feed looks the same as adding one.

Editing a feed.

The Feed List

To view all your feeds at once, there is the feed list, that has a slightly extended interface than the list on the homepage. The extra info shown is:

The feed list, with extra info expanded.

Reading A Feed

From the homepage, clicking on the feed's title or the view button will take you to where you can see the feed's contents (if it was able to parse any, otherwise there will just be a link to the entry on the site). By default, the first entry is expanded at your convenience.

And here as well, there are unread markers to show you what's new since you last viewed it.

Reading a feed with and without the entry's contents.

The Settings

And for the final part, the settings, which can be accessed from anywhere through the footer. It's intentionally barren for now, so I don't have to worry about making sure everything's working with all different kinds of configurations.

The settings page.

If you've known me for more than 5 seconds though, you'll know that I can't make anything without support for themes, so yep there's a Light theme too (and if you've known me for more than 10 seconds, the theme shown is one I also made myself, isn't it lovely).

The Love Light theme in Fed.

And finally, the OPML import and export form, relatively self-explanatory. You can import an OPML document and any feeds that don't exist yet will be added (and any that do will be skipped, big thanks to Tildes user @pvik for helping me out with that). And exporting will just get you a neat little OPML file to use wherever else.

Importing an OPML file.

Behind The Scenes

Now that you've seen all the things that you can do through the site, there's also another component running at the same time, the automatic feed downloader.

Every hour, on the hour, the downloader will go through each feed and try to download it again (if it had been longer than 30 minutes since the last download).

Here's what that looks like in the logs:

[Downloader] 3 feeds found.
[Downloader] Downloading feed 4303.
[Downloader] Sleeping for 1 second.
[Downloader] Skipping 4302 as it was downloaded recently.
[Downloader] Skipping 4301 as it was downloaded recently.
[Downloader] Finished downloading feeds, sleeping for 26 minutes.

This saves you from having to go through every feed manually to figure out if there's something new and gives Fed the ability to show new unread markers on feeds in the feed list, since otherwise it wouldn't be able to figure out if anything new happened.

Alright, so that's Fed. If you've gotten this far, thanks for reading!