Checklist Before Going Live

Go-live Checklist

AreaCheck
ConfigEnv validated at startup; no secrets in git; production uses a secret manager
DatabaseMigrations run in CI/CD (never synchronize); backups and restore tested; indexes on filter/sort columns
Securityhelmet, strict CORS, ValidationPipe whitelist, global JWT guard with @Public, ownership checks, rate limits on auth/OTP
ErrorsGlobal filter with a consistent format; 500 details hidden; errors logged with request id
PerformancePagination limits; Redis cache for hot reads; slow work in queues; N+1 queries checked
ObservabilityJSON logs, metrics (latency, error rate), alerts, uptime check on /health
TestingUnit tests for services/guards; e2e for auth, checkout and webhooks; run on every PR
DocsSwagger up to date; /docs protected or disabled in production
OperationsGraceful shutdown; health checks; zero-downtime deploy; rollback plan

Exercise

Exercise: ShopEase wants a "Notify me when back in stock" feature. List the NestJS pieces you would add (modules, endpoints, DTO, queue/cron, events).

Show answer
1. NotifyMeModule with a StockAlert table (userId, productId, createdAt, notifiedAt).
2. POST /api/v1/products/:id/notify-me  (customer, JwtAuthGuard) - body-less, idempotent
   DELETE /api/v1/products/:id/notify-me
3. ProductsService.update(): when stock goes from 0 to > 0, emit "product.restocked".
4. Listener adds a BullMQ job "restock-alerts" { productId }.
5. Worker loads pending alerts in batches (cursor pagination), sends push/email via
   NotificationsService, sets notifiedAt. Retries with exponential backoff.
6. Throttle the endpoint; unit-test the listener and worker; e2e-test the endpoints;
   document with @ApiTags('notify-me').