Ruxt
Ruxt is a Rust web framework written on top of Actix-web. It was written to make it easier to write plain HTML web applications in Rust, specifically utilizing the HTMX library!
This project is still in its early stages and is not recommended for production use.
Installation
Add the following to your Cargo.toml:
[]
= "0.1.0"
Usage
- Create a new project with the following command:
- Create a new directory called
pagesin the root of your project. - Create a new file called
index.rsin thepagesdirectory. - Add the following code to
index.rs:
use ;
pub async
- Add the following code to your
main.rsfile:
async
- Run your project with the following command:
Current Features
- Basic file-based routing
Planned Features
- Dynamic routing
- JSX-like templating
- Middleware
- Static file serving
- Next.js-like layout system
- 404 handling
- Tailwind tooling integration
- CLI tooling for creating new projects
- Better error messaging
More to come!
Feel free to open an issue if you have any feature requests or suggestions.
Current Limitations
The way the proc-macro is programmed does not account for a block inside the HttpServer::new function.
Meaning that this will work:
new
But this will not:
let server = new;
This is a dumb limitation and I'm working on fixing it.
The routing system is also very basic and does not support any kind of dynamic routing. This is something I'm working on as well.
Basically, you can play with this, but shouldn't deploy anything with it yet.
How it works
Ruxt uses a file-based routing system.
This is accomplished using a custom proc-macro that reads the contents of the pages directory and generates a new main function that creates a new Actix-web server with routes for each file in the pages directory.
License
This project is licensed under the MIT license.