~/talk

Building a REST API with NestJS and Prisma

Talkat Prisma Day 2021 · 2021-06-29..06-30· [nodejs, databases]
links:none on file
slides:none on file

Step‑by‑step workshop shows how to wire Prisma (v2.26) into a NestJS app using an SQLite dev DB, generate Prisma schema and migrations, seed ~15–18 example products, and produce a working REST API with type‑safe Prisma Client CRUD endpoints exposed in Swagger. It adds request validation, response serialization (decimal → number), an application filter that maps Prisma unique‑constraint errors (P2002) to 409, and a cursor‑based pagination implementation that returns Relay‑style edges and pageInfo. It finishes with JWT login that issues access tokens for guarded endpoints.

AI-written summary · about

  1. 0:00Intro
  2. 9:14Setup
  3. 11:22Integrating Prisma
  4. 13:27Installing Prisma
  5. 14:55Migrations
  6. 17:32Seeding
  7. 20:25Prisma Studio
  8. 21:33Prisma Client
  9. 25:44Testing
  10. 29:33Creating REST endpoints
  11. 32:00Get Products endpoint
  12. 39:59Update Product endpoint
  13. 42:40Create new Product endpoint
  14. 45:32Creating a product entity
  15. 50:28Adding boilerplate
  16. 51:26Validate incoming requests
  17. 52:17Validation at the application level
  18. 56:27Transform rules
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.