Skip to content
Kitbay
Skill

backend-patterns

MITUpdated on Nov 9, 2026300,529GitHub stars

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

What the skill teaches

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.

Capabilities

  • 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