Loco + SeaORM + PostgreSQL (Rails-Style Rust SaaS)
Rails-style Rust SaaS rules for Loco: generators, SeaORM models and migrations, Tera views or htmx scaffolds, JWT auth, background workers and mailers.
- Formats
- 4 files
- AGENTS.md
- 45 lines
- CLAUDE.md
- 17 lines
- Languages
- Rust
- Updated
- Oct 2026
- Used by
- 4 projects
Writes .claude/skills/rust-loco-saas/SKILL.md
$ curl -s --create-dirs -o .claude/skills/rust-loco-saas/SKILL.md https://stackitfast.com/rules/rust-loco-saas/SKILL.mdRule files
Works with Claude Code · Cursor · Windsurf · AGY
Architecture notes
Architecture Overview
Rails conventions with a Rust compiler. Loco gives you cargo loco generate scaffold, SeaORM models and migrations, Tera or htmx views, JWT auth, background workers, mailers and tasks, all on top of Axum and Tokio. It is the shortest path from “I know Rails” to a working Rust SaaS.
Why it suits AI coding agents
- Generators remove the guesswork. The agent creates a resource the same way every time, and the generated request tests become its first safety net.
- Clear places for code. Entities are generated, behaviour lives on the model, handlers stay thin, slow work goes to workers; every rule in the AGENTS.md maps to a directory.
- The compiler still checks everything. SeaORM entities are typed, so a renamed column breaks the build after
cargo loco db entities.
Trade-offs
Loco’s community and plugin ecosystem are far smaller than Rails’, and you inherit its choices (SeaORM, Tera, its auth). For a server-rendered app where you pick each crate yourself, see Axum + htmx + Askama. Why Rails developers are looking at Rust right now: Building web apps in Rust in 2026.
Frequently asked questions
Is Loco the Rails of Rust?
It is the closest thing: Loco is explicitly inspired by Rails and ships generators, an ORM (SeaORM), migrations, controllers, views, mailers, background workers, tasks and deployment generators on top of Axum. It is a much younger project with a smaller community, so you will read framework source more often than you would with Rails.
Can I move a Rails app to Loco?
The concepts map closely (models, controllers, views, jobs, mailers, migrations), which makes Loco the gentlest landing for Rails developers. A full rewrite still carries the usual risk of losing undocumented behaviour, so start with a new service or a slow endpoint rather than the whole app.
Loco or plain Axum?
Use Loco when you want conventions and generators for a CRUD-heavy SaaS and are happy to follow its layout. Use plain Axum when you are building an API, a service with unusual structure, or want to choose every crate yourself; Loco is Axum underneath, so handlers and Tower middleware carry over.
Why does generator-first matter for AI agents?
Generators produce the same file layout, tests and wiring every time, so an agent spends its effort on business logic instead of re-deriving boilerplate, and reviewers see familiar diffs. The agent loop then compiles, lints and tests the generated code like any other change.
Used in production
Explore all stacksRustFS
1RustFS splits a MinIO-style object store into dozens of single-purpose Rust crates behind one binary, keeps extra protocols behind cargo features, and moves inter-node traffic to gRPC, so storage, healing and IAM evolve separately.
SeaweedFS
1Decoupling directory metadata from physical volume storage eliminates central metadata bottlenecks, enabling massive horizontal scaling for small and large files alike.
Axum
Axum skips a custom middleware system and treats every route and layer as a Tower service, so it inherits timeouts, tracing, compression and auth from tower-http and shares middleware with Hyper and tonic code.
Leptos
Leptos separates its reactive graph, renderer and server-function RPC into independent crates and keeps the core server-agnostic, so the same components run as SSR HTML or WebAssembly, and Axum or Actix Web plug in through thin integration crates.