3 unstable releases
new 0.1.1 | May 6, 2025 |
---|---|
0.1.0 | Mar 8, 2025 |
0.0.0 | Feb 20, 2025 |
#2248 in Procedural macros
96 downloads per month
Used in 2 crates
(via quokka)
21KB
445 lines
Quokka is not yet production ready, many parts might change but a basic documentation is there and for everyone who likes to check out new stuff it's worth looking into
Quokka
This framework is pretty opinionated and focuses on ergonomics and simplicity with providing and option to easily provide bundles which can be plugged into every application to extend it.
Why another web framework?
In Rust we already have quiet some framework which also come with some opinionated APIs, but they all fail at some point due to personal preferences like the choice of the database handling, templating or outdated dependencies.
As an opinionated library this should should provide another approach to an old-school way of building web applications with a decent flexibility in the backend and frontend.
"Core" libraries
While these are not all the dependencies, of cause, this list should guide you to a hint at what kind of technology you have to expect while working with this library.
As "core" libraries these will get special attention in terms of updates. I might miss some patch versions, but all minor versions and all bigger patch versions should be taken on the way ensuring an always up-to-date experience with all stable features (that said, I will not update to rc versions).
Library | Usage | Notes |
---|---|---|
axum | Providing routing and a variety of extractors and response types | |
handlebars | HTML Templating | |
sqlx | Database access | |
grass | Styling with Sass/SCSS | |
rust-embed | Providing resources to the applicating. Embeds them into the application for production deployments and loads them from disk for develpment. | |
clap | Providing the argument parsing for commands |
Features
Feature | Description |
---|---|
Configuration | Configure modules and bundles using a toml file. Config files can be merged. Multiple config files can be passed in using the CONFIG_PATH environment variable. Multiple files can be separated with a : . |
Templating | Allows templating using the handlebars templating language. Templates can be registered as from a static string or a rust-embed struct. They can are hot-reloaded for debug releases |
Styling | Allows styling HTML using SASS/SCSS. The styles will be hot-reloaded as being rust-embed structs. |
Scripting | Provide scripts from a rust-embed source. Hot reload is supported as the rust-embed supports it. |
Database | Provides two connections for reading and writing to databases. |
Resources | Provides a static assets for the web application. They will be served with Cache-Control through the /resources endpoint. Also they support hot reloading as of rust-embed. |
Template helpers | There are helpers in place for serving static templates, templates that are being enriched with data and templates templates that submit a form and store/process the data. |
Session | Provide a mechanic for handling sessions using cookies |
Simplified Database Access | There are helpers in place for creating entity repositories. Mapping data to Entity structs is done using the sqlx::FromRow trait. |
Bundles (aka Pouch es) |
They provide a way to bundle all the functionallity of an application or library with routes, templates and other logic. |
Commands | Allows to register command handlers and calling them from an extra binary. |
Mailing | A state for configuring and sending emails using the mail_send trait. |
Documentation
Quokka has a book! You should be able to get a good overview of what Quokka can do, how you use can it and what it's purpose is. If you still have questions or have ideas how to improve the documentation feel free to open an issue and assign the any matching label to it.
Another starting point is the examples directory it provides various examples for a lot of parts of Quokka.
Dependencies
~0.6–1MB
~23K SLoC