backend-patterns

Solid

Apply modern backend patterns — auth middleware, caching strategies, background queues, rate limiting, and serverless/edge function design — across stacks (examples use Next.js, Node, and Supabase; adapts to your detected ecosystem). Use when the user says "backend architecture", "queue jobs", "caching layer", "rate limiting", "server actions", "edge function", "microservices", "authentication pattern", "circuit breaker", "outbox pattern", "saga", "bulkhead", "hexagonal architecture", "API gateway", or "BFF" (see references/architecture-patterns.md for the distributed-systems patterns). Pairs with design-api, audit-security, backend-realtime, and audit-backend-architecture (the read-only gap report). Do NOT use for database schema design (audit-db-schema) or pure frontend work.

API & Backend 6 stars 0 forks Updated 3 days ago MIT

Install

View on GitHub

Quality Score: 81/100

Stars 20%
28
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Backend Patterns Skill Design scalable, maintainable backend architectures using modern patterns and best practices. > Code examples lean on **Next.js App Router + Supabase/Prisma**. The patterns are > stack-agnostic — adapt ORMs, client libraries, and deploy targets to your detected > ecosystem. ## CRITICAL: Check Existing First **Before implementing ANY backend pattern, verify:** 1. **Check existing architecture:** ```bash ls -la src/server/ src/api/ app/api/ supabase/functions/ 2>/dev/null cat package.json | grep -i "prisma\|drizzle\|supabase\|trpc" ``` 2. **Check existing patterns:** ```bash rg "createTRPCRouter|publicProcedure" --type ts -l rg "'use server'" --type ts -l ls -la supabase/migrations/*.sql 2>/dev/null | tail -5 ``` 3. **Check database setup:** ```bash cat prisma/schema.prisma 2>/dev/null | head -50 cat supabase/config.toml 2>/dev/null ``` **Why:** Backend changes have wide impact. Understand existing architecture first. ## Server Actions (Next.js 15+) ### Basic Pattern ```tsx // app/actions/users.ts 'use server' import { z } from 'zod' import { revalidatePath } from 'next/cache' import { auth } from '@/lib/auth' import { db } from '@/lib/db' const CreateUserSchema = z.object({ email: z.string().email(), name: z.string().min(1).max(100), }) type ActionResult<T> = | { success: true; data: T } | { success: false; error: string; fieldErrors?: Record<string, string[]> } export async function createUser( prevState: ActionResult<User> | null, ...

Details

Author
kensaurus
Repository
kensaurus/cursor-kenji
Created
5 months ago
Last Updated
3 days ago
Language
JavaScript
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category