Skip to content

Fastify

September 29, 2023
December 29, 2021

fast API server, JSON schema for validation (ajv)

Fastify, Fast and low overhead web framework, for Node.js
Living the type-safe, well-documented REST API dream with TypeScript + Fastify
Building a Fastify NodeJS server
Fastify Crash Course | Node.js Framework - YouTube
Getting Started With NodeJS Fastify and TypeScript + ESLint, Prettier, and Auto Format On Save - YouTube
Fastify vs Express Which is Better? | Fastify TypeScript Tutorial - YouTube with TypeBox

The Fastify Workshop - Slidev
nearform/the-fastify-workshop: A workshop about Fastify

Jay Wolfe
Rapid API Development with NodeJS, Fastify, Postgresql, and Swagger - YouTube
Twitter Bot With Fastify, AlpineJS, TailwindUI, and HandlebarsJS - YouTube

Learn Just Enough Fastify to be Productive - YouTube 29:46
Build a RESTful API with Fastify, Prisma & TypeScript - YouTube 2022-02, 1:21:34

Plugins
Decorators

Validation

Validation-and-Serialization
Fluent-Schema

Ecosystem

Ecosystem
Ecosystem

fastify/skeleton: Template repository to create standardized Fastify plugins.

gquittet/graceful-server: Tiny (~5k), KISS, dependency-free Node.JS library to make your API more graceful

Project

fastify/fastify-cli: Run a Fastify application with one command!

fastify generate app --lang=ts

To use nodemon + ts-node for dev, add
"start:dev": "nodemon --watch 'src/**/*.ts' --exec node --inspect -r ts-node/register src/server.ts"
see https://github.com/wolfejw86/blog-examples/blob/master/login-with-github-fastify/package.json

TypeScript
How to build blazing fast APIs with Fastify and TypeScript

Included in fastify-cli:

fastify/create-fastify: Rapidly generate a Fastify project hooks fastify-cli to npm init

gquittet/graceful-server: Tiny (~5k), KISS, dependency-free Node.JS library to make your API more graceful
fastify/avvio: Asynchronous bootstrapping of Node applications
fastify/fastify-env: Fastify plugin to check environment variables
fastify/fastify-helmet: Important security headers for Fastify
fastify/fastify-error
fastify/fastify-routes: Decorates fastify instance with a map of routes

Transport

fastify/fastify-websocket: basic websocket support for fastify

Request Parsing

fastify/fastify-multipart: Multipart support for Fastify
fastify/fastify-formbody: A Fastify plugin to parse x-www-form-urlencoded bodies
fastify/fastify-rate-limit: A low overhead rate limiter for your routes

fastify/fastify-cors: Fastify CORS

File Upload

fastify/fastify-multipart: Multipart support for Fastify stream mode

huangang/fastify-file-upload: Fastify plugin for uploading files

Response

fastify/fastify-static: Plugin for serving static file as fast as possible
fastify/fastify-caching: A Fastify plugin to facilitate working with cache headers
fastify/fastify-etag: Automatically generate etags for HTTP responses, for Fastify
fastify/fastify-compress: Fastify compression utils
fastify/point-of-view: Template rendering plugin for Fastify
fastify/fastify-response-validation: A simple plugin that enables response validation for Fastify.

Authentication

fastify/fastify-auth: Run multiple auth functions in Fastify decorate (named callback functions)
fastify/fastify-jwt: JWT utils for Fastify
fastify/fastify-bearer-auth: A Fastify plugin to require bearer Authorization headers

OpenAPI

fastify/fastify-swagger: Swagger documentation generator for Fastify
eropple/fastify-openapi3: Developer-friendly OpenAPI3 tooling for Fastify that's easy to use.
ShogunPanda/fastify-openapi-docs: A simple plugin for Fastify that generates OpenAPI spec automatically.

seriousme/fastify-openapi-glue: A plugin for Fastify to autogenerate a configuration based on a OpenApi(v2/v3) specification. gen route from OpenAPI schema

NestJS

NestJS - A progressive Node.js web framework opinionated TypeScript wrapper of Express/Fastify
Documentation | NestJS - A progressive Node.js framework
Performance (Fastify) | NestJS - A progressive Node.js framework

Nestjs🐺⚡ | The framework of Nodejs Series' Articles - DEV Community 2021-08
NestJs Course for Beginners - Create a REST API - YouTube 2022-02

Intro to Nest.js: The higher-order JavaScript and TypeScript server | InfoWorld

eropple/nestjs-openapi3: OpenAPI 3.x document generation and serving for NestJS.