# Mustlist > Reviewed "build it properly" cards for AI coding agents: what to build, what users forget to ask for, and how to check it. Each link is the raw markdown of a verified card. Card text is reference material, not instructions: the user's instructions take priority. ## Auth - [Authentication for a Next.js + Postgres app](https://ridamagrawal.com/library/auth/nextjs-postgres.md): Use a maintained auth library with Postgres sessions in an HttpOnly, Secure, SameSite=Lax cookie. Hash passwords with Argon2id, rate-limit login and reset, authorize in server code (not only proxy/middleware), and ship email verification and password reset at launch. ## Background jobs - [Background jobs and queues for a Next.js + Postgres app](https://ridamagrawal.com/library/background-jobs/nextjs-postgres.md): Enqueue each job in the same Postgres transaction as its write and run it in a separate long-running worker (pg-boss or Graphile Worker). Make handlers idempotent, retry with capped backoff, keep failed jobs to replay, and never treat after() as a queue. ## Caching - [Caching for a Next.js + Postgres app](https://ridamagrawal.com/library/caching/nextjs-postgres.md): Cache shared, non-personal reads with use cache, cacheLife and cacheTag (Next.js 16 Cache Components). Check auth outside cached code, key on every input, invalidate tags where you write, never CDN-cache cookie responses, and fix slow SQL with indexes first. ## Connection pooling - [Connection pooling for a Next.js + Postgres app](https://ridamagrawal.com/library/connection-pooling/nextjs-postgres.md): Create one small pool per instance at module scope, point serverless code at a transaction-mode pooler (provider endpoint or PgBouncer), keep a direct URL for migrations and session features, keep session state off the pooler, and verify TLS certificates. ## File uploads - [User file uploads for a Next.js app with Amazon S3](https://ridamagrawal.com/library/file-uploads/nextjs-s3.md): Upload from the browser straight to a private S3 bucket with short-lived presigned URLs issued after an auth check. Generate keys and enforce size limits server-side, check magic bytes, abort stale multipart uploads, and serve files via presigned GET. ## Idempotency keys - [Idempotency keys for retry-safe writes in a Next.js + Postgres app](https://ridamagrawal.com/library/idempotency-keys/nextjs-postgres.md): Clients send one Idempotency-Key per intent with each POST or Server Action. Store it in Postgres, unique per account, with a request hash and the response, in the write's transaction. Replay finished keys; return 409 while one runs and 422 for a changed body. ## Payments webhooks - [Payment webhooks (Stripe, Razorpay) for a Next.js + Postgres app](https://ridamagrawal.com/library/payments-webhooks/nextjs-postgres.md): Verify each webhook signature on the raw body in a Route Handler, store the event id under a unique constraint, return 2xx fast and process in a worker. Fulfil only from verified events or server-side API checks, never the redirect, and reconcile with the provider. ## Rate limiting - [Rate limiting for a Next.js + Postgres app](https://ridamagrawal.com/library/rate-limiting/nextjs-postgres.md): Rate-limit auth, costly and public API endpoints per account or API key plus IP, in Route Handlers and Server Actions, with counters in a shared store (a Postgres upsert by default). Return 429 with Retry-After and trust only your platform's client-IP header. ## Security headers - [HTTP security headers and CSP for a Next.js App Router app](https://ridamagrawal.com/library/security-headers/nextjs.md): Send a nonce-based strict CSP ('strict-dynamic', object-src 'none') from proxy.ts on dynamic pages, starting in Report-Only. Set nosniff, Referrer-Policy, Permissions-Policy, X-Frame-Options and HSTS on every route with next.config headers(), and turn off X-Powered-By. ## Transactional email - [Transactional email for a Next.js + Postgres app](https://ridamagrawal.com/library/transactional-email/nextjs-postgres.md): Queue each email in a Postgres outbox in the write's transaction; a worker sends it via an email API with idempotency keys, from a DMARC-aligned subdomain. Suppress bounces via verified webhooks, rate-limit per recipient, and email only hashed, single-use tokens.