backend-patterns

Provide reusable Node.js/Express/Next.js backend patterns for API design and database optimization.

2|Updated Mar 3, 2026
One-click install
npx skills add https://github.com/MomoDaviluke/star-citizen-promotion --skill backend-patterns-momodaviluke
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: backend-patterns
Source: https://github.com/MomoDaviluke/star-citizen-promotion/tree/main/.agents/skills/ecc/backend-patterns
Command: npx skills add https://github.com/MomoDaviluke/star-citizen-promotion --skill backend-patterns-momodaviluke

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides reusable backend patterns and best practices to help engineers design scalable, maintainable APIs with Node.js, Express, and Next.js, addressing common architecture and performance challenges.

Core Features & Use Cases

  • RESTful and GraphQL API design patterns for clean resource routing.
  • Layered architecture with repository, service, and controller/middleware separation.
  • Database optimization techniques: query design, indexing, and connection pooling.
  • Caching strategies including Redis and HTTP cache headers.
  • Middleware and error handling patterns for robust APIs.
  • Authentication and RBAC patterns to secure endpoints.

Quick Start

Implement a RESTful endpoint using repository and service patterns for a sample resource.

Frequently Asked Questions about 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 layered architecture?

Layered architecture for Node.js separates concerns using repository, service, and controller patterns. This structure isolates database queries, business logic, and API routing to improve maintainability and scalability in Express or Next.js applications.

What is the best way to design RESTful and GraphQL API endpoints in Express?

RESTful and GraphQL API design patterns provide clean resource routing and structured query schemas for Express. Applying these patterns ensures consistent endpoint behavior, predictable data fetching, and clear separation between resource definitions and middleware logic.

How do I implement caching strategies and database query optimization in Node.js?

Database optimization and caching strategies in Node.js involve query indexing, connection pooling, and Redis integration. Implementing these patterns alongside HTTP cache headers reduces database load and accelerates API response times for high-traffic endpoints.

Does this backend pattern collection include authentication and RBAC middleware for APIs?

Yes, the backend patterns include authentication and Role-Based Access Control (RBAC) middleware for securing APIs. These patterns provide structured mechanisms to validate user permissions and protect Express and GraphQL endpoints from unauthorized access.

What are the recommended error handling and middleware patterns for Node.js APIs?

Robust error handling and middleware patterns for Node.js APIs standardize exception catching and request processing. Implementing these patterns ensures consistent error responses, centralized logging, and reliable request validation across Express routes.