Commit 3e37d88
Refresh: Building a REST API with NestJS and Prisma (Prisma 7 / NestJS 11) (#7977)
* Refresh: NestJS + Prisma REST API tutorial for Prisma 7 / NestJS 11
* Address CodeRabbit feedback; validate Prisma 7 tutorial end-to-end
Verified the whole tutorial against Prisma 7.8 / NestJS 11 with a real
Prisma Postgres database (npx create-db): scaffolded the app, ran
migrate dev + seed, and exercised all CRUD endpoints + Swagger.
Changes from that validation and the review:
- Add the missing `@prisma/client` install. The generated Client imports
`@prisma/client/runtime/client` at runtime; without it the app fails
with "Cannot find module '@prisma/client/runtime/client'". (Found by
running it; not flagged in review.)
- prisma.config.ts: match the actual `prisma init` output
(`process.env["DATABASE_URL"]` + generated header comment). The review
suggested the `env()` helper, but 7.8 scaffolds `process.env`.
- Make `migrate dev` work on the recommended path: lead Option A with
`npx create-db` (cloud Prisma Postgres, where migrate dev works), and
note that the local `npx prisma dev` server needs `db push` instead
(migrate dev fails P1017 there even with a shadow URL).
- Note that `@prisma/adapter-pg` pulls in `pg` + `@types/pg`, so no
separate `pg` install is needed (review suggested adding it; it ships
as a dependency in 7.8).
- Add a closing "What's next: Prisma Next" callout (the next major
version, Prisma 8) inviting readers to try it.
- Remove em/en dashes from prose per the docs writing style.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* blog: part 1 second pass: template + migrate dev correction
Local only, pending Martin's review; destined for PR #7977 branch.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Ankur Datta <64993082+ankur-arch@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 78ae076 commit 3e37d88
1 file changed
Lines changed: 284 additions & 263 deletions
0 commit comments