Skip to Content
Other scenarios 🚧

Other scenarios

AI website builders

The minimalism of Vovk.ts allows to easily create complex back-end logic using AI generators, involving minimal input context and making AI agents think less, minimizing hallucinations and improving reliability of the generated RESTful APIs.

Comparing to Vovk.ts with NestJS, the first one requires to use less imports, less decorators, doesn’t require to connect controller and service into a “module”, doesn’t use dependency injection (services are just namespaced functions with no decorators), supports in-line input/output models (so AI doesn’t need to create a “dto” classes in a separate file), supporting basically any modern validation library, etc.

With modern tooling such as Prisma ORM , even smaller models would be capable to understand the task and generate working and complex code.

Here are the features of Vovk.ts that make it suitable for AI-generated backends:

  • Almost zero boilerplate, just a config file.
  • Probably the most minimalistic syntax for defining API routes for a backend framework with OAS support.
  • Requires a single Next.js project, so AI wouldn’t struggle with a monorepo.
  • Clear syntax for RPC modules that can be used on front-end.
  • Clear type inference for input/output models.

Bonus points available out of the box:

  • Multitenancy support with Next.js Middleware.
  • OpenAPI documentation with code samples.
  • Function Calling framework that turns the controllers (for server-side tools) and RPC modules (for client-side tools) into powerful agents and MCP servers.
  • OpenAPI mixins that allow to integrate third-party APIs into your project and even use them in the AI agents.
  • Bundling and codegen features that allow to create and publish client libraries for your own APIs or for third-party APIs, creating alternative clients for APIs that offer OpenAPI 3+ specifications.

Using Next.js + Vovk.ts as a standalone RESTful API server

Next.js is known as a React framework, offering UI/UX related features such as server-side rendering, static site generation, partial pre-rendering, etc. Due to specifics and limitations of route.ts files it can’t be called a full-featured backend framework, providing extended but limited alternative to simple back-end libraries such as Express , Fastify , or Koa .

However, as NestJS is built in top of Express, Vovk.ts is built on top of Next.js API routes, turning it into a full-featured backend framework with Controller-Service-Repository architecture, OpenAPI documentation, but also code generation, RPC support, and more.

This allows to use Next.js + Vovk.ts as a standalone RESTful API server, without utilizing React-related features. Just set rootEntry to '' in the config file (by default it’s set to 'api') and create your API routes in the root of ./src/app folder.

Let’s say you have an Angular, Vue.js or other front-end project that requires a RESTful API server. You can use a monorepo with two projects, one for the front-end powered by Vite  and another for the back-end, where the back-end is a Next.js + Vovk.ts project that can emit RPC modules directly to the front-end project (setting outDir config option to ../front-end/node_modules/.vovk-client for composed client or ../front-end/src/client for segmented client).

Last updated on