Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

2,419 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

vovk
Back-end Framework for Next.js App Router
One codebase โ†’ type-safe clients, OpenAPI, and AI tools
Documentation ย ย  Quick Start ย ย  Performance


Vovk.ts CI MIT License Runtime NPM Version CLI NPM Version Docs Context Realtime Kanban Context

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+

Install to existing Next.js project

npx vovk-cli@latest init

See: https://vovk.dev/quick-install

Why youโ€™d use it

  • ๐Ÿงฉ 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)

What it looks like

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 }, ...]

What one procedure becomes

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, and execute โ€” via deriveTools
  • a generated README.md โ€” client library documentation rendered from the procedure surface

One source, multiple destinations.

Claude Plugin

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.

Links


License: MIT (see LICENSE).

About

๐Ÿบ Back-end Framework for Next.js App Router. One codebase โ†’ type-safe clients, OpenAPI, and AI tools

Topics

Resources

Stars

52 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages