Welcome to Loco

πŸš‚ Loco is Rust on Rails.

[![crate](https://img.shields.io/crates/v/loco-rs.svg)](https://crates.io/crates/loco-rs) [![docs](https://docs.rs/loco-rs/badge.svg)](https://docs.rs/loco-rs) [![Discord channel](https://img.shields.io/badge/discord-Join-us)](https://discord.gg/fTvyBzwKS8)
English Β· [δΈ­ζ–‡](./README-zh_CN.md) Β· [FranΓ§ais](./README.fr.md) Β· [Portuguese (Brazil)](./README-pt_BR.md) ・ [ζ—₯本θͺž](./README.ja.md) Β· [ν•œκ΅­μ–΄](./README.ko.md) Β· [Русский](./README.ru.md) ## What's Loco? `Loco` is strongly inspired by Rails. If you know Rails and Rust, you'll feel at home. If you only know Rails and new to Rust, you'll find Loco refreshing. We do not assume you know Rails. For a deeper dive into how Loco works, including detailed guides, examples, and API references, check out our [documentation website](https://loco.rs). ## Features of Loco: * `Convention Over Configuration:` Similar to Ruby on Rails, Loco emphasizes simplicity and productivity by reducing the need for boilerplate code. It uses sensible defaults, allowing developers to focus on writing business logic rather than spending time on configuration. * `Rapid Development:` Aim for high developer productivity, Loco’s design focuses on reducing boilerplate code and providing intuitive APIs, allowing developers to iterate quickly and build prototypes with minimal effort. * `ORM Integration:` Model your business with robust entities, eliminating the need to write SQL. Define relationships, validation, and custom logic directly on your entities for enhanced maintainability and scalability. * `Controllers`: Handle web requests parameters, body, validation, and render a response that is content-aware. We use Axum for the best performance, simplicity, and extensibility. Controllers also allow you to easily build middlewares, which can be used to add logic such as authentication, logging, or error handling before passing requests to the main controller actions. * `Views:` Loco can integrate with templating engines to generate dynamic HTML content from templates. * `Background Jobs:` Perform compute or I/O intensive jobs in the background with a Redis backed queue, or with threads. Implementing a worker is as simple as implementing a perform function for the Worker trait. * `Scheduler:` Simplifies the traditional, often cumbersome crontab system, making it easier and more elegant to schedule tasks or shell scripts. * `Mailers:` A mailer will deliver emails in the background using the existing loco background worker infrastructure. It will all be seamless for you. * `Storage:` In Loco Storage, we facilitate working with files through multiple operations. Storage can be in-memory, on disk, or use cloud services such as AWS S3, GCP, and Azure. * `Cache:` Loco provides an cache layer to improve application performance by storing frequently accessed data. So see more Loco features, check out our [documentation website](https://loco.rs/docs/getting-started/tour/). ## Getting Started ```sh cargo install loco cargo install sea-orm-cli # Only when DB is needed ``` Now you can create your new app (choose "`SaaS` app"). ```sh ❯ loco new βœ” ❯ App name? Β· myapp βœ” ❯ What would you like to build? Β· Saas App with client side rendering βœ” ❯ Select a DB Provider Β· Sqlite βœ” ❯ Select your background worker type Β· Async (in-process tokio async tasks) πŸš‚ Loco app generated successfully in: myapp/ - assets: You've selected `clientside` for your asset serving configuration. Next step, build your frontend: $ cd frontend/ $ npm install && npm run build ``` Now `cd` into your `myapp` and start your app: ```sh $ cargo loco start β–„ β–€ β–€ β–„ β–„ β–€ β–„ β–„ β–„β–€ β–„ β–€β–„β–„ β–„ β–€ β–€ β–€β–„β–€β–ˆβ–„ β–€β–ˆβ–„ β–„β–„β–„β–„β–„β–„β–„ β–„β–„β–„β–„β–„β–„β–„β–„β–„ β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„ β–„β–„β–„β–„β–„β–„β–„β–„β–„ β–€β–€β–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆ β–€β–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–€β–€β–€ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆ β–„β–ˆβ–„ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–„ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–„β–„β–„ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–€ β–€β–€β–€β–ˆβ–ˆβ–„ β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€ β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€ β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€ β–ˆβ–ˆβ–€ β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€ https://loco.rs listening on port 5150 ``` ## Powered by Loco + [SpectralOps](https://spectralops.io) - various services powered by Loco framework + [Nativish](https://nativi.sh) - app backend powered by Loco framework ## Contributors ✨ Thanks goes to these wonderful people: