moltn guide
moltn lets you build a web application whose server is written in Rust (axum) and whose interface uses Vue, React or Svelte, connected by Inertia: no JSON API to design, the server picks a page and hands it its data.
What moltn adds:
- Server-side rendering inside the binary. The first visit gets fully rendered HTML (SEO, instant display) without a Node server on the side: a JavaScript engine is embedded in the application.
- File-based routing.
web/src/pages/users/[id].vueanswers/users/42. A page's server logic is a Rust function annotated with#[page]. - End-to-end types. Rust structs become TypeScript types: renaming a field in Rust makes the frontend type check fail.
- One command for everything.
moltn new,moltn dev,moltn build.
In production, everything fits in one executable: server, pages, assets, server-side rendering. Node is only needed to develop and to build the frontend.
Contents
- Getting started: install, create a project, run it.
- Pages and loaders: file-based routing, server data, forms.
- Types and routes: typed props,
route(), shared props,moltn gen. - Server-side rendering: how it works, rules for page code, settings.
- Commands: CLI reference.
- Configuration: the optional
moltn.tomlfile. - Production: build and deploy the binary.
- With Loco: plug moltn into a Loco application.
- Troubleshooting: common error messages and fixes.
Status: moltn is in development (0.1) and not yet published on crates.io or npm. Projects created by
moltn newdepend on the moltn repository present on the machine.