TypeScript Decorators
Clean, declarative API using decorators for routes, validation, and dependencies. New in v0.4.0: @Summary, @HttpCode, @Timeout, @RateLimit.
TypeScript Decorators
Clean, declarative API using decorators for routes, validation, and dependencies. New in v0.4.0: @Summary, @HttpCode, @Timeout, @RateLimit.
Automatic Validation
Built-in Zod validation with structured 422 responses including field, received, and expected details.
Dependency Injection
Powerful DI container with singleton, request, and transient scopes. First-class Drizzle ORM integration via @InjectDB.
OpenAPI Documentation
Automatic OpenAPI spec generation with auto-tagging, Bearer security scheme, and Swagger UI integration.
Multi-Runtime Support
Works on Bun, Node.js, Deno, and Cloudflare Workers. Express adapter included.
Fluent Testing
Built-in TestClient with chainable assertions: expectOk(), expectJson(), loginAs(), and more.
import { VeloceTS, Controller, Get, Post, Body, Param, HttpCode, Summary, Tags, InjectDB } from 'veloce-ts';import { z } from 'zod';
const ProductSchema = z.object({ name: z.string().min(2), price: z.number().positive(),});
@Controller('/products')class ProductController { @Get('/') @Summary('List all products') @Tags('Products') async list(@InjectDB() db: any) { return await db.select().from(productsTable); }
@Post('/') @HttpCode(201) @Summary('Create a product') async create( @Body(ProductSchema) product: z.infer<typeof ProductSchema>, @InjectDB() db: any ) { return await db.insert(productsTable).values(product).returning(); }}
const app = new VeloceTS({ title: 'Products API', version: '1.0.0', docs: true });registerDrizzle(app, db);app.include(ProductController);await app.compile();app.listen(3000);// → Swagger UI at http://localhost:3000/docs