Skip to content

nodejs-backend-patterns

Production-ready Node.js backend patterns with Express/Fastify, middleware, authentication, and database integration.

— (0 ratings) 51.4K downloads wshobson
$ npx skills add https://github.com/wshobson/agents --skill nodejs-backend-patterns

Skills can run code on your computer. Review the source before installing. This listing is community-made and isn't affiliated with Anthropic.

About this skill

Summary

Production-ready Node.js backend patterns with Express/Fastify, middleware, authentication, and database integration.

  • Covers layered architecture (controllers, services, repositories), dependency injection, and microservices design with TypeScript
  • Includes middleware patterns for authentication, validation, rate limiting, and request logging with practical examples
  • Provides custom error handling, global error handlers, and async error wrappers for robust error management
  • Supports PostgreSQL (connection pooling, transactions) and MongoDB (Mongoose) with caching strategies using Redis
  • Demonstrates JWT authentication, refresh tokens, API response formatting, and best practices for production deployments

Node.js Backend Patterns

Comprehensive guidance for building scalable, maintainable, and production-ready Node.js backend applications with modern frameworks, architectural patterns, and best practices.

When to Use This Skill

  • Building REST APIs or GraphQL servers
  • Creating microservices with Node.js
  • Implementing authentication and authorization
  • Designing scalable backend architectures
  • Setting up middleware and error handling
  • Integrating databases (SQL and NoSQL)
  • Building real-time applications with WebSockets
  • Implementing background job processing

Detailed patterns and worked examples

Detailed pattern documentation lives in references/details.md. Read that file when the navigation tier above is insufficient.

Best Practices

  1. Use TypeScript: Type safety prevents runtime errors
  2. Implement proper error handling: Use custom error classes
  3. Validate input: Use libraries like Zod or Joi
  4. Use environment variables: Never hardcode secrets
  5. Implement logging: Use structured logging (Pino, Winston)
  6. Add rate limiting: Prevent abuse
  7. Use HTTPS: Always in production
  8. Implement CORS properly: Don't use * in production
  9. Use dependency injection: Easier testing and maintenance
  10. Write tests: Unit, integration, and E2E tests
  11. Handle graceful shutdown: Clean up resources
  12. Use connection pooling: For databases
  13. Implement health checks: For monitoring
  14. Use compression: Reduce response size
  15. Monitor performance: Use APM tools

Testing Patterns

See javascript-testing-patterns skill for comprehensive testing guidance.


Installs: 51.4K | GitHub stars: 43.0K | First seen: Jan 20, 2026

Related skills

New

Backend & APIs

lark-openapi-explorer

Discover and call native Lark OpenAPI endpoints from official documentation when existing skills fall short.

New • 492.1K
New

Agent workflows

lark-skill-maker

Create reusable Lark API Skills by wrapping atomic operations or orchestrating multi-step workflows.

New • 491.7K
New

Backend & APIs

prisma-client-api

Complete Prisma Client API reference for model queries, CRUD operations, filtering, relations, and transactions.

New • 455.8K