3 releases
Uses new Rust 2024
new 0.1.10 | May 6, 2025 |
---|---|
0.1.8 | May 6, 2025 |
0.1.7 | May 6, 2025 |
#806 in Command line utilities
43 downloads per month
20KB
416 lines
RustKit Web
๐ RustKit Web is a modern Rust-based fullstack web framework inspired by SvelteKit and Next.js, with built-in support for:
- ๐ฆ Axum (HTTP routing)
- ๐จ TailwindCSS
- ๐ฆ Askama (HTML templates with Rust)
- ๐ File-based routing
- โ SSR-ready architecture
- โ๏ธ Simple CLI (via
cargo rustkit-web
)
๐ Why RustKit?
In a web world dominated by JavaScript and its ever-evolving toolchains, RustKit Web brings clarity, performance, and safety to fullstack development. Whether you're building a personal site or a high-performance app, RustKit provides:
- ๐ฆ The power and speed of Rust
- ๐งฉ The simplicity of file-based routing
- ๐ Memory safety and reliability
- ๐งฐ A familiar DX inspired by SvelteKit/Next.js โ but with Rust!
No more juggling 10 config files. No more complex bundlers. Just plain Rust, clean HTML templates, and a CLI that just works.
โจ Features
- ๐๏ธ File-based routing like Next.js
- ๐ง Askama templates (like Jinja2/Laravel Blade)
- ๐จ Built-in TailwindCSS setup
- ๐ก Developer-friendly CLI (
cargo rustkit-web
) - ๐ง Dev + Prod modes with
build
andstart
commands - ๐ Nested routes support
๐ ๏ธ Getting Started
1. Install the CLI
cargo install cargo-rustkit-web
2. Create a New Project
cargo rustkit-web new myapp
cd myapp
3. Run Dev Mode
cargo rustkit-web dev
โ Add Routes
Create files like this:
src/routes/about/page.rs โ GET /about
src/routes/blog/post/page.rs โ GET /blog/post
Example page.rs
(Raw HTML)
use axum::response::Html;
pub async fn handler() -> Html<&'static str> {
Html("<h1>Hello from this route!</h1>")
}
Example page.rs
(Askama Template)
use askama::Template;
use axum::response::Html;
#[derive(Template)]
#[template(path = "about/page.html")]
struct AboutPage;
pub async fn handler() -> Html<String> {
Html(AboutPage.render().unwrap())
}
๐งฑ Build for Production
cargo rustkit-web build
This creates:
/build
โโโ app # compiled binary
โโโ public # static files
๐ Run Production Server
cargo rustkit-web start
This serves the production binary from /build
.
๐ Folder Structure
myapp/
โโโ src/
โ โโโ routes/
โ โ โโโ index/page.rs
โ โ โโโ hello/page.rs
โ โโโ main.rs
โโโ templates/
โ โโโ index/page.html
โ โโโ hello/page.html
โโโ public/
โ โโโ styles.css
โโโ input.css
โโโ tailwind.config.js
โโโ Cargo.toml
๐งช CLI Commands
cargo rustkit-web new <name>
cargo rustkit-web dev
cargo rustkit-web build
cargo rustkit-web start
๐ฃ Roadmap
- File + Nested routing
- Askama templates
- Tailwind integration
- CLI support
- Production build/start
- Middleware system
- HTMX/Vite plugin
- Component-based template rendering
๐ License
MIT ยฉ Mukul
Dependencies
~6โ15MB
~189K SLoC