run-what 0.9.6

HTML-first web framework powered by Rust. No JavaScript frameworks, no build steps—just HTML.
run-what-0.9.6 is not a library.

wwwhat

A Rust-based HTML framework for building server-rendered web applications with automatic interactivity.

No JavaScript frameworks. No build steps. Just HTML.

Features

  • File-based routing - site/about.html becomes /about
  • Template variables - #user.name#, #session.count#, #var|filter:arg#
  • Components - Reusable <what-*> tags with props, defaults, and slots
  • HTML injection - w-get, w-post for AJAX without JavaScript
  • Reactive session variables - Session values auto-update across the page
  • JWT authentication - Protected routes and role-based access via auth: directives
  • SQLite database - Schema declarations, auto-migration, collection queries
  • Form validation - Client + server enforcement with w-validate
  • Email sending - SMTP or Resend API, templates with #variable# syntax
  • Live reload - Changes auto-refresh during development
  • Static build - run-what build pre-renders to static HTML with minification
  • Deploy - SSH, Docker, or static hosting via run-what deploy

Installation

# Install from crates.io (recommended)
cargo install run-what

# Or build from source
git clone https://github.com/tedigo/what.git
cd what
cargo build --release

Updating

cargo install run-what

Quick Start

# Create a new project
run-what new my-site
cd my-site

# Start the development server
run-what dev

# Open http://127.0.0.1:8085

Basic Usage

Create pages in the site/ directory:

<!-- site/index.html -->
<what>
title: Home
data.session = ["counter"]
</what>

<h1>#title#</h1>
<p>Count: #session.counter|default:"0"#</p>
<button w-set="session.counter += 1">+1</button>

Routes are file-based:

  • site/index.html -> /
  • site/about.html -> /about
  • site/blog/index.html -> /blog
  • site/blog/[slug].html -> /blog/:slug

Components are HTML files in components/:

<!-- components/card.html -> <what-card> -->
<what>
props = "title"
</what>
<div class="card">
  <h3>#title#</h3>
  <slot/>
</div>

Documentation

See the docs/ folder for detailed guides:

CLI Commands

run-what new [name]              # Create a new project (starter, demo, or blank)
run-what dev [--port N]          # Start dev server with hot reload
run-what build [--output dist]   # Pre-render to static HTML
run-what deploy [--target ssh]   # Deploy (ssh, docker, static)
run-what test                    # Run template tests
run-what generate page [name]    # Generate a new page
run-what generate component [name] # Generate a new component
run-what sitemap [--host URL]    # Generate sitemap.xml
run-what doctor                  # Check project health
run-what migrate [--target d1]   # Migrate database schema (d1 or sqlite)

License

MIT