Introduction

Nova is a decorator-based HTTP framework built on top of Fastify. It brings the best patterns from NestJS-style architecture to Fastify's raw speed — decorators, dependency injection, Zod validation, JWT auth, and automatic OpenAPI generation.

Why Nova?

If you love Fastify's performance but want a more structured, decorator-driven development experience, Nova is for you. It provides:

  • Decorator-based routing@Controller, @Get, @Post, @Put, @Patch, @Delet
  • Parameter decorators@Body, @Path, @Query, @File, @Request, @Reply, @CurrentUser
  • Dependency injection — Powered by Inversify with singleton, transient, and request scopes
  • Zod validation — Validate request bodies automatically with detailed error responses
  • JWT authentication@RequiresAuth and @Scopes decorators for access control
  • Security plugins — CORS, Helmet, Rate Limiting, CSRF, Compression via Security class
  • OpenAPI / Swagger — Auto-generate API documentation from your route metadata
  • Modular architecture — Organize your app with Module and nested sub-modules

Prerequisites

  • Node.js v18 or later
  • TypeScript 5.0+
  • Enable experimentalDecorators and emitDecoratorMetadata in your tsconfig.json

Installation

Terminal bash
# npm
npm install @abrahambass/nova

# Also install peer dependencies
npm install reflect-metadata zod
💡 Note

Make sure to import reflect-metadata at the very top of your entry file before any other imports.

TypeScript Configuration

Your tsconfig.json must include these compiler options:

tsconfig.json json
{
  "compilerOptions": {
    "target": "ES2022",
    "module": "commonjs",
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true
  }
}