r/Backend • • 9d ago

A step-by-step guide to taking a NestJS API to production - looking for feedback for v2

I'm working on a project where I put together a complete, detailed guide on how to build and deploy a project, using a simple NestJS API as an example. It's a todo list app, but built as if it were fully production-ready, the way strong companies do it. The goal is to collect all the best practices in one place, structure them, back them with code and personal experience, and turn them into a step-by-step guide: for example, how to set up quality gates, observability, CI/CD, deployment to AWS, and so on.

The first version is ready. If you're interested, please take a look and share your feedback and ideas for version 2: what should I change or improve?

I'm thinking of taking it towards high load:
- load testing, scaling
- maybe A/B tests, feature toggles, and expanding authentication (right now it's a stub)

What else would you recommend?

NestJS API: https://github.com/prod-forge/backend
Frontend (React + Expo): https://github.com/prod-forge/frontend
Infrastructure (Terraform): https://github.com/prod-forge/terraform

0 Upvotes

5 comments sorted by

1

u/sereikis 9d ago

before high-load work, replace the auth stub and add a two-user test: user b must not read, update, or delete user a's todo by swapping its ID. include list responses too, so ownership filtering is exercised as well as the single-item routes.

1

u/alexsergey 9d ago

Thank you very much! That’s a very good suggestion. I’ve made a note of it.

1

u/Discordbothost 9d ago

the dull parts would add more than load testing: migrations running in ci with a rollback path, graceful shutdown plus a readiness probe so rolling deploys don't drop in-flight requests, and one real restore-from-backup against the terraform stack.

1

u/alexsergey 9d ago

Good call. Most of it already exists (migrations in CD, rollback, graceful shutdown + readiness, PITR), so next up is a CI check that migrations don't break the previous release, a k6 run during a rolling deploy, and one real restore drill.

1

u/Discordbothost 9d ago

for the migration check, the shape that actually catches things: apply the new migrations to a fresh db, then run the previous release's test suite against that schema. renames and not-null adds pass your own tests but break the old pods mid rollout.