RustyBlogger - a Rust blog with its own database

RustyBlogger is a blog engine I wrote in Rust. It stores posts in the embedded redb database, renders full HTML pages and serves them through axum. An external database, ORM and a separate frontend are not needed: everything works in one binary.

Why another blog

I wanted a site that launched quickly, did not require infrastructure, and at the same time supported several languages. RustyBlogger reads posts from redb, can switch languages, shows categories and provides OpenGraph previews for social networks.

How it works

Posts are in redb tables. A separate version of the text is stored for each language, and a slug links the translations together. If there is no translation, the site shows the default language and warns about it. The language is selected by the lang parameter, cookie parameter or the Accept-Language header. The routes are collected in one axum router. In addition to HTML pages, there is a JSON API and a separate CRUD API for the editor. Post entries are protected by the key rusty-blogger-post-editor-key, which is stored in the database settings.

Publication

The sources of the posts are in a separate repository in text format. The compiler translates the note into nine languages, collects the HTML, and sends variations through the API. Updating an existing post preserves the publication date.
cargo build --release
target/release/rustyblogger serve \
  --database blog.redb \
  --media-directory media \
  --bind-address 127.0.0.1:8080

What's next

The project is already serving this site. The plans include improving the editor, caching and more convenient work with media. The source code is open, and an example of work can be seen on the site itself.

https://github.com/zefir1990/RustyBlogger

https://zefir1990.space