#web-framework #cli #web #framework #rust

app cargo-rustkit-web

RustKit-Web is a CLI to scaffold fullstack Rust web apps with Tailwindcss , Axum , Askama and file-based routing similar to Sveltekit or Next js

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

MIT license

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 and start 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