Back-end Framework for Next.js App Router
One codebase β type-safe clients, OpenAPI, and AI tools
Documentation
Β Β
Quick Start
Β Β
Performance
Vovk.ts lets you build a structured back end on top of Next.js App Router Route Handlers. The unit is the procedure β a typed function paired with its schema. From that single source, Vovk derives the HTTP endpoint, the local .fn() call, the type-safe client, the OpenAPI document, and the AI tool with execute. No separate contract layer, no glue code.
Requirements: Node.js 22+ and Next.js 15+
npx vovk-cli@latest initSee: https://vovk.dev/quick-install
- π§© Stay native to Next.js (routing, streaming, proxy.js/auth patterns, deployment targets)
- ποΈ Structured API layer (Controller β Service β Repository) on top of Route Handlers
- π No separate contract layer β schema is derived from your controller code, not maintained by hand
- π€ Derive AI tools from your API surface (controllers and emitted RPC modules can be exposed as AI tools with parameters +
execute) - β‘ Back-end segmentation via segments: split your API into independently configured units that each compile into their own serverless function
- β
Typed request handling via
procedure(...)with{ params, query, body } - π Mix in third-party OpenAPI schemas as modules that share the same client/tooling pipeline (OpenAPI mixins)
A procedure is a typed, validated callable. Define inputs and output with procedure and call it directly on the server for SSR/PPR, server actions, or AI tool execution:
export default class UserController {
static getUser = procedure({
params: z.object({ id: z.string().uuid() }),
}).handle(async (req, { id }) => {
return UserService.getUserById(id);
});
}const user = await UserController.getUser.fn({ params: { id: '123' } });Services hold business logic separately. Plain classes, no decorators β types infer from the procedure:
import type { VovkParams } from 'vovk';
import type UserController from './user-controller';
export default class UserService {
static async getUserById(id: VovkParams<typeof UserController.getUser>['id']) {
// ...
}
}Add an HTTP decorator and the same procedure becomes a Next.js Route Handler. Codegen produces a fetch-powered client that mirrors the .fn() signature:
export default class UserController {
@get('{id}')
static getUser = procedure({
params: z.object({ id: z.string().uuid() }),
}).handle(async (req, { id }) => {
return UserService.getUserById(id);
});
}import { UserRPC, PetstoreAPI } from 'vovk-client';
const user = await UserRPC.getUser({ params: { id: '123' } });
const pet = await PetstoreAPI.getPetById({ params: { petId: 1 } });Annotate with @operation and procedures expose as LLM tools β pass controllers (in-process) or RPC modules (HTTP) to deriveTools:
const { tools } = deriveTools({ modules: { UserRPC, TaskController, PetstoreAPI } });
console.log(tools); // [{ name, description, parameters, execute }, ...]Function plus schema is a complete unit. From that pair Vovk derives:
- the Next.js Route Handler β add an HTTP decorator and the same procedure mounts as an endpoint
- the local
.fn()callable β same call shape as the RPC client; for SSR, server components, server actions, and AI tool execution - the typed RPC client module β
fetch-powered, generated from the emitted schema - the OpenAPI 3.x document β derived from the same schema, no parallel spec to maintain
- the LLM tool with
name,description,parameters, andexecuteβ viaderiveTools - a generated
README.mdβ client library documentation rendered from the procedure surface
One source, multiple destinations.
Official Claude Code plugin with 15 topic-based skills that teach the coding agent how to use Vovk.ts when you describe what you want to build. Skills load only when relevant β typing "scaffold a new tenant" pulls in the multitenant skill, "stream chat tokens" pulls in JSON Lines.
Install (inside Claude Code):
/plugin marketplace add finom/vovk
/plugin install vovk@vovk
/reload-plugins
Verify:
/plugin
The Installed tab should list vovk. Skills are namespaced β typing /vovk: (with the trailing colon) lists all 15.
Full plugin docs: https://vovk.dev/claude.
- Docs: https://vovk.dev
- Quick Start: https://vovk.dev/quick-install
- Manual install: https://vovk.dev/manual-install
- Claude Plugin: https://vovk.dev/claude
- OpenAPI Mixins: https://vovk.dev/mixins
- Performance: https://vovk.dev/performance
- βHello Worldβ example app: https://github.com/finom/vovk-hello-world
License: MIT (see LICENSE).