Coding
PromptBeginner5 minmarkdown
Markdown Converter
Agent skill for markdown-converter
7
Production-ready Fastify v5 monorepo with modular plugins for building type-safe, observable APIs.
Sign in to like and favorite skills
Production-ready Fastify v5 monorepo with modular plugins for building type-safe, observable APIs.
This repo uses a buildless development approach:
tsx during developmenttsdown for optimizationapps/ → Runnable applications packages/ → Shared libraries fastify/ → Fastify plugins (modular) tooling/ → Build configuration
Fastify packages follow a registration pattern that returns typed instances:
import { setupBaseApp } from "@repo/fastify-base"; const app = await setupBaseApp({ logger: { level: "info" }, swagger: { title: "My API" }, });
Plugins can be composed:
registerZod(registerSecurity(app))
foo.ts → foo.test.ts@repo/ prefix.ts extensions for relative importsany types - use unknown and narrownoUncheckedIndexedAccess: true - handle undefined array accessverbatimModuleSyntax: true - use import type for type-only importsexports in package.jsonpnpm install # Install dependencies pnpm dev # Run all apps in watch mode pnpm test # Run tests pnpm typecheck # Type check with tsgo (TypeScript Native) pnpm lint # Lint with oxlint and format with oxfmt pnpm build # Production build
LOG_LEVEL - Logger severity (default: info)REDIS_URL - Redis connection for distributed cachingPORT - Server port (default: 3000)DISABLE_DOCS - Disable Swagger docs endpointUse the generator:
pnpm generate:package
Or manually:
package.json with @repo/ scoped name@repo/typescript-config in tsconfig.json@repo/vitestpnpm --filter @repo/package-name testpnpm test -- --coverageBuild any app with:
docker build --build-arg TARGET_PACKAGE=example-api -t example-api:latest .