Workloads

The endpoint, its validation, and its documentation come from one file.

A model with the useApi trait generates its own actions and routes, validated by the rules already declared on its attributes. What ships is a typed API, an OpenAPI spec that matches it, and a client that fails to compile when the contract changes.

What this always turns out to involve.

The work that arrives whether you planned for it or not.

Three copies of every field

The migration, the validator, and the response type usually live apart, and they disagree quietly.

Docs describe last quarter

A hand-maintained spec is fiction within a sprint of the code moving.

Auth per endpoint

Tokens, scopes, per-route rate limits, and CORS have to be right on every route, not most of them.

Versioning arrives late

The second consumer is when v1 has to keep working while v2 exists.

What is already in the box.

All of it in the same install, typed against the rest of your application.

Generated endpoints

useApi on a model produces index, store, show, update, and destroy actions plus their routes, each overridable in app/Actions/.

One validation source

Attribute rules validate the request, drive the factory, and describe the schema in the spec.

Route groups and middleware

Prefixes, named routes, model binding, middleware groups, and per-route rate limits live in routes/.

OpenAPI output

buddy generate:openapi emits the spec from the routes that exist, so the reference cannot drift from the app.

Token and session auth

API tokens with scopes, session cookies, and two-factor all come from the auth package.

Typed HTTP client

The fetch client is generated against the same types, so a renamed field is a compile error in the consumer.

The layers it leans on.

Every one of these ships in the same install. Follow one to see what it covers.

From the command line.

Buddy scaffolds, runs, and ships this the same way it does the rest of the app.

buddy make:action Project/IndexAction buddy generate:openapi buddy test --feature

Projects of this shape usually grow into one of these.