Skip to Content
Back-end for Next.js (beta)

RESTful API Framework
withΒ RPCΒ 

import { , , } from 'vovk'; import { } from 'zod'; import from './UserService'; @('users') export default class { @('{id}') static = ({ : .({ : .() }), : .({ : .() }), : .({ : .(['push', 'sms']) }), async (, { }) { const = await .(); const
const notify: "push" | "sms"
notify
= ...('notify');
return .(, , ); }, }); }
import { } from 'vovk-client'; /** * Runs regular fetch under the hood, e.g.: * fetch('/api/users/.../?notify=push', { method: 'PUT', body }) * UserRPC.updateUser type is directly inferred * from UserController.updateUser */ const = await .({ : { : 'a3bb189e-8bf9-3888-9912-ace4e6543002', }, : { : 'push', }, : { : 'john.doe@example.com', }, // options defined in a custom fetcher : 'User updated successfully', : 'Failed to update user', });

Features

πŸ” Type Inference & RPC

Vovk.ts combines TypeScript inference with code generation to achieve contract-less RPC over RESTful API with type mapping between controllers and RPC modules.

🧩 Backend Architecture Layer

On the back-end it wraps Next.js Route Handlers to provide service-controller architecture layer, decorator-style syntax, request validation, additional type safety for NextRequest object, and OpenAPI spec generation.

πŸ€– Back-end that runs by AI

Controllers and generated RPC modules can be used as LLM function calling tools for AI SDK, MCP, or any other AI instruments. The first one for current context execution, the second one for calling back-end API methods via HTTP requests.

πŸ“¦ Publishable RPC Client

The RPC client can be bundled and published to NPM with ready-to-use package.json and README.md that describes all available methods as code examples.