Yama reads your config, generates type-safe routes, SDKs, and docs from a single IR, and keeps your handlers clean in TypeScript.
name: yamajs-demo
version: 0.1.0
schemas:
Todo:
type: object
properties:
id: { type: string, format: uuid }
title: { type: string }
completed: { type: boolean }
endpoints:
/todos:
get:
handler: handlers/listTodos
response:
type: array
items: { $ref: '#/schemas/Todo' }Stop maintaining boilerplate. Define your contract once and let Yama handle the rest.
Describe schemas, endpoints, and auth in one config. Yama turns it into validated routes, OpenAPI, and types.
A single intermediate representation powers client SDKs and docs, so every change ships consistently.
Handlers, plugins, JWT auth, migrations, and platform utilities are ready out of the box—no scaffolding drama.
Spin up dev servers, generate code, and migrate with one CLI. Everything stays in sync with your config.
Configuration defines the contract; TypeScript defines the behavior. The IR keeps SDKs, docs, and runtime aligned.
Capture your API surface in yama.yaml—schemas, entities, endpoints, plugins, and auth rules.
Write TypeScript handlers for the bits that need logic. Yama wires routing, validation, and types.
Generate SDKs and docs from the IR. Publish with confidence knowing contracts and code match.
import { HandlerContext } from '@betagors/yama-core';
export async function listTodos(ctx: HandlerContext) {
// Types are automatically inferred from schema
return ctx.db.select('todos')
.orderBy('createdAt', 'desc');
}
export async function createTodo(ctx: HandlerContext) {
// Body is validated before reaching handler
const todo = await ctx.db.insert('todos', ctx.body);
return { id: todo.id, ...ctx.body };
}Install the CLI, start the dev server, and open the docs to ship your first endpoint in minutes.