Roda Project

Getting Started

Gem Version CI License: MIT

roda-project is a command-line interface (CLI) tool designed to quickly scaffold scalable, modern Roda web applications and APIs.

✨ Benefits

  • Quick setup customized to your preferences (database, project type, test framework)
  • Built-in generators (bin/roda)
  • Essential development tasks via bin/roda (console, db, dev, assets)
  • Opinionated project structure: Highly maintainable and AI-friendly, yet easily customizable if needed
  • Built-in exception page
  • Modern front-end setup built-in for full-stack projects (powered by esbuild)
  • Code autoloading with Zeitwerk
  • Hot reloading
  • Pre-configured with i18n and other essential plugins
  • High performance: Get the job done without sacrificing performance. Even with multiple plugins, Roda can be 4x faster than Rails and 2x faster than Hanami, while consuming less memory than both.
  • Production-ready

Step 1: Installation

Install the roda-project gem globally via RubyGems:

$ gem install roda-project

Step 2: Scaffold Your Application

Run roda-project in your terminal to start the interactive application wizard:

$ roda-project

The CLI will prompt you to select your application options:

  1. Project Name: Enter the directory and app name (e.g. my_app).
  2. Architecture:
    • Fullstack: Includes views (ERB), asset pipeline (esbuild), and full web frontend setup.
    • API: Lightweight JSON-focused structure.
    • Minimal: Bare-bones single-file Roda application.
  3. Testing Framework: Choose between RSpec or Minitest.
  4. Database (Fullstack & API): Choose SQLite, PostgreSQL, or MySQL.
  5. Authentication (Fullstack & API with Database): Optionally include Rodauth authentication templates.

Step 3: Install Dependencies

Navigate into your generated project directory and bundle Ruby dependencies:

$ cd my_app && bundle install

If you created a Fullstack application, Node.js dependencies will also be installed when compiling assets:

$ bin/roda assets

Step 4: Setup the Database (If applicable)

If your project includes a database (PostgreSQL, MySQL, or SQLite):

  1. For PostgreSQL/MySQL, configure your database credentials in app/config/config.rb or set your DATABASE_URL.
  2. Create the database:
$ bin/roda db create
  1. Run initial Sequel schema migrations:
$ bin/roda db migrate

Step 5: Start Development Mode with bin/roda dev

To start local development with continuous watching and automatic reloads:

$ bin/roda dev
  • Executes Puma server and Guard to watch for file changes in routes, models, views, and assets.
  • Open your browser at http://localhost:4000.

For Fullstack apps, compile static frontend assets in watch mode concurrently:

$ bin/roda assets -w