Conventions with explicit consumer contracts
Ruby on Rails Stacks API
Rails can provide a cohesive foundation for a Ruby application and its API. Explore when an API-only configuration fits the product, which browser-related capabilities still need attention, and how to evaluate contracts, database changes, permissions, and operational workflows through the work your team expects to perform.
Decide whether the product is API-only
Identify the consumers of the service: browser pages rendered by the application, a separate web interface, mobile clients, or partner integrations. That choice affects the application's middleware and authentication needs. The words API-only describe a configuration decision, not a guarantee that every browser concern disappears from the product.
The Rails guide to API-only applications explains the configuration and the choice of middleware and controller modules. Review those choices against the actual client. If a browser uses sessions or another browser-specific mechanism, include the needed behavior deliberately and verify its security properties.
Keep conventions aligned with the contract
Framework conventions can reduce repeated setup, but the consumer contract needs explicit ownership. Specify the public representation of a resource, accepted changes, error responses, and pagination. Avoid exposing every model attribute because it is convenient to serialize. A future database refactor should not automatically become a breaking API change.
Place business rules where the team can inspect and reuse them across web requests, jobs, and administrative operations. Review who can read or modify each record, including requests that combine a valid identity with an unauthorized resource identifier. Tests should exercise the application's intended boundary rather than only whether a route returns a successful status.
Plan data and code changes together
Consider how a deployment changes stored data and the processes that use it. A release may involve an application server, queued workers, and a migration, each with its own timing. Design the transition so the system can tolerate the intended order and define a recovery path when part of the release fails.
Treat background jobs as observable application behavior. Keep enough context to identify the affected account, reason for the job, and result. Decide which failures deserve another attempt and which need a person to intervene. Avoid indefinite repetition when an operation can create duplicate external effects.
Evaluate the next likely change
Build a small service, then change a realistic requirement: add a role, alter a response field, or move a slow action into a worker. Assess how clearly the Ruby team can make and verify that change. Choose Rails when its conventions help the maintainers reason about the product's future, alongside its initial implementation.