gitmyhub

loco

Rust ★ 9.0k updated 2d ago

🚂 🦀 The one-person framework for Rust for side-projects and startups

A Rust web framework inspired by Ruby on Rails that gives solo developers a batteries-included starting point with built-in database access, background jobs, email, file storage, and a project scaffolding command.

RustAxumsetup: moderatecomplexity 3/5

Loco is a web framework for the Rust programming language, designed for solo developers and small teams building side projects or startup products. The README describes it as "Rust on Rails", drawing a direct parallel to Ruby on Rails, which is a widely known web framework that became popular for letting developers build full web applications quickly with minimal setup.

The core idea is convention over configuration: instead of requiring developers to make hundreds of small decisions about how to structure their project, Loco provides sensible built-in defaults and a standard project layout. A developer can run a single command (loco new), answer a few prompts about what kind of app they want, and get a working project skeleton they can start building on immediately.

Loco bundles most of the pieces a typical web application needs. It handles incoming HTTP requests through controllers and uses a popular Rust library called Axum under the hood for that. It includes an ORM, which is a layer that lets you work with a database using regular code objects instead of writing raw SQL queries. Background jobs let you offload slow tasks (like sending emails or processing files) so they run outside the main request cycle. There is also a built-in scheduler for repeating tasks, a mailer for sending emails, a storage abstraction that covers local files and cloud services like AWS S3, and a caching layer.

Views can be built with templating engines to generate HTML, or the framework can serve a frontend built with a separate tool. The getting-started flow in the README shows a working server running in just a few commands, which reflects the project's focus on getting something running fast without fighting the framework.

Where it fits