A Rails 8.1 API-only CRUD starter in Ruby 3.4 that stores one resource, items, in PostgreSQL through Active Record, served by Puma. It is for Ruby developers who want rails new --api already turned into a working service, with validation, JSON errors, limit and offset paging, a database health check, an OpenAPI 3.1 document and tests.
by Light CloudCRUD APIs
config/database.yml builds the connection with ERB from DB_HOST (which may carry a port), DB_NAME, DB_USER, DB_PASSWORD and DB_SSLMODE rather than DATABASE_URL, with as many pooled connections as Puma threads and a 5 second connect timeout. The first change is usually renaming Item or giving it your own fields: generate a migration, update items_controller.rb and add the paths to public/openapi.json, since the OpenAPI test fails until the routes and the document match. Because the entrypoint migrates before Puma takes traffic, an unreachable database shows up at deploy time rather than on the first request. There is no authentication or rate limiting, so every endpoint is open to anyone with the URL until you add tokens. SECRET_KEY_BASE is random at each start because nothing in the API is signed; set one if you add cookies, signed ids or encryption.
Generate an API-only app with rails new --api --database=postgresql, add a migration and a model, and route index, show, create, update and destroy to a controller that renders JSON. This starter is that app, with validation, JSON errors, paging, a health check and tests already written.
config/database.yml builds the connection from DB_HOST, DB_NAME, DB_USER, DB_PASSWORD and DB_SSLMODE with ERB, the variables Light Cloud sets. DB_SSLMODE=require means TLS without checking the certificate.
Run bin/rails generate model for the table, add a controller modelled on items_controller.rb, add its routes in config/routes.rb and its paths to public/openapi.json; the OpenAPI test fails until the two match.
Press Deploy on this template: Light Cloud copies the repo into your GitHub account, builds the Dockerfile, creates a PostgreSQL database and sets DB_HOST, DB_NAME, DB_USER and DB_PASSWORD on the app. Databases need a paid plan.
Yes. Any Docker host that can reach PostgreSQL runs the image once the DB_* variables are set; without Docker, run bin/rails db:migrate and bin/rails server with RAILS_ENV=production.


Start a Rails 8 app with sign-up and password reset on PostgreSQL, with no Node.js build
Start a Laravel CRUD API on PostgreSQL with validation, JSON errors and PHPUnit set up
Start a small Ruby JSON API with Sinatra, without Rails or a database