nodejs-backend-patterns

Implement Express and Fastify backend patterns with TypeScript and database integration.

2|Updated Apr 9, 2026
One-click install
npx skills add https://github.com/ylxai/hafiportrait-saas --skill nodejs-backend-patterns-ylxai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nodejs-backend-patterns
Source: https://github.com/ylxai/hafiportrait-saas/tree/main/.agents/skills/nodejs-backend-patterns
Command: npx skills add https://github.com/ylxai/hafiportrait-saas --skill nodejs-backend-patterns-ylxai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires express, fastify, typescript, jsonwebtoken, bcrypt, pg, mongoose, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill offers comprehensive guidance for building robust and scalable Node.js backend applications, simplifying the process and enhancing productivity.

Core Features & Use Cases

  • Framework Setup: Guidance for setting up Express and Fastify for creating APIs and backends.
  • Architectural Patterns: Implement layered, service-oriented, and dependency injection designs.
  • Middleware Patterns: Strategies for authentication, validation, rate limiting, and logging.
  • Database Integration: Integration patterns for SQL and NoSQL databases.
  • Authentication & Authorization: JWT-based authentication and authorization with token refresh.
  • Caching Strategies: Implementation of caching for API responses and data retrieval.
  • Best Practices: Recommendations on TypeScript, error handling, input validation, environment variables, logging, security, and performance.

Quick Start

Use the nodejs-backend-patterns skill to create a new Express server that serves a REST API with middleware for authentication and input validation.

Frequently Asked Questions about nodejs-backend-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure a scalable Node.js backend with Express or Fastify?

Implement layered, service-oriented, or dependency injection architectural patterns for Express or Fastify. This Skill guides setting up Node.js backends using these designs to ensure scalable and maintainable API structures.

What is the best way to implement JWT authentication and token refresh in a Node.js API?

Use jsonwebtoken for token generation and bcrypt for password hashing to implement JWT authentication. This Skill provides patterns for JWT-based authentication and authorization including token refresh strategies for Node.js APIs.

How do I integrate SQL and NoSQL databases into a Node.js backend?

Integrate SQL and NoSQL databases using pg for PostgreSQL and mongoose for MongoDB. This Skill supplies database integration patterns to connect data layers seamlessly within your Node.js backend architecture.

Does this Node.js backend guidance require TypeScript?

Yes, TypeScript is a required dependency. This Skill delivers Node.js backend best practices specifically for TypeScript, alongside Express, Fastify, and database drivers, to build type-safe applications.

What middleware patterns are recommended for Node.js API security and validation?

Recommended middleware patterns include strategies for authentication, input validation, rate limiting, and logging. This Skill helps you apply these middleware configurations to secure Express and Fastify API endpoints.

When should I use Express versus Fastify for my Node.js backend?

Choose Express for established ecosystems or Fastify for performance-focused architectures. This Skill implements common patterns and best practices for both frameworks, allowing developers to build scalable APIs regardless of the choice.