Skip to content
/ loco Public
forked from loco-rs/loco

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

Notifications You must be signed in to change notification settings

szabgab/loco

 
 

Repository files navigation

Loco

Project Status

  • STAGE 1: wide but shallow. Build a lot of components that make up a Rails-like framework, but only invest 60% in what they should be.
  • STAGE 2: operable demo. Build tooling - CLI, testing, and a demo app to showcase the framework
  • STAGE 3: tooling polish. Make day to day development operations easy, such as adding models, controllers, logic and tests (by code generation, macros, or helpers)
  • STAGE 4: indepth development. Make the 60% go to 80% of functionality where needed. Things like documentation (website?), missing API, supporting various deployment scenarios (on docker, other platforms), feature flags to cut down functionality
  • STAGE 5: go wide and expand. Focus on building various kinds of demo apps

Starting A New Project

To start a new project, you can use cargo-generate:

$ cargo install loco-cli
$ loco new

Getting Started

cd examples/demo
  1. create a database (through your postgres admin app):

loco_app

  1. migrate + generate entities:
$ cargo loco db status
$ cargo loco db migrate
$ cargo loco db entities
  1. run:

= terminal 1 =

$ cargo loco start

= terminal 2 =

$ cargo loco workers

Principles

Using the framework

  • Convention over configuration, though with a static language like Rust, this is highly diminished
  • Developer happiness (testing-first, CLI, tooling, beautiful code)
  • ActiveRecord is a good thing, fat models, slim controllers
  • Secure defaults
  • Optimize for the solo developer, the "one man framework"
  • Take advantage and preserve the Rust x-factor: performance, single-binary deploys, coding tools, community

Building the frameowrk

  • Use a library, and force it into shape (build some glue code / shims / wrappers), rather building it
  • If no choice, build it
  • Stick to Rails concepts, way of working, naming when can't decide (naming is hard)

Tech stack

  • axum for serving (controllers, router, requests)
  • seaorm for data layer (ORM, ActiveModel, migrations)
  • sidekiq-rs for background jobs
  • mailers, views, tasks - homebrewed

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%