Skip to content

TechGenius7777/loco

Β 
Β 

Repository files navigation

Current Crates.io Version Discord channel

Welcome to Loco!


loco.rs

Loco is "Rust on Rails".

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.

To work with Loco, you need to know Rust to a beginner-moderate level. There are no crazy lifetime twisters and most of the development will be linear: request handling, workers, tasks, etc.

Quick Start

$ cargo install loco-cli

Now you can create your new app (choose "Saas app").

$ loco new
❯ App name? [myapp]:
❯ Saas app (with DB and user auth)
  Stateless service (minimal, no db)
πŸš‚ Loco app generated successfully in:
myapp
To configure a database , please run a local postgres database with loco:loco and a db named [insert app]_development..

When generating a starter, the database name incorporates your application name and the environment. For instance, if you include myapp, the database name in the test.yamlconfiguration will be myapp_test, and in the development.yaml configuration, it will be myapp_development.

$ docker run -d -p 5432:5432 -e POSTGRES_USER=loco -e POSTGRES_DB=myapp_development -e POSTGRES_PASSWORD="loco" postgres:15.3-alpine

Now cd into your myapp and start your app:

$ cd myapp
$ cargo loco start
Finished dev [unoptimized + debuginfo] target(s) in 21.63s
    Running `target/debug/myapp start`

    :
    :
    :

controller/app_routes.rs:203: [Middleware] Adding log trace id

                      β–„     β–€
                                 β–€  β–„
                  β–„       β–€     β–„  β–„ β–„β–€
                                    β–„ β–€β–„β–„
                        β–„     β–€    β–€  β–€β–„β–€β–ˆβ–„
                                          β–€β–ˆβ–„
β–„β–„β–„β–„β–„β–„β–„  β–„β–„β–„β–„β–„β–„β–„β–„β–„   β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„ β–„β–„β–„β–„β–„β–„β–„β–„β–„ β–€β–€β–ˆ
 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ   β–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ   β–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ   β–ˆβ–ˆβ–ˆ β–€β–ˆ
 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ   β–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ   β–€β–€β–€ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ   β–ˆβ–ˆβ–ˆ β–„β–ˆβ–„
 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ   β–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ       β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ   β–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–„
 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ   β–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ   β–„β–„β–„ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ   β–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ
 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ   β–ˆβ–ˆβ–ˆ  β–ˆβ–ˆβ–ˆβ–ˆ   β–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ   β–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–€
   β–€β–€β–€β–ˆβ–ˆβ–„ β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€  β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€  β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€ β–ˆβ–ˆβ–€
       β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€

started on port 3000

Project Status

Loco is feature complete, but features are still being added rapidly.

What can you build?

  • Stateless APIs
  • Complete SaaS products with user authentication
  • Purpose-built services such as ML inference endpoints
  • Full stack projects with separate frontend project integrated with Loco
  • Hobby projects full-stack with backend and HTML frontend

What's being done now?

  • View issues for what we plan next and what we work on (you're welcome to submit PRs!)
  • View CHANGELOG for what we already added

About

πŸš‚ πŸ¦€ The one-person framework for Rust for side-projects and startups

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%