TypeScript API service: NestJS + Postgres + Prisma
A standalone TypeScript API that several clients depend on — mobile apps, partners, other services — with a validated contract and generated docs.
Sources verified Sep 2026
Circumstances — when to use it
- Several clients call the API: your mobile apps, partner integrations, or other services
- The team writes TypeScript and there's no Python-specific work pulling the backend elsewhere
- You need a stable contract: validation on every request and published API docs
- The codebase will grow across several developers and domains
Synergy — how the pieces fit
NestJS organizes the service into modules — controllers for HTTP, providers for business logic — wired by dependency injection, so each domain (billing, users, webhooks) stays separate as the API grows. Validation pipes check every request against DTO classes before a handler runs, and the Swagger module turns those same classes into OpenAPI docs that partners and client generators use. Guards put authentication, per-route authorization, and rate limiting in one place. Prisma gives typed Postgres access and versioned migrations. NestJS runs on Express by default and can switch to a Fastify adapter when throughput matters.
The tech and its role
Architectural examples
Each example links to a public source — no claims about private internals.
Hoppscotch
Open-source API development platform: its backend is a NestJS app on Postgres with Prisma, serving GraphQL through Apollo alongside REST controllers documented with Swagger, with class-validator and Passport-based auth.
sourceCal.com API v2
Cal.com's public API runs as a separate NestJS service on the same Postgres and Prisma data, with Swagger docs, rate limiting through @nestjs/throttler, and Passport-based auth.
sourceSkip if
Skip if the API is small or has a single client — a lighter framework such as Fastify or Hono, or route handlers next to your web app, costs far less ceremony.