OSS TanbouSign in with GitHub

Map HTTP methods and URL patterns directly to a compact Ruby/Rack application

About these scores

OSS scale score is an unbounded metric that log-compresses and weights Stars, Watchers, Forks, and Contributors. Discovery score is the current OSS scale score minus the score at discovery. Update pace is commits in the last 30 days, growth momentum is the OSS scale score difference within the recent observation window, and OSS health is a 0–100 rating based on available recency, Community Health, and release data.

Stars
12,454
Primary language
Ruby
License
MIT
Repository last updated
Jul 20, 2026
On this page

Overview

Sinatra is a lightweight DSL for quickly building web applications in Ruby. Routes, filters, helpers, templates, sessions, streaming, and middleware can be composed as needed, and an application can act as either a Rack endpoint or Rack middleware. Main declares version 4.2.1, and the Sinatra 4 line targets Rack 3.

Features and best fit

Based on official documentation; not hands-on tested · Content checked:

Key features

Map HTTP methods and URL patterns directly to Ruby route blocks

The get, post, put, patch, and delete DSLs define routes with named parameters, wildcards, route conditions, and direct control over response status, headers, and bodies.

Sources: [2]

Compose filters, helpers, templates, and Rack middleware into a small application

Sinatra can add before/after filters, helpers, templates such as ERB, sessions, streaming, static files, and Rack middleware as needed, while Sinatra::Base supports modular applications and reusable components.

Sources: [2]

Best fit

Fits small APIs, internal tools, webhooks, and focused Ruby services

It is useful when a backend should keep HTTP endpoints close to application logic without adopting a large full-stack convention set, or when a small endpoint must be inserted into an existing Rack stack.

Sources: [2]

Before adoption

Sinatra 4 targets Rack 3; treat the server, rackup, and security configuration as explicit dependencies

Main declares version 4.2.1, and the gemspec requires Ruby 2.7.8 or newer plus Rack 3.x. Sinatra 4 dropped Rack 2 support, server startup needs the separate rackup gem, and the README recommends Puma. Rack::Protection, session secrets, and host authorization still need to be configured for the application's threat model.

Sources: [3][4][2]

Official sources

  1. [1]sinatra/sinatra — GitHub repository(2026-10-06)
  2. [2]Sinatra — README(2026-10-06)
  3. [3]Sinatra — sinatra.gemspec(2026-10-06)
  4. [4]Sinatra — CHANGELOG(2026-10-06)
  5. [5]Sinatra — MIT License(2026-10-06)
Supplemental curator note

Sinatra is useful for APIs and webhooks that do not need a large full-stack framework and benefit from keeping HTTP routes close to application logic. Sinatra 4 requires Rack 3, so Rack 2 migrations should verify middleware compatibility and the rackup/server setup first.

Try it in 3 steps

  1. 1

    Get the source

    git clone --depth 1 https://github.com/sinatra/sinatra.git
  2. 2

    Enter the repository

    cd sinatra
  3. 3

    Check the official steps

    Continue with the commands in the README Installation, Quick Start, or Getting Started section.

    find . -maxdepth 1 -iname 'README*' -exec sed -n '1,220p' {} \; -quit
Check the official README

Growth

Growth trends · Last 30 days

12,454 Stars

Trend data is still being collected.

Development activity

Last 90 days · weekly

Commits (last 30 days)
0
Open PRs
21

Development activity is still being collected.

Built with

Categories and tags

GitHub data

GitHub dataView detailed GitHub data

GitHub Topics

  • ruby
  • rack
  • web-framework
  • sinatra
Stars
12,454
Forks
2,074
Watchers
357
Open issues
27
Contributors
361
Owner type
Organization
Primary language
Ruby
License
MIT
Repository last updated
Jul 20, 2026
Write a related article

Share a guide or use case for this OSS in Markdown. Articles are published after administrator approval.

Report incorrect information

Tell us if any listing information is incorrect or outdated.

After reading this page, do you know what to do next?