# Rwf ‐ Rust Web Framework [![Documentation](https://img.shields.io/badge/documentation-blue?style=flat)](https://levkk.github.io/rwf/) [![Latest crate](https://img.shields.io/crates/v/rwf.svg)](https://crates.io/crates/rwf) [![Reference docs](https://img.shields.io/docsrs/rwf)](https://docs.rs/rwf/latest/rwf/) [![Discord](https://img.shields.io/discord/1312902913974210600)](https://discord.gg/Q62HmJegPY) Rwf is a comprehensive framework for building web applications in Rust. Written using the classic MVC pattern (model-view-controller), Rwf comes standard with everything you need to easily build fast and secure web apps. ## Documentation 📘 The documentation **[is available here](https://levkk.github.io/rwf/)**. ## Features overview - ✔ [HTTP server](https://github.com/levkk/rwf/tree/main/examples/quick-start) - ✔ User-friendly [ORM](https://github.com/levkk/rwf/tree/main/examples/orm) to build PostgreSQL queries easily - ✔ [Dynamic templates](https://github.com/levkk/rwf/tree/main/examples/dynamic-templates) - ✔ [Authentication](https://github.com/levkk/rwf/tree/main/examples/auth) & built-in user sessions - ✔ [Middleware](https://github.com/levkk/rwf/tree/main/examples/middleware) - ✔ [Background jobs](https://github.com/levkk/rwf/tree/main/examples/background-jobs) and [scheduled jobs](https://github.com/levkk/rwf/tree/main/examples/scheduled-jobs) - ✔ Database migrations - ✔ Built-in [REST framework](https://github.com/levkk/rwf/tree/main/examples/rest) with JSON serialization - ✔ WebSockets support - ✔ [Static files](https://github.com/levkk/rwf/tree/main/examples/static-files) hosting - ✔ Tight integration with [Hotwired Turbo](https://turbo.hotwired.dev/) for building [backend-driven SPAs](https://github.com/levkk/rwf/tree/main/examples/turbo) - ✔ Environment-specific configuration - ✔ Logging and metrics - ✔ [CLI](https://github.com/levkk/rwf/tree/main/rwf-cli) - ✔ WSGI server for [migrating](https://github.com/levkk/rwf/tree/main/examples/django) from Django/Flask apps - ✔ Rack server for [migrating](https://github.com/levkk/rwf/tree/main/examples/rails) from Rails ## Quick start To add Rwf to your stack, create a Rust binary application and add `rwf` to your dependencies: ```bash cargo add rwf ``` Building an app is then as simple as: ```rust use rwf::prelude::*; use rwf::http::Server; #[controller] async fn index() -> Response { Response::new().html("

Welcome to Rwf!

") } #[tokio::main] async fn main() { Server::new(vec![ route!("/" => index), ]) .launch() .await .unwrap(); } ``` ## Examples See [examples](https://github.com/levkk/rwf/tree/main/examples) for common use cases. ## 🚦 Status 🚦 Rwf is in beta and looking for early adopters. Most features are in a good state and documentation is usable. ### 🔧 Contributions Contributions are welcome. Please see [CONTRIBUTING](https://github.com/levkk/rwf/tree/main/CONTRIBUTING.md) for guidelines, [ARCHITECTURE](https://github.com/levkk/rwf/tree/main/ARCHITECTURE.md) for a tour of the code, and [ROADMAP](https://github.com/levkk/rwf/tree/main/ROADMAP.md) for a non-exhaustive list of desired features.