0.0
No release in over 3 years
Nightingale brings the 'script-as-app' experience to Ruby. Write your UI in pure Ruby DSL, backed by Sinatra and React/Vite.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

~> 0.4, >= 0.4.4
~> 2.16, >= 2.16.0
~> 3.9, >= 3.9.0
~> 0.15, >= 0.15.0
~> 7.1, >= 7.1.0
~> 4.2, >= 4.2.1
 Project Readme

Nightingale

Nightingale is a Ruby framework for building interactive data and AI web applications with a simple, declarative DSL. It brings the "script-as-app" experience (like Streamlit) to the Ruby ecosystem.

Features

  • Ruby DSL: Write your UI in pure Ruby.
  • Reactive: Automatically updates the UI when you save your script.
  • Interactive: Built-in widgets like sliders, buttons, and dataframes.
  • Modern Frontend: React + Vite powered UI for a smooth experience.

Installation

gem install nightingale
# Or add to your Gemfile
gem 'nightingale'

Quick Start

  1. Create a new app:

    nightingale new myapp
    cd myapp
  2. Run the app:

    nightingale run app.rb
  3. Edit app.rb and watch the magic happen!

DSL Reference

title(text)

Displays a large title.

markdown(text)

Renders Markdown content.

button(label, key: nil)

Renders a button. Returns true if clicked.

if button "Click me"
  markdown "Clicked!"
end

slider(label, min:, max:, value: nil, step: 1, key: nil)

Renders a slider. Returns the current value.

val = slider "Select value", min: 0, max: 100
markdown "Value: #{val}"

dataframe(data)

Displays a table of data (array of hashes).

data = [{ name: "Alice", age: 30 }, { name: "Bob", age: 25 }]
dataframe data

session_state

A hash-like object to store state across reruns.

session_state[:count] ||= 0
session_state[:count] += 1 if button "Increment"

Architecture

See ARCHITECTURE.md for details on how Nightingale works.

Development

To set up the project for development (including installing Ruby gems and frontend dependencies):

bin/setup

To run the demo app during development:

bin/nightingale run examples/demo/app.rb

License

MIT