Skip to content

Introduction

Velox TS (pronounced Velox TypeScript) is a full-stack TypeScript framework that gives you end-to-end type safety — from database to frontend — without code generation. Define your API once as a procedure, and Velox TS infers types instantly, generates REST endpoints from naming conventions, and exposes tRPC for internal calls. All built on Fastify, Prisma, and Zod.

Velox TS is built on four core principles:

  1. Type Safety Without Code Generation - types flow through direct imports. No build-time code generation required.

  2. Hybrid API Architecture - A single procedure definition serves both tRPC (for type-safe internal calls) and REST (for external API consumers).

  3. Convention Over Configuration - Sensible defaults with escape hatches. Naming conventions automatically generate routes.

  4. Opinionated & Productive - Expressive syntax, batteries included, progressive disclosure of complexity.

PackageDescription
@veloxts/coreFastify wrapper, definePlugin() system, VeloxError hierarchy with fail() API
@veloxts/routerProcedure-based API — tRPC + auto-generated REST from naming conventions, OpenAPI/Swagger generation, resourceSchema() for role-based field projection
@veloxts/validationZod 4 integration — type inference, z.toJSONSchema() for OpenAPI, pagination schemas, query param helpers (queryInt(), queryBoolean(), queryEnum())
@veloxts/ormPrisma 7 wrapper — driver adapters, schema-driven migrations, type-safe queries
@veloxts/authJWT (access + refresh tokens), session auth (HMAC-signed, sliding expiration), guards (authenticated, hasRole(), hasPermission(), combinators), policies, CSRF, rate limiting with backoff, HIBP breach checking
@veloxts/clientType-safe frontend API client — types inferred directly from procedure definitions, zero codegen
@veloxts/cliDev server with HMR, code generators (velox make, velox sync), migrations, OpenAPI CLI, MCP server, introspection
@veloxts/webReact Server Components with Vinxi + React 19, file-based routing, validated() server actions with schema validation, useAction() / useFormAction() hooks
PackageDescription
@veloxts/cacheMulti-driver caching (memory LRU, Redis) — remember(), tag-based invalidation, distributed locks
@veloxts/queueBackground job processing (sync, BullMQ) — type-safe jobs with Zod schemas, retry with backoff
@veloxts/mailEmail sending (SMTP, Resend, Log driver) — React Email templates, bulk send
@veloxts/storageFile storage abstraction (local, S3/R2/MinIO) — signed URLs, streaming, MIME detection
@veloxts/schedulerCron task scheduling — fluent API, timezone support, overlap prevention
@veloxts/eventsReal-time broadcasting (WebSocket, SSE) — public/private/presence channels, Redis pub/sub
@veloxts/mcpModel Context Protocol server — AI tool integration for project introspection, code generation, and guidance
FeatureHow It Works
Procedure Definitionprocedure().input().query() fluent builder
Dual ProtocolSingle procedure serves both tRPC and REST
REST GenerationAutomatic from naming conventions — getUser becomes GET /users/:id
OpenAPI/SwaggerAuto-generated spec + CLI + Swagger UI plugin
Type-Safe ClientcreateClient<T>() — types inferred from procedures
Resource APIresourceSchema() with role-based field projection (public, authenticated, admin)
Rate LimitingBuilt-in per-route limiter
FeatureHow It Works
ORMPrisma 7 (Data Mapper pattern)
SchemaPrisma Schema Language (.prisma)
MigrationsSchema-driven via Prisma Migrate
Type SafetyFully auto-generated from schema
RelationshipsSchema-defined, queried via include/select
FeatureHow It Works
JWT AuthAccess + refresh tokens with token store
Session AuthHMAC-signed cookies, sliding expiration
Guardsauthenticated, hasRole(), hasPermission(), combinators (allOf, anyOf, not)
Tagged Resource Views.output(Schema.authenticated) — auto-projects resource fields by access level
PoliciesdefinePolicy() with fluent builder, can() / authorize()
CSRFcsrfManager() with timing-safe comparison
Password PolicypasswordPolicy() with HIBP breach checking
Auth AdaptersJWT (built-in), BetterAuth, Clerk, Auth0 — pluggable via createAuthAdapterPlugin()
FeatureHow It Works
Server RenderingReact Server Components (Vinxi + React 19)
SPAVite + TanStack Router
File-Based Routingapp/pages/ directory (RSC mode)
Server Actionsvalidated() wrapper with schema validation, rate limiting, CSRF
Action HooksuseAction(), useFormAction() for React
FeatureHow It Works
Dev Servervelox dev with HMR, timing metrics, debug mode
Schema Syncvelox sync — generate schemas + procedures for all Prisma models
Code Generatorsvelox make resource/namespace/procedure/schema
Migrationsvelox migrate — status, run, rollback, fresh, reset
OpenAPI CLIvelox openapi generate/serve
Introspectionvelox introspect — list procedures, routes
Scaffoldercreate-velox-app — 5 templates, 2 databases, 3 package managers
MCP Servervelox mcp start — AI-assisted development via Claude

Velox TS gives you a real architectural choice upfront. Both paths share the same backend foundation—procedures, validation, database patterns—but differ in how your web app is rendered and where it lives. One runs entirely in the browser, the other leverages React Server Components for server-side rendering. Pick the approach that fits your project:

A classic architecture with a Fastify backend and a separate React SPA frontend. The backend handles API logic, the frontend is a standard Vite-powered Single Page Application. Great for teams with separate frontend/backend concerns or when integrating with existing React apps.

Templates: default, --auth, --trpc

A unified architecture using Vinxi and React Server Components. Server actions bridge directly to your procedures, enabling seamless data fetching without client-side API calls. Ideal for solo developers or teams wanting server-side rendering and a tighter integration between UI and data.

Templates: --rsc, --rsc-auth

Both approaches share the same backend patterns (procedures, validation, database) - only the frontend architecture differs.

  • Full-stack TypeScript developers
  • Solo developers building complete applications
  • Teams requiring type-safety across the entire stack
  • Developers who appreciate elegant, expressive APIs