Roda Project
Getting Started
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:
- Project Name: Enter the directory and app name (e.g.
my_app). - 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.
- Fullstack: Includes views (ERB), asset pipeline (
- Testing Framework: Choose between RSpec or Minitest.
- Database (Fullstack & API): Choose SQLite, PostgreSQL, or MySQL.
- 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):
- For PostgreSQL/MySQL, configure your database credentials in
app/config/config.rbor set yourDATABASE_URL. - Create the database:
$ bin/roda db create
- 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
Guardto 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