[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-108953":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":16,"stars30d":14,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":17,"rankGlobal":10,"rankLanguage":10,"license":18,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":19,"hasPages":19,"topics":21,"createdAt":10,"pushedAt":32,"updatedAt":33,"readmeContent":34,"aiSummary":35,"trendingCount":16,"starSnapshotCount":16,"syncStatus":13,"lastSyncTime":36,"discoverSource":37},108953,"rustoffrails","rust-off-rails\u002Frustoffrails","rust-off-rails","The opinionated web stack for the AI era: Rails' conventions, without Rails. Markdown conventions, a tested app template and checks that tell coding agents how to build a full-stack Rust web app.","https:\u002F\u002Frustoffrails.org",null,"Rust",53,2,1,8,0,41.53,"Apache License 2.0",false,"main",[22,23,24,25,26,27,28,29,30,31],"ai-agents","axum","claude-code","framework","htmx","phoenix","rails","rust","seaorm","web-framework","2026-11-23 16:30:03","2026-11-07 19:12:37","\u003Cp align=\"center\">\u003Cpicture>\u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"brand\u002Flockup-on-dark.svg\">\u003Cimg src=\"brand\u002Flockup-on-light.svg\" alt=\"Rust off Rails\" height=\"72\">\u003C\u002Fpicture>\u003C\u002Fp>\n\n# Rust off Rails\n\n> The opinionated web stack for the AI era.\n\n**Rust off Rails** is a web framework for AI coding agents. It ships no library you depend on: it's a set of Markdown files that tell agents how to build a full-stack Rust web app (one blessed stack, one directory layout, one way to do each thing), plus the **app template** those files describe, as real, tested files the agent copies instead of retyping ([template\u002F](template\u002FREADME.md)).\n\nThe convention lives in the prose; the code is copied from the template and its parts, then written by the agent for everything app-specific. Humans still write none of it.\n\n## Take only what you need\n\nNothing here is all-or-nothing. There is no framework code hidden under your app: what we give you is copied into it, so it's all in your repo and yours to change. (Apps still use ordinary crates like Axum and SeaORM.) Your agent gets good ideas and inspiration: the crates we'd recommend and why, and tested reference code for things we like, such as job processing, presence and authenticated webhooks, in [the samples repo](https:\u002F\u002Fgithub.com\u002Frust-off-rails\u002Fsamples), with screenshots. Use the whole template, one part, or only a convention. We're still experimenting and building real apps with it, and so far it has gone better than we expected.\n\n## Standing on giants\n\nWe take the best ideas of two great ecosystems and bring them together in one stack.\n\n- **From Ruby on Rails:**\n  - convention over configuration;\n  - generators (`new`, `scaffold`), Active Record-style models and migrations;\n  - Rails 8 authentication;\n  - the Solid trifecta: jobs, cache and pub\u002Fsub in the database, no Redis;\n  - Turbo 8-style page-refresh broadcasts;\n  - mailer previews, `bin\u002Frails` tasks, and Kamal-ready Docker with `\u002Fup`.\n- **From Elixir and Phoenix:**\n  - **Oban** persistent jobs and the **Oban Web** dashboard;\n  - **Swoosh**'s local mailbox;\n  - **phx.gen.auth** magic links and the \"check your mailbox\" hint;\n  - **LiveDashboard**-style dev tools;\n  - **Channels, Presence and PubSub**;\n  - multi-node clustering and \"let it crash\" supervision;\n  - Ecto's explicit data layer (no callbacks);\n  - the pending-migrations page.\n- **And also:** htmx, Inertia.js, Tailwind, shadcn-style owned components, and end-to-end types from Rust to TypeScript.\n\n[`RAILS_MAP.md`](RAILS_MAP.md) maps every Rails concept to its Off Rails equivalent, plus a [Borrowed from Phoenix \u002F Elixir](RAILS_MAP.md#borrowed-from-phoenix--elixir) section.\n\n## The deal\n\n| Rails gave you…                     | Rust off Rails gives your agent…                     |\n|------------------------------------|------------------------------------------------------|\n| A gem with 300k lines of Ruby      | ~50 Markdown files and an app template the agent copies and owns |\n| `rails generate scaffold`          | `generators\u002Fscaffold.md`: a recipe the agent runs    |\n| Convention over configuration      | Convention over *deliberation*: the agent never debates which crate to use |\n| \"Optimized for programmer happiness\" | Optimized for agent correctness: compiler-checked everything |\n| Magic                              | No magic. Explicit code is cheap when you don't type it. |\n\n## Rules of the framework\n\n1. **All code is written by AI. No exceptions.** Humans write intent: specs in Markdown, interview answers and feedback. Agents write every line of Rust, SQL, HTML, CSS, TypeScript, config and scripts. If a human edits code anyway, the agent treats the edit as a spec change, records it, and owns that code from then on.\n2. **Strong opinions, aimed at agents.** Every decision an agent would otherwise improvise (crate choice, file location, naming, error handling, testing) is already made in these docs.\n3. **Everything Rails has, mapped.** Active Record, Action Controller, Action View, Active Job, Action Mailer, Action Cable, Active Storage, Solid Cache\u002FQueue\u002FCable, generators, `bin\u002Frails`, credentials, Kamal. See [`RAILS_MAP.md`](RAILS_MAP.md).\n\n## Using it\n\n### Install (one line)\n\n```sh\ncurl -fsSL https:\u002F\u002Frustoffrails.org\u002Finstall.sh | sh\n```\n\nIt checks for Rust (and offers rustup), installs the cargo tools the framework uses as prebuilt binaries, downloads and **SHA-256-verifies** the framework into `~\u002F.offrails\u002F`, installs the Claude Code plugin if `claude` is on your PATH, and adds an `offrails` command. No sudo, no telemetry, and it's safe to re-run. Add `--dry-run` to see the plan first. [INSTALL.md](INSTALL.md) explains every step, with a manual equivalent.\n\n```sh\noffrails new bookshelf \"people track the books they've read\"   # starts Claude Code (or Codex) with \u002Foffrails:new\noffrails doctor                                                # prerequisites and versions\noffrails update                                                # latest release\n```\n\n### Or by hand: Claude Code plugin\n\n```\n\u002Fplugin marketplace add rust-off-rails\u002Frustoffrails      # or a local checkout: \u002Fplugin marketplace add \u002Fpath\u002Fto\u002Frustoffrails\n\u002Fplugin install offrails@offrails\n```\n\nThen, in an empty directory:\n\n```\n\u002Foffrails:new bookshelf: people track the books they've read and review them\n```\n\nThe agent interviews you first (accounts? who owns data? htmx or React? where will it run?), using recommended defaults so you can just say \"you decide\". It confirms a plan, then builds. The skills also trigger on plain requests (\"make me a new Rust web app…\").\n\n| Skill | Rails equivalent | What it does |\n|-------|------------------|--------------|\n| `\u002Foffrails:new [name] [pitch]` | `rails new` | Interview → plan → app skeleton → planned features, green |\n| `\u002Foffrails:feature [request]` | — | Spec first, then code. With no argument: build what changed in `product\u002F` |\n| `\u002Foffrails:scaffold Book title:string …` | `rails g scaffold` | Full resource in the app's frontend mode |\n| `\u002Foffrails:generate job\\|mailer\\|channel\\|authentication\\|model\\|migration\\|task …` | `rails g …` | Any other generator recipe |\n| `\u002Foffrails:check` | `bin\u002Frails test` + CI | Definition of Done: fmt, clippy, tests on SQLite **and** Postgres, frontend checks |\n| `\u002Foffrails:doctor [--fix]` | `rubocop` + review | Audits the app against every convention in these docs |\n| `\u002Foffrails:deploy [fly\\|kamal\\|railway\\|render]` | `kamal setup` | Deploy config, verified image; confirms before anything outward-facing |\n| `\u002Foffrails:upgrade` | `rails app:update` | Moves the app's vendored `.offrails\u002F` to the plugin's version and migrates conventions |\n\nThe plugin also installs hooks. They only act inside Off Rails apps (directories with `.offrails\u002F`):\n\n- **Edit guard:** blocks edits to `.offrails\u002F` (read-only) and `web\u002Fsrc\u002Ftypes\u002F` (generated by ts-rs).\n- **Convention check:** after each edit, flags raw SQL outside the kernel, banned crates or packages, and `\u002F:id` routes.\n- **Stop gate:** the agent can't end a turn while `cargo fmt --check` or `cargo check` fails.\n- **Session start:** orients the agent and notices when the app's framework version is behind the plugin's.\n\nEach app still vendors the docs into `.offrails\u002F`, pinned to a version, so the app keeps working with any agent, with or without the plugin.\n\n### With Codex, Cursor, or any agent that reads `AGENTS.md`\n\n```\nRead \u002Fpath\u002Fto\u002Frustoffrails\u002FAGENTS.md and make me a new app called \"bookshelf\".\n```\n\nGenerated apps carry `AGENTS.md` and `.offrails\u002F`, so later sessions need no setup.\n\n### Then\n\nDescribe features in plain language, or write them as specs in `product\u002F`:\n\n```\nScaffold Book with title:string, author:string, published_on:date, rating:integer.\nUsers must be logged in to create books. Send the owner an email when a book gets a review.\n```\n\n### The template and its parts\n\nA new app is a copy of [`template\u002Fapp\u002F`](template\u002FREADME.md): a complete, compiling app (htmx) with the kernel, security headers, CSRF, sessions, Host allowlist, rate limiting, log redaction, SQLite and Postgres, `\u002Fdev` tools, Tailwind, CI, Docker and the kernel tests, renamed and green in minutes instead of an hour of generated Markdown. On top of it go the **parts** the product needs: the mailer and dev mailbox, jobs and their dashboard, accounts (password, magic link, TOTP), realtime with presence, and a LiveDashboard-style dev dashboard. They're the tested samples from [rust-off-rails\u002Fsamples](https:\u002F\u002Fgithub.com\u002Frust-off-rails\u002Fsamples) (screenshots of every screen there). Your agent proposes the ones your app needs, you confirm, and later needs are one command: `cargo offrails add-part \u003Cname>`. Once copied, the app owns the code ([guides\u002Fsamples.md](guides\u002Fsamples.md)).\n\nThe generators (`offrails-gen`: `new`, `add-part`, `list-parts`, `generate`, `destroy`, `snippets`) are a small standard-library Rust tool, so they work the same on Linux, macOS and Windows. Features start from a **snippet** (small tested code to copy: a feed, slugs, Markdown, a pager, a theme toggle; [template\u002Fsnippets](template\u002Fsnippets\u002FREADME.md)) or a **generator** (`cargo offrails g resource posts title:string`), both optional, both the app's once written: small files per feature, one marked line per shared spot. Pages are built from a component kit (Askama macros, light and dark, branded from one `brand.toml`) in five layouts, and `cargo offrails prove` screenshots and checks every page and writes `docs\u002Fproof\u002FPROOF.md`, tying each acceptance criterion to its passing tests and pages.\n\n### Field tests: real apps, ported by agents\n\nWe test the framework by having agents port well-loved open-source apps to it. Each port puts the docs, the template and the parts up against a product with years of real-world design behind it, and every rough edge an agent hits goes back into the framework.\n\n- **fizzyer**: a Rust port of [Fizzy](https:\u002F\u002Fgithub.com\u002Fbasecamp\u002Ffizzy), 37signals' kanban-style tracker. Repository coming soon.\n- **A FreeScout port**: a Rust port of [FreeScout](https:\u002F\u002Fgithub.com\u002Ffreescout-help-desk\u002Ffreescout), the open-source help desk. In progress; repository coming soon.\n- **uptime-offrails**: a Rust port of [Uptime Kuma](https:\u002F\u002Fgithub.com\u002Flouislam\u002Fuptime-kuma), the self-hosted uptime monitor. Repository coming soon.\n\nThe ports are built by different agents on purpose: GPT-6 Luna (high), Claude Sonnet 5.5 (high and medium), Meta's Muse Wonder 1, and smaller open models such as GLM 5.3 Flash through opencode. The goal is a framework that makes smaller, cheaper agents productive too, not only the biggest ones.\n\nThey're for education and testing first. We also plan to run them ourselves, mostly to save server resources. Each will be open source under its original project's license, and contributions are welcome. They're independent ports, not affiliated with or endorsed by the original projects; credit for each product's design goes to its authors.\n\n## Repository layout\n\n```\nAGENTS.md          entry point for agents: read this first\ninterview.md       the questions agents ask before building\ndoctrine.md        the philosophy, rewritten for machines\nRAILS_MAP.md       every Rails concept and its Off Rails equivalent\nstack.md           the blessed crates (the \"Gemfile\")\nstructure.md       directory layout and naming conventions\ncli.md             the app binary and the bin\u002Frails equivalents\nworkflow.md        how an agent works: spec → code → green → done\nguides\u002F            one guide per framework component\ngenerators\u002F        recipes that replace `rails generate`\nblueprints\u002F        files copied into every new app (AGENTS.md, spec template…)\ntemplate\u002F          the app template (app\u002F: a complete, tested blank app) and its parts (parts\u002F: the samples), copied by offrails-gen\n.claude-plugin\u002F    Claude Code plugin + marketplace manifests\nskills\u002F            \u002Foffrails:* skills (thin entry points into the docs above)\nhooks\u002F             convention guards (no-ops outside Off Rails apps)\nevals\u002F             `claude plugin eval` cases: does the framework steer agents right?\ntools\u002F             offrails-gen\u002F (new, add-part, list-parts: Rust, any OS), offrails (the CLI), brand\u002F (favicons + social card), browser-smoke\u002F (kernel pages), release\u002F, ci\u002F\ninstall.sh         the one-line installer (served at rustoffrails.org\u002Finstall.sh); INSTALL.md explains it\nVERSION, CHANGELOG.md   framework version; apps record theirs in .offrails\u002FVERSION\n```\n\n## Developing the framework\n\n```sh\nclaude --plugin-dir .                       # load this checkout instead of the installed plugin\nclaude plugin validate . --strict           # manifests, skills, hooks\nclaude plugin eval . --runs 1               # run the eval cases\n```\n\nEvery doc change goes under `## Unreleased` in `CHANGELOG.md` the moment it's made, with **App migration** notes written for an agent.  Each release section keeps the shape described at the top of `CHANGELOG.md` (What's new, Breaking changes, Upgrading, Full list of changes): it becomes the GitHub Release notes. Apps detect drift by content fingerprint (`hooks\u002Ffingerprint.sh`), not version alone, so even unreleased edits show up as an upgrade.\n\nReleasing:\n1. Rename `Unreleased` to the new version.\n2. Bump `VERSION`, `.claude-plugin\u002Fplugin.json` and `tools\u002Foffrails-gen\u002FCargo.toml` (+ its `Cargo.lock`) together, and commit (`release.sh` refuses a mismatch: offrails-gen's version is in Cargo's fingerprint, so an app's cached `cargo offrails` binary is rebuilt for the new release).\n3. `tools\u002Frelease\u002Frelease.sh --dry-run` to check, then `tools\u002Frelease\u002Frelease.sh`. It builds a reproducible `rustoffrails.tar.gz` (the whole framework, skills and hooks included), `install.sh` and `checksums.txt`, tags `v\u003Cversion>`, and creates the GitHub release with `gh`. `install.sh` downloads `releases\u002Flatest\u002Fdownload\u002F…`, so a release is all it takes.\n4. Publish the release's `install.sh` at `https:\u002F\u002Frustoffrails.org\u002Finstall.sh` (the website serves it).\n5. `claude plugin tag --push` for the plugin marketplace.\n\nInstaller tests: `tools\u002Fci\u002Ftest-install.sh` (local shells + clean Linux containers; `--full` also runs the real rustup + cargo-binstall path).\n\nTemplate tests: `TEST_DATABASE_URL=postgres:\u002F\u002F… tools\u002Fci\u002Ftest-template.sh` (generates the bare app, every part, parts added one by one, every generator and every snippet; the Definition of Done on SQLite and Postgres and the memory budget). Parts come from the samples repo: `tools\u002Fsync-parts.sh \u003Csamples checkout> \u003Cref>`, never edited here.\n\nInstalled plugins update only when the version changes.\n\n## The stack in one breath\n\nAxum on hyper (the binary *is* the web server: HTTP\u002F1.1 + HTTP\u002F2, no app server or nginx needed) · Tokio · SeaORM (**SQLite locally, Postgres in production, same code**) · Tailwind · a frontend mode chosen at birth:\n\n- **`htmx`** (default): Askama (compile-time checked templates) + htmx. No Node. Optional React or Svelte islands.\n- **`inertia`**: React or **Svelte** pages with Rails-style server routing, via a generated Inertia adapter. The default when you want a JS UI.\n- **`spa`**: a Vite SPA (React Router or SvelteKit in SPA mode) + a JSON API.\n- **`api`**: no UI, for mobile backends and public APIs (in progress).\n\n`UI_LIBRARY: react | svelte` picks the JS library. Props and API types are generated from Rust by `ts-rs`, so the type chain runs from the database to the browser.\n\nPlus a database-backed job queue, cache and pub\u002Fsub (the \"Solid trifecta\") · lettre · object_store · tracing · one binary, one Docker image.\n\nYes, the acronym is still RoR. That's on purpose, and it's a thank-you.\n\n## License\n\nLicensed under either of [Apache License, Version 2.0](LICENSE-APACHE) or [MIT license](LICENSE-MIT), at your option.\n\nUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.\n\nSecurity issues: see [SECURITY.md](SECURITY.md). Contributing: see [CONTRIBUTING.md](CONTRIBUTING.md).\n","Rust off Rails 是一个面向 AI 编程代理的约定式全栈 Rust Web 开发模板与规范体系。它不提供运行时框架代码，而是通过结构化 Markdown 文档定义标准目录布局、组件接口、数据库迁移、认证、后台任务、实时通信等实践，并配套经测试的 Axum + SeaORM + htmx 应用模板供 AI 代理直接复用和扩展。其核心特点是将 Rails 的约定优先思想与 Phoenix 的健壮性（如 Oban、Presence、多节点支持）融合，所有代码均以可读、可审、可修改的形式内嵌于项目中。适用于需要快速生成可维护、AI 友好、生产就绪的 Rust Web 应用的团队或自动化开发流程。","2026-11-24 04:35:25","CREATED_QUERY"]