A rust web framework with safety and speed in mind.

Overview

darpi

A web api framework with speed and safety in mind. One of the big goals is to catch all errors at compile time, if possible. The framework uses hyper and ideally, the performance should be as if you were using hyper yourself. The framework also uses shaku for compile time verifiable dependency injection.

The framework is in early development and will only be updated on github, until it's stable.

All feedback is appreciated.

Resources

the darpi book

discord

example app

Comments
  • gonzales is slow on my literals-only benchmark

    gonzales is slow on my literals-only benchmark

    I added gonzales to my literals-only benchmark (i.e. no params) and it's much slower than matchit (or my work-in-progress matcher):

    test literals-full/MatchIt/20    ... bench:         608 ns/iter (+/- 17)
    test literals-full/Matcher/20    ... bench:         839 ns/iter (+/- 9)
    test literals-full/gonzales/20   ... bench:        2378 ns/iter (+/- 30)
    
    test literals-full/MatchIt/200   ... bench:        9089 ns/iter (+/- 67)
    test literals-full/Matcher/200   ... bench:       18144 ns/iter (+/- 289)
    test literals-full/gonzales/200  ... bench:       49354 ns/iter (+/- 1211)
    
    test literals-full/MatchIt/2000  ... bench:      210733 ns/iter (+/- 1754)
    test literals-full/Matcher/2000  ... bench:      346750 ns/iter (+/- 5215)
    test literals-full/gonzales/2000 ... bench:      608682 ns/iter (+/- 16586)
    

    Each iteration makes 20/200/2000 matches against 18/180/1800 routes, full code is here.

    ps. I'm mentioning this because README says that "gonzales is the fastest http router in the business" but that is not the case here.

    opened by malaire 2
  • `gonzales` doesn't match uppercase letter with `ascii_case_insensitive(false)`

    `gonzales` doesn't match uppercase letter with `ascii_case_insensitive(false)`

    This test fails with gonzales = "0.0.2-beta"

    use gonzales::RouterBuilder;
    
    fn main() {
        let router = RouterBuilder::new()
            .ascii_case_insensitive(false)
            .build(vec!["/Hello"]);
        let m = router.route("/Hello");
        assert!(m.is_some());
    }
    
    opened by malaire 2
  • add handler test examples

    add handler test examples

    implements https://github.com/darpi-rs/darpi/issues/14

    No need to add framework support for this. At least, not as of yet. It's sufficient to add examples.

    opened by petar-dambovaliev 0
  • overall improvements

    overall improvements

    https://github.com/darpi-rs/darpi/issues/12 https://github.com/darpi-rs/darpi/issues/10 https://github.com/darpi-rs/darpi/issues/2

    Added tests and benchmarks, refactored routing, added graceful shutdown and server startup notification.

    opened by petar-dambovaliev 0
  • improve routing performance

    improve routing performance

    At the moment, the code generated by the app is a match statement on the parsed incoming request path. That could be improved by making additional checks on the number of slashes in a path. It could be immediately discarded, if the application doesn't have a defined route with that amount. Routes can also be grouped in different match statements based on that number and thus potentially removing some comparisons that could lead to small performance gains.

    Deserialization of path variables is also doing more work than it should.

    opened by petar-dambovaliev 0
  • Build a website with an introduction, quickstart and an overview

    Build a website with an introduction, quickstart and an overview

    All the competition, like https://rocket.rs/ and https://actix.rs/ have nice looking websites with expansive introduction and quickstart tutorials. The big features for the framework have already been added and this is necessary for people to be able to start using the framework. It would be cool to have the first real project built with the framework to be its own representative website.

    I would need help, at least for the front end. Volunteers are welcomed.

    help wanted 
    opened by petar-dambovaliev 2
  • Make FromRequestBody(WithContainer) trait nicer

    Make FromRequestBody(WithContainer) trait nicer

    https://github.com/rust-lang/rust/issues/29661

    The problem: Objects that implement the trait sometimes do not care about the container type. Therefore, it is set to std::any::Any. However, since there are no associated type defaults, there need to be 2 traits. One with a container and one without. There is an implementation of all types that implement the trait without container to implement the trait with container specifying std::any::Any. This could be simplified a lot by having the language feature mentioned above.

    enhancement 
    opened by petar-dambovaliev 1
Actix Web is a powerful, pragmatic, and extremely fast web framework for Rust.

Actix Web is a powerful, pragmatic, and extremely fast web framework for Rust.

Actix 16.2k Jan 2, 2023
Starlight is a JS engine in Rust which focuses on performance rather than ensuring 100% safety of JS runtime.

starlight Starlight is a JS engine in Rust which focuses on performance rather than ensuring 100% safety of JS runtime. Features Bytecode interpreter

null 453 Dec 31, 2022
Sauron is an html web framework for building web-apps. It is heavily inspired by elm.

sauron Guide Sauron is an web framework for creating fast and interactive client side web application, as well as server-side rendering for back-end w

Jovansonlee Cesar 1.7k Dec 26, 2022
A (flash) message framework for actix-web. A port to Rust of Django's message framework.

actix-web-flash-messages Flash messages for actix-web Web applications sometimes need to show a one-time notification to the user - e.g. an error mess

Luca Palmieri 31 Dec 29, 2022
Ergonomic and modular web framework built with Tokio, Tower, and Hyper

axum axum is a web application framework that focuses on ergonomics and modularity. More information about this crate can be found in the crate docume

Tokio 7.9k Dec 31, 2022
Thruster - An fast and intuitive rust web framework

A fast, middleware based, web framework written in Rust

null 913 Dec 27, 2022
A full-featured and easy-to-use web framework with the Rust programming language.

Poem Framework A program is like a poem, you cannot write a poem without writing it. --- Dijkstra A full-featured and easy-to-use web framework with t

Poem Web 2.2k Jan 6, 2023
Seed is a Rust front-end framework for creating fast and reliable web apps with an Elm-like architecture.

Seed is a Rust front-end framework for creating fast and reliable web apps with an Elm-like architecture.

null 3.6k Jan 6, 2023
Implementation of the RealWorld backend API spec in Actix, Rust's powerful actor system and most fun web framework.

Actix codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the RealWorld spec and API. ❗ (2021/05/13) This cod

Allen 475 Jan 2, 2023
Demo of Rust and axum web framework

Demo of Rust and axum web framework Demonstration of: Rust: programming language that focuses on reliability and stability. axum: web framework that f

Joel Parker Henderson 115 Dec 29, 2022
The simplest build-time framework for writing web apps with html templates and typescript

Encoped A build-time fast af tool to write static apps with html and TypeScript Features Template-based ESLint, Prettier and Rollup integration No ext

null 1 Dec 11, 2021
Hirola is an opinionated web framework for that is focused on simplicity and predictability.

Hirola Hirola is an opinionated web framework for that is focused on simplicity and predictability. Goals Keep it simple. Most Rust web frameworks hav

null 27 Nov 3, 2022
Starter template for use with the Leptos web framework and Axum.

Leptos Axum Starter Template This is a template for use with the Leptos web framework and the cargo-leptos tool using Axum. Creating your template rep

Leptos 10 Mar 4, 2023
axum-serde is a library that provides multiple serde-based extractors and responders for the Axum web framework.

axum-serde ?? Overview axum-serde is a library that provides multiple serde-based extractors / responses for the Axum web framework. It also offers a

GengTeng 3 Dec 12, 2023
Hot reload static web server for deploying mutiple static web site with version control.

SPA-SERVER It is to provide a static web http server with cache and hot reload. 中文 README Feature Built with Hyper and Warp, fast and small! SSL with

null 7 Dec 18, 2022
Code template for a production Web Application using Axum: The AwesomeApp Blueprint for Professional Web Development.

AwesomeApp rust-web-app More info at: https://awesomeapp.dev/rust-web-app/ rust-web-app YouTube episodes: Episode 01 - Rust Web App - Course to Produc

null 45 Sep 6, 2023
A highly customizable, full scale web backend for web-rwkv, built on axum with websocket protocol.

web-rwkv-axum A axum web backend for web-rwkv, built on websocket. Supports BNF-constrained grammar, CFG sampling, etc., all streamed over network. St

Li Junyu 12 Sep 25, 2023
A Rust web framework

cargonauts - a Rust web framework Documentation cargonauts is a Rust web framework intended for building maintainable, well-factored web apps. This pr

null 179 Dec 25, 2022
A web framework for Rust.

Rocket Rocket is an async web framework for Rust with a focus on usability, security, extensibility, and speed. #[macro_use] extern crate rocket; #[g

Sergio Benitez 19.4k Jan 4, 2023