Smeltery
Get started
v0.1.0 MIT OR Apache-2.0 · Rust 1.94+

The forge for Rust web apps and agents.

Batteries-included full-stack Rust: routing, models, Mold templates, live components, auth, supervised agents and code generators. Zero hand-written JS.

$ cargo install smeltery

01 · smeltery new

One command lights the forge.

smeltery new asks a few questions. Every question is also a flag, and at the end it prints the equivalent one-line command.

terminal
cargo install smeltery
smeltery new my-app
cd my-app && smeltery serve

Tailwind is installed by smeltery new as a standalone binary (no Node, about 110 MB, checked against its SHA-256); the app also ships a prebuilt app.css, so its pages look right even when that download is skipped or fails (smeltery tailwind:install retries).

With the optional Alpine.js question, the app gets Alpine.js 3.17.4 from a copy embedded in the CLI: nothing is downloaded and no Node is needed; the layout loads it after the Sparks script.

smeltery new my-app — zsh
$ smeltery new my-app

  
  ────────────────────────────────────────────────────────────────────
  Batteries-included full-stack Rust · v0.1.0

  ◆ Project
    ↑↓ move · enter confirm
✓ What are you building? Web app
  ────────────────────────────────────────────────────────
  ◆ Database
    ↑↓ move · enter confirm
✓ Database SQLite
  ────────────────────────────────────────────────────────
  ◆ Starter kit
    ↑↓ move · enter confirm
✓ Starter kit Mold + Sparks
  ────────────────────────────────────────────────────────
  ◆ Tailwind
    y / n · enter confirm
✓ Install Tailwind? Yes
  ────────────────────────────────────────────────────────
  ◆ Alpine.js
    y / n · enter confirm
✓ Alpine.js? No
  ────────────────────────────────────────────────────────
  ◆ Building blocks
    ↑↓ move · space toggle · enter confirm
✓ Which building blocks should we smelt into your stack? Watchfire, Temper
  ────────────────────────────────────────────────────────
  ◆ Bellows
    ↑↓ move · space toggle · enter confirm
✓ Bellows AI-agent support 
  ────────────────────────────────────────────────────────
  ◆ Migrations
    y / n · enter confirm
✓ Run migrations? Yes
  ────────────────────────────────────────────────────────
  ◆ Seeders
    y / n · enter confirm
✓ Run seeders? Yes
  ────────────────────────────────────────────────────────
  ◆ Git
    y / n · enter confirm
✓ Initialize a git repository? Yes

  ✓ Cargo.toml
  ✓ README.md
  ✓ CLAUDE.md
  ✓ AGENTS.md
  ✓ .gitignore
  ✓ .env
  ✓ .env.example
  ✓ bootstrap/ · 2 files
  ✓ app/ · 25 files
  ✓ config/ · 3 files
  ✓ routes/ · 3 files
  ✓ database/ · 13 files
  ✓ resources/ · 17 files
  ✓ public/ · 5 files
  ✓ storage/ · 4 files
  ✓ tests/ · 1 file
  ✓ Tailwind CSS v4.3.3 installed at /Users/you/Library/Application Support/smeltery/bin/tailwindcss-v4.3.3
  ✓ git repository
  ✓ migrate
  ✓ db:seed

  Created my-app                                                      
                                                                    
kind      web                                                       
database  sqlite                                                    
frontend  Mold + Sparks                                             
tailwind  installed                                                 
alpine    no                                                        
smelt     watchfire,temper                                          
bellows   none                                                      
migrate   done                                                      
seed      done                                                      
git       initialized                                               
                                                                    
Same app without questions:                                         
  smeltery new my-app --kind web --db sqlite --frontend mold \      
    --tailwind --no-alpine --smelt watchfire,temper --bellows none \
    --migrate --seed --git                                          
                                                                    
Next steps:                                                         
  › cd my-app && smeltery serve                                     

   DONE  my-app is ready
$ 

Click an answer to change it.

smeltery new my-app --kind web --db sqlite --frontend mold --tailwind --no-alpine --smelt watchfire,temper --bellows none --migrate --seed --git
my-app/
  • app/
    • controllers/ models/ middleware/ providers/ services/ commands/ jobs/ agents/ mail/ sparks/ helpers/ actions/
  • bootstrap/
    • app.rswires the app: config, routes, middleware (the library root)
    • main.rsthe binary: hands the command line to smeltery::run
  • config/typed config structs read from .env
  • routes/web.rs (browser routes), api.rs (under /api)
  • database/migrations/ seeders/ factories/ database.sqlite (SQLite apps)
  • resources/views/ (pages, layouts/, components/, sparks/) css/
  • public/served as-is (assets/images, assets/css, assets/js)
  • storage/app/public app/private (the app's files) framework (Smeltery's) logs
  • tests/http.rs
  • .env .env.example .gitignore
  • README.md CLAUDE.md AGENTS.md
  • Cargo.toml

02 · The family

Raw ore in. A finished app out.

Smeltery melts Axum, Tokio, SeaORM, a template engine, auth, agents and a CLI into one tool. Follow the smith through the forge: every station is one part of the family.

Station 1 · smelt

Smeltery

One CLI creates the app and generates every piece of it.

cargo install smeltery and smeltery new my-app give you a complete, working application: routing, models and migrations, templates, live components, sessions and auth, a cache, mail, and supervised agents.

  • make:model
  • make:controller
  • make:spark
  • make:agent
  • make:job
  • make:mail
  • make:migration
Station 2 · cast ingots

Ingot

Models, migrations, seeders and factories.

SQLite, PostgreSQL and MySQL, one API. Models are SeaORM entities with Smeltery's model methods on top; migrations use a Laravel-style schema builder.

database/migrations
async fn up(&self, schema: &Schema) -> Result<()> {
    schema
        .create("posts", |t| {
            t.id();
            t.foreign_id("user_id").constrained("users").cascade_on_delete();
            t.string("title");
            t.text("body").nullable();
            t.boolean("published").default(false);
            t.timestamps();
        })
        .await
}
Station 3 · stoke the fire

Bellows

Your app, ready for coding agents.

Every new app has CLAUDE.md and AGENTS.md; Bellows adds the app's own MCP server, skills and guidelines. Its tools:

  • route_list
  • models
  • db_schema
  • config_keys
  • last_errors
  • docs_search
  • run_generator
  • run_tests
  • agents_list
  • agent_control
Station 4 · pour the mould

Mold

Templates that are checked when you build.

*.mold.html files with an @-directive syntax. Debug builds re-read a template when it changes; release builds compile it, so a missing variable is a compile error naming the file and line.

resources/views/posts/index.mold.html
@extends("layouts/app")

@section("title", title)

@section("content")
<h1>{{ title }}</h1>
@for(post in posts)
  <x-card :title="post.title">
    <a href="{{ route("posts.show", { post: post.id }) }}">Read</a>
  </x-card>
@empty
  <p>No posts yet.</p>
@endfor
@endsection
Station 5 · strike

Sparks

Live components. No JavaScript to write.

A Spark is a Rust struct with actions and a Mold view. The page renders it on the server; clicks and input go to the server, which answers the new HTML.

resources/views/sparks/counter.mold.html
{{-- resources/views/sparks/counter.mold.html --}}
<div>
  <p>Count: {{ count }}</p>
  <input type="number" wire:model.live="step">
  <button wire:click="increment">+{{ step }}</button>
  <button wire:click="add(10)">+10</button>
  <span wire:loading>Saving…</span>
</div>
Station 6 · ring the anvil

Anvil

WebSockets and broadcasting, on the app's own port.

A WebSocket server inside the app that speaks the Pusher Channels protocol 7. Handlers, jobs and Watchfire agents send events; pusher-js and laravel-echo connect with a custom host, and Sparks listen without JavaScript.

routes/channels.rs
use smeltery::anvil::{ChannelCtx, Channels};
use smeltery::prelude::*;

/// `routes/channels.rs`: the public channels and who may join the private ones.
pub fn channels(c: &mut Channels) {
    c.public("news");
    c.public("scores.{game}");
    c.private("orders.{order}", |ctx: ChannelCtx| async move {
        let order: i64 = ctx.param("order")?;
        let Some(user_id) = ctx.user_id() else { return Ok(false) };
        // Look the order up and allow its owner only.
        let rows = ctx
            .db()?
            .query_with("SELECT user_id FROM orders WHERE id = ?", [order.into()])
            .await?;
        let owner: Option<i64> = rows.first().and_then(|row| row.try_get("", "user_id").ok());
        Ok(owner == Some(user_id))
    });
}

pub fn build(app: AppBuilder) -> AppBuilder {
    app.anvil(channels)
}
Station 7 · two metals, one app

Alloy

React or Vue, with Rust on the server.

The server side of the Inertia v3 protocol: a controller returns a page, Inertia's client renders it. smeltery new my-app --frontend react or vue; Node.js builds the assets, the server needs no Node.js. Mold + Sparks stays the default, zero-JavaScript starter kit.

app/controllers/dashboard.rs
use smeltery::alloy::{self, Page};

#[derive(serde::Serialize)]
pub struct Activity {
    pub accounts: u64,
}

pub async fn dashboard() -> Page {
    alloy::render("dashboard") // resources/js/pages/dashboard.tsx
        .with("greeting", "Welcome back")
        .optional("stats", || async { Ok(42) })
        .defer("activity", || async { Ok(Activity { accounts: 3 }) })
}
Station 8 · temper, then quench

Temper & Quench

Temper handles log-in out of the box. Quench tests it.

Temper is the authentication routes as a package: log-in, registration, password reset, e-mail verification and two-factor authentication, each switched on in one builder. Quench is the testing side: a test app with a migrated database, harnesses for agents and Sparks, fakes.

tests/http.rs
use smeltery::testing::TestApp;

async fn home() -> &'static str { "Hello" }

// In tests/http.rs, inside a #[test] function:
let app = TestApp::new(|app| app.routes(|r| { r.get("/", home); }));
let res = app.get("/");
assert_eq!(res.status(), 200);
assert_eq!(res.text(), "Hello");
Station 9 · stamp the mark

Hallmark

API tokens for every other client.

Mobile apps, desktop apps, command-line tools and other backends send Authorization: Bearer smt_…; each token carries abilities. The table stores only a hash of the token.

  • POST /api/tokens
  • DELETE /api/tokens/current
  • GET /api/user
  • auth:hallmark
Station 10 · keep the fire

Watchfire

The fire that burns all night.

Agents, jobs and the scheduler on one runtime: pollers, scrapers, bots and LLM agents that run for days, supervised, with a live dashboard.

03 · One framework

Web apps and agents.

The same app serves pages and runs long-lived work. serve runs the agents next to the HTTP server; work runs them alone.

app/controllers/posts.rs
use smeltery::prelude::*;

#[derive(Mold)]
#[mold("posts/index")]          // resources/views/posts/index.mold.html
pub struct PostsIndex {
    pub title: String,
    pub posts: Vec<Post>,       // fields implement serde::Serialize
}

async fn index() -> Result<PostsIndex> {
    Ok(PostsIndex { title: "Posts".into(), posts: load_posts().await? })
}
resources/views/posts/index.mold.html
@extends("layouts/app")

@section("title", title)

@section("content")
<h1>{{ title }}</h1>
@for(post in posts)
  <x-card :title="post.title">
    <a href="{{ route("posts.show", { post: post.id }) }}">Read</a>
  </x-card>
@empty
  <p>No posts yet.</p>
@endfor
@endsection

04 · Batteries included

Everything you need, in the box.

Smeltery has an answer for routing, data, templates, auth, agents and more, so you and your agents spend time on your app, not on wiring.

  • Mold templates and Sparks live components, no JavaScript to write
  • Watchfire agents, queued jobs and the scheduler on one runtime
  • Ingot models and migrations for SQLite, PostgreSQL and MySQL
  • Bellows: an MCP server, skills and guidelines for coding agents
  • Designed log-in, register and dashboard pages, light and dark, with Tailwind CSS built without Node
  • React and Vue starter kits through Alloy (Inertia v3), no Node on the server
  • Secure by default: CSRF, encrypted sessions, argon2id with log-in budgets, security headers, sandboxed uploads, signed Sparks state, a gated Watchfire dashboard
  • Log-in that returns users to the page they asked for, and opt-in email verification
  • API tokens (Hallmark): smt_… bearer tokens with abilities
  • One release binary, and a deployment guide for systemd with Caddy, nginx or Plesk
routes/web.rs
use smeltery::prelude::*;

async fn home() -> Html<&'static str> {
    Html("<h1>Welcome</h1>")
}

async fn show(Path(id): Path<u64>) -> Result<String> {
    if id == 0 {
        return Err(Error::not_found());
    }
    Ok(format!("post {id}"))
}

async fn index() -> &'static str { "all posts" }
async fn dashboard() -> &'static str { "admin" }

pub fn routes(r: &mut Router) {
    r.get("/", home).name("home");
    r.resource("/posts").index(index).show(show);
    r.group("/admin", |r| {
        r.get("/", dashboard).name("dashboard");
    })
    .name("admin.")
    .middleware("auth");
}

05 · Watchfire

Agents that run for days. Supervised.

Scrapers, pollers, bots, request loops, LLM agents, webhook consumers: long-lived work gets a real home, next to your jobs and the scheduler.

01
Supervision

Restart policies, exponential backoff with jitter, restart limits, heartbeats with stall detection, supervision trees.

02
Politeness

Per-host rate limits, pools and group limits, an HTTP client with timeouts and retries.

03
Durability

Checkpoints, run history, dead letters for jobs that keep failing.

04
Several processes, one picture

serve --no-agents next to one or more work processes: each agent runs in one process at a time, each scheduled tick runs once, and one dashboard controls them all.

05
Closed by default

Outside APP_ENV=local the dashboard is open only to signed-in users that the app's dashboard gate admits.

An illustration with the agents of the README sample and the headless demo (a poller and a deliberately flaky worker).

06 · Deployment

One binary. Your server.

The release binary has the routes, migrations, seeders, Mold views, the Sparks runtime and the Watchfire dashboard compiled in. The server needs no Rust, no Cargo, no resources/, no smeltery CLI and no OpenSSL.

deploy — bash
# on the build machine $ smeltery build # on the server, in /srv/myapp $ sudo -u myapp ./myapp migrate --force $ sudo systemctl daemon-reload $ sudo systemctl enable --now myapp $ curl -s http://127.0.0.1:8000/up OK

One process or two

One unit runs the web server and the agents together. Or serve --no-agents plus work as two units, so you can restart the web server without stopping long-running agents.

myapp-webserve --no-agents
myapp-workwork
one database · one dashboarda shared cache store with cross-process locks
systemd, locked down

Runs as an unprivileged user with a hardened unit (NoNewPrivileges, ProtectSystem=strict), starts on boot, restarts on crash, drains on SIGTERM.

HTTPS your way

Caddy or nginx with copy-paste configs in the guide, or Plesk with its nginx as the proxy.

Ready behind a proxy

GET /up for uptime monitors, TRUSTED_PROXIES for the real client IP, brotli and gzip compression.

07 · Secure by default

Hardened at the forge.

What the framework does out of the box, before you write a line.

Sessions and auth

  • CSRF checked on every state-changing method, tokens masked per response
  • Encrypted __Host- session cookies on HTTPS
  • A password change ends every session
  • argon2id behind a concurrency gate, log-in budgets

Smeltery

  • Security headers on every response
  • Timeouts and connection, body and request limits
  • Uploads stored by an allow-list and served sandboxed
  • Secrets kept out of logs; APP_DEBUG=false by default

Sparks

  • Signed state, bound to the session and the user
  • Only declared actions and fields are reachable
  • Signed, expiring stream and upload tokens
  • A runtime that never evaluates strings

Mold

  • HTML-escaped output by default
  • | json and | url filters for values in JavaScript and links
  • Template names cannot leave the views folder

Watchfire

  • A dashboard that stays closed until the app's gate admits a user
  • An API token derived from the app key
  • An HTTP client with a redirect policy, size caps and verified TLS

Alloy

  • Explicit props only
  • Page JSON escaped in one place
  • Local-only redirects, a masked XSRF cookie

Bellows

  • MCP process tools take strict allow-lists
  • Never a shell; no tool takes a file path
  • config_keys returns names, never values

Deployment guide

  • A hardened systemd unit: NoNewPrivileges, ProtectSystem=strict, PrivateTmp, ProtectHome
  • Owner-only file modes for .env and storage/

Every part of the framework went through a six-area security review before release, and the fixes were checked again.

Light the forge.

What will you build?