---
title: "Discussion on \"Scalable REST API Architecture with NestJS, Prisma, Swagger, & Docker: How To.\" | Hashnode"
description: "Discussion on \"Scalable REST API Architecture with NestJS, Prisma, Swagger, & Docker: How To.\". A guide to building a production-ready API with modular architecture, database integration using Prisma, automated API docs with Swagger & Docker."
url: "https://hashnode.com/posts/scalable-rest-api-using-nest/6821e2c72f2dc86f4d189add"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Scalable REST API Architecture with NestJS, Prisma, Swagger, & Docker: How To.](https://blog.abdulqudus.com/scalable-rest-api-using-nest?utm_source=hashnode&utm_medium=feed)

A guide to building a production-ready API with modular architecture, database integration using Prisma, automated API docs with Swagger & Docker.

May 12, 2025 · 13 min read · blog.abdulqudus.com  
Read the article

-   [#nestjs](https://hashnode.com/tag/nestjs)
-   [#apis](https://hashnode.com/tag/apis)
-   [#backend](https://hashnode.com/tag/backend)

## Written by

[Jide Abdul-Qudus](https://hashnode.com/@jideabdqudus)

@jideabdqudus · London, United Kingdom.

  
[View profile](https://hashnode.com/@jideabdqudus)

Software Engineer. Sharing my bits on Tech.

## Responses 1

Markdown supported · ⌘↵ to post

[Node Edge Ops](https://hashnode.com/@nodeedgeops)

[Nov 5](https://hashnode.com/posts/scalable-rest-api-using-nest/6821e2c72f2dc86f4d189add/comment/6aec030ec1fc7c4041c21db3)

In Compose, Nest is strongest when the API container never publishes its listen port on the host and a reverse proxy is the only public listener. Resolve the Nest service by Compose DNS name and internal port — not a host-mapped address — so a recreate cannot leave the edge chasing a stale published port. Forward Host plus X-Forwarded-For / X-Forwarded-Proto into Nest so absolute URLs, cookies, and Swagger “try it” calls stay on the public scheme. Keep Prisma’s database on the same user-defined network and leave the DB port unpublished; pin proxy\_http\_version 1.1 with Connection cleared for keepalive into the Node process.

Path joining and stale upstream DNS still cause most post-redeploy 502s: a trailing-slash mismatch between location and proxy\_pass doubles or strips a prefix, and a long-lived proxy worker can keep a dead task IP after recreate unless you use a variable-plus-resolver pattern or recreate the proxy on deploy. After compose up I hit the Nest service name from inside the proxy container first, then the same path through published 80/443, and compare status and timing. Expose a cheap readiness path that checks the Nest process (and optionally a Prisma ping) so orchestrators do not treat a hung event loop as healthy.
