Progressive RESTful framework that makes application development simple again. Beware that its still alpha and recommended only for personal projects, as well as rust web development training. Tutorials are available in the blog which is also built with prest. Quick peek into prest's hello world:

use prest::*;
fn main() {
    route("/", get("Hello world")).run()
}

yet another framework?

Yes. Initial motivation came from Rust itself - arguably the most reliable practical language. It's adoption is growing rapidly, but most newcomers are getting lost in the myriads of libraries and struggle to build their first apps. So, this project is aiming to provide a batteries-included basic setup.

Prest allows building full-stack cross-platform apps for the development cost of writing HTML. Database? Already embedded one. Authentication? Built-in as well. UI? Everything necessary for smooth UX is included. Deployment? Just cargo build and you'll get a single all-included server binary that can also distribute an installable PWA. This is possible thanks to a bunch of amazing dependencies described in the internals.

available features

The core of prest is built around the usual REST components: async http processing with router, middleware, handlers, state and other utilities. Default features include: embedded sql db with query builder and orm-like helpers, macros to easily embed any files, html macro for rust'y templating, and traces for extensive and convenient logging. All of the above can be compiled both for the server side and into the client's service worker to achieve powerful progressive enchancement and reuse code.

There is also a couple of optional features:

PWA build process is just a few lines of code thanks to the prest-build utility crate that also has a couple of optional features to bundle other sources with your app:

Rust ecosystem has plenty of crates for all kinds of tasks and some of them are showcased in prest's examples. You can also disable any of these features (except core) to speed up compilation or to replace with other tools.

getting started

Further docs assume that you're familiar with rust. If you aren't yet check out The Rust Book - definitely the best guide with interactive examples (available in dozens of languages!). Also, I strongly recommend skimming through the first three chapters of the async book to get an overall understanding how concurrency works in rust.

Prest tutorials are designed to start from basics and then add more and more features on top:

  1. Todo = basic full-stack todo app in just about 50 lines of code
  2. PWA = 1 + PWA capabilities and an offline view, ~80 LoC
  3. Auth = 2 + username+password and Google auth, ~130 LoC
  4. Sync = 3 + synchronization between clients, ~180 LoC

There are also todo examples with different databases - postgres through seaorm or diesel, sqlite through sqlx or turbosql, mongo, redis. Also, there is a couple of examples that showcase how one might use prest with uncommon for web development tech: web scraper, Large Language Model and a blockchain Smart Contract.

To run locally you'll need the latest stable rust toolchain. I also recommend setting up the rust-analyzer for your favourite IDE right away. To build & start any example from the cloned prest repo use cargo run -p EXAMPLE-NAME. Or just copy the selected example's code from the tutorials into local files and cargo run it. Some examples require additional setup and credentials which are mentioned in their docs.

what's next

This is a hobby project and plans change on the fly, but there are things I'd likely work on or consider next: