Rsodx
Add Rsodx and just code β¨
Rsodx is a lightweight, modular microservice framework for Ruby β designed to be fast, clean, and scalable. It provides a minimal architecture inspired by Rails, Sinatra, and Sequel, allowing you to focus on writing business logic without boilerplate.
π§ Philosophy
- No monoliths β build small services
- No magic β just plain Ruby
- No opinionated ORM or router β just simple tools
- Easily extendable and production-ready
ΠΠΎΡ Π°ΠΊΠΊΡΡΠ°ΡΠ½ΠΎ ΠΎΡΠΎΡΠΌΠ»Π΅Π½Π½ΡΠΉ ΡΠ°Π·Π΄Π΅Π» Installation
Π΄Π»Ρ ΡΠ²ΠΎΠ΅Π³ΠΎ README:
π¦ Installation
gem 'rsodx', github: 'eugene-ruby/rsodx'
You can install the gem directly from RubyGems.org after release:
With Bundler
bundle add rsodx
Without Bundler
gem install rsodx
β
rsodx
is designed for microservice architecture and includes routing, interactors, validation, and more β all in one lightweight package.
π¦ Project Structure
my_service/
βββ app/
β βββ api/
β βββ interactors/
β βββ models/
β βββ presenters/
β βββ serializers/
β βββ app.rb
β βββ router.rb
βββ config/
β βββ environment.rb
β βββ environments/
β βββ initializers/
βββ db/
β βββ migrations/
βββ bin/
β βββ console
βββ .env
βββ config.ru
βββ Gemfile
βββ Rakefile
π§° CLI Commands
Create new service
rsodx new my_service
Generate interactor
bin/rsodx generate interactor CreateUser
Creates app/interactors/create_user.rb
:
class CreateUser < Rsodx::Interactor
def call
# business logic here
end
end
Generate migration
bin/rsodx generate migration CreateUsers
Creates db/migrations/20240413_create_users.rb
:
Sequel.migration do
change do
# create_table :users do
# primary_key :id
# String :email
# DateTime :created_at
# end
end
end
π DSL Router Example
class Router < Rsodx::Router
namespace "/v1" do
post "/users", CreateUsers
end
end
βοΈ Rake Tasks
You can define your own DB.connect
logic and use built-in tasks:
# config/environment.rb
require "rsodx"
require "rsodx/db"
Rsodx::DB.connect
Run migration
rake db:migrate
Rollback migration
rake db:rollback
π» Interactive Console
bin/console
Inside IRB:
reload! # reload environment
CreateUser.call(params: {...})
π Roadmap
- Generator for models, serializers, presenters
- HTTP + JSON helpers
- Authentication middleware
- Better documentation site
𧬠License
MIT β created by Eugene Pervushin