Careeroza
Checklist Before Going Live
Go-live Checklist
| Area | Check |
|---|---|
| Config | Env validated at startup; no secrets in git; production uses a secret manager |
| Database | Migrations run in CI/CD (never synchronize); backups and restore tested; indexes on filter/sort columns |
| Security | helmet, strict CORS, ValidationPipe whitelist, global JWT guard with @Public, ownership checks, rate limits on auth/OTP |
| Errors | Global filter with a consistent format; 500 details hidden; errors logged with request id |
| Performance | Pagination limits; Redis cache for hot reads; slow work in queues; N+1 queries checked |
| Observability | JSON logs, metrics (latency, error rate), alerts, uptime check on /health |
| Testing | Unit tests for services/guards; e2e for auth, checkout and webhooks; run on every PR |
| Docs | Swagger up to date; /docs protected or disabled in production |
| Operations | Graceful 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').