typescript-fastify

Solid

Building REST APIs with Fastify in TypeScript. Use when creating routes, handling requests, implementing validation with TypeBox, structuring applications, or working with HTTP handlers and plugins.

API & Backend 38 stars 3 forks Updated 5 days ago MIT

Install

View on GitHub

Quality Score: 87/100

Stars 20%
53
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Fastify Fast, low-overhead web framework for Node.js with TypeBox schema validation. ## Additional References - [references/plugins.md](./references/plugins.md) - Plugin architecture and dependency injection - [references/typeid.md](./references/typeid.md) - Type-safe prefixed identifiers ## Setup ```bash npm i fastify @fastify/type-provider-typebox @sinclair/typebox ``` ```typescript import Fastify from 'fastify' import { TypeBoxTypeProvider } from '@fastify/type-provider-typebox' const app = Fastify({ logger: true }).withTypeProvider<TypeBoxTypeProvider>() ``` ## Schema Definition ```typescript import { Type, Static } from '@sinclair/typebox' // Request/response schemas with $id for OpenAPI export const UserSchema = Type.Object({ id: Type.String({ format: 'uuid' }), name: Type.String({ minLength: 1, maxLength: 100 }), email: Type.String({ format: 'email' }), createdAt: Type.String({ format: 'date-time' }), }, { $id: 'UserResponse' }) export type User = Static<typeof UserSchema> // Input schemas (omit generated fields) export const CreateUserSchema = Type.Object({ name: Type.String({ minLength: 1, maxLength: 100 }), email: Type.String({ format: 'email' }), }, { $id: 'CreateUserRequest' }) export type CreateUserInput = Static<typeof CreateUserSchema> ``` ## Route with Full Schema ```typescript const TAGS = ['Users'] app.post('/users', { schema: { operationId: 'createUser', tags: TAGS, summary: 'Create a new user', description: '...

Details

Author
martinffx
Repository
martinffx/atelier
Created
6 months ago
Last Updated
5 days ago
Language
TypeScript
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category