Skip to content

AdamMusa/ruflet

Repository files navigation

Ruflet

Ruflet is a Ruby port of Flet for building web, desktop, and mobile apps in Ruby.

Class-based apps are the recommended and documented standard:

  • class MyApp < Ruflet::App
  • implement def view(page)

Start Here

  1. Install mobile client app from releases:
  1. Install Ruflet CLI from RubyGems:
gem install ruflet_cli
  1. Create and run your first app:
ruflet new my_app
cd my_app
bundle install
ruflet run main.rb

CLI output after creation:

Ruflet app created: my_app
  1. Open Ruflet mobile client and connect:
  • Enter URL manually, or
  • Tap Scan QR and scan QR shown by ruflet run ...

Package Split

Ruflet is split into packages:

  • ruflet: core runtime (includes protocol + UI)
  • ruflet_server: WebSocket runtime (Ruflet.run backend)
  • ruflet_cli: CLI executable (ruflet)
  • ruflet_rails: Rails integration/protocol adapter

Monorepo folders:

  • packages/ruflet
  • packages/ruflet_server
  • packages/ruflet_cli
  • packages/ruflet_rails

New Project Behavior

ruflet new <appname> generates a Gemfile using RubyGems dependencies:

  • gem "ruflet", ">= 0.0.2"
  • gem "ruflet_server", ">= 0.0.2"

It does not add ruflet_cli to app dependencies.

That keeps CLI global/tooling-level and app deps runtime-focused.

App Style (Required in docs/examples)

Use class-based apps:

require "ruflet"

class MyApp < Ruflet::App
  def view(page)
    page.vertical_alignment = Ruflet::MainAxisAlignment::CENTER
    page.horizontal_alignment = Ruflet::CrossAxisAlignment::CENTER
    page.title = "Hello"
    page.add(text(value: "Hello Ruflet"))
  end
end

MyApp.new.run

Widget builders are global/free helpers (text, row, column, container, etc.). Use page only for runtime/page operations (add, update, go, show_dialog, pop_dialog).

CLI

ruflet new <appname>
ruflet run [scriptname|path] [--web|--mobile|--desktop]
ruflet build <apk|ios|aab|web|macos|windows|linux|zip>

By default ruflet build ... looks for Flutter client at ./ruflet_client. Set RUFLET_CLIENT_DIR to override.

Development (Monorepo)

cd /Users/macbookpro/Documents/Izeesoft/FlutterApp/ruflet
/opt/homebrew/opt/ruby/bin/bundle install

Documentation

About

Ruflet enables developers to build fully native mobile, desktop, and web applications in Ruby. No frontend experience required.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors