Pular para o conteúdo
Kitbay
Skill

backend-patterns

MITAtualizado em 17 de nov. de 2026305.644Estrelas no GitHub

A reference skill from the ECC collection with server-side patterns for Express apps, Next.js API routes and other Node.js backends.

O que a skill ensina

A reference skill from the ECC collection with server-side patterns for Express apps, Next.js API routes and other Node.js backends. It shows code for the repository, service and middleware layers, selecting only needed columns, avoiding repeated per-item queries, and wrapping several writes in one database function. Further sections cover a Redis cache layer and the cache-aside pattern, a central error handler, retries with exponential backoff, JWT checks and role-based permissions, a simple in-memory rate limiter and job queue, and structured JSON logging with request IDs. The examples use Supabase and Redis, and it reminds the reader to match the pattern to the size of the application.

O que faz

  • Structure backend code into repository, service and middleware layers
  • Add Redis caching and cache invalidation
  • Handle errors centrally and retry with backoff
  • Check JWTs and enforce role-based permissions