RUBY API FRAMEWORK FOR NEXT.JS

Ship the product,
not the plumbing.

A fast, modular Ruby API framework for Next.js and TypeScript. Start with production-ready defaults and go straight to your business logic.

$ gem install gemstack
Ruby 3.3+Next.jsTypeScriptRackPumaMIT
gemstack — zshTerminal

$ gemstack new shop

Creating a new GemStack application...

✓Create project structure

✓Configure Ruby API

✓Configure Next.js

✓Configure TypeScript

✓Configure one origin

✓Install dependencies


$ cd shop

$ gemstack dev

⇒ Starting Ruby API on http://localhost:3000
⇒ Starting Next.js frontend...
⇒ Your app is running at http://localhost:3000

THE SHAPE OF A GEMSTACK APP

One origin.
Zero plumbing.

Serve your Next.js frontend and Ruby API from one origin. No separate API URL. No CORS configuration. No proxy gymnastics.

Browserlocalhost:3000
GemStackGateway
Next.jsFrontend ( / )
Ruby APIRack + Puma ( /api/* )
ONE ORIGIN · NO CORS · NO PROXY CONFIG

One origin

Serve your Next.js frontend and Ruby API through the same origin.

Conventions without lock-in

Use familiar Ruby ecosystem technologies while keeping your structure clean and replaceable.

Typed end-to-end

Generate API contracts, OpenAPI definitions and a typed TypeScript client.

01

LESS PLUMBING, MORE PRODUCT

The Ruby backend for
modern frontend apps.

TRADITIONAL SETUP

Browser → Next.js → Proxy → CORS → API URL → Ruby API

GEMSTACK

Browser → GemStack ↙ Next.js   ↘ Ruby API

SMALL CORE, BIG LEVERAGE

Not Rails.
Intentionally.

GemStack is API-first. It doesn't ship with server-rendered views, a default User model, authentication or CRUD scaffolding you didn't ask for.

Read the architecture
TRADITIONAL FULL-STACKGEMSTACK
Full-stack→API-first
Server-rendered views→Next.js frontend
Large default surface→Small modular core
Everything included→Add what you need
Convention-heavy→Convention without lock-in

DEVELOP FASTER

From idea to
vertical slice.

Generate the boring parts. Keep the important parts readable.

$ gemstack generate resource Product name:string price:decimal
generated files
app/
├── controllers/
│   └── products_controller.rb
├── models/
│   └── product.rb
├── serializers/
│   └── product_serializer.rb
├── routes.rb

db/migrate/
└── create_products.rb

frontend/lib/api/generated/
└── products.ts

READABLE BY DEFAULT

Code that gets
out of your way.

Small pieces. Familiar patterns. A generated app you can understand before lunch.

0102030405
class Product < ApplicationModel
  field :name, :string, null: false, size: 255
  field :price, :decimal, null: false
  field :description, :text
end

THE TOOLKIT

Everything you need.
Nothing you don't.

A small, capable foundation for building real products in the Ruby ecosystem.

Fast routing

O(1) static routing keeps the request path short and predictable.

Modular architecture

Plain Rack, Bundler and Next.js underneath. Swap what you need.

Database adapters

Use SQLite, PostgreSQL or MySQL without changing your application shape.

Background jobs

Keep asynchronous work close to your app, with a small, readable core.

API contracts

Declare input once and generate an OpenAPI contract with a typed client.

Production defaults

Security headers, request IDs, structured logs, body limits and JSON errors.

Built-in testing

Start with Minitest and rack-test so your API is easy to exercise.

Developer console

Inspect routes, run diagnostics and stay in the flow from one CLI.

FROM THE TERMINAL

One CLI. Your entire
workflow.

Create a Ruby + Next.js application

▋

YOUR ECOSYSTEM, CONNECTED

Ruby underneath.
TypeScript where it matters.

Ruby ecosystemRubyRackPumaBundlerRuby gems
GemStack
Frontend ecosystemNext.jsReactTypeScriptnpm

READY WHEN YOU ARE

Start building
in minutes.

$ gem install gemstack
$ gemstack new shop
$ cd shop
$ gemstack dev

Open http://localhost:3000

OPEN SOURCE, BUILT FOR DEVELOPERS

Build the backend
you actually want.

GemStack on GitHubMIT licensed · Issues · Contributions