Node.js, Prisma & PostgreSQL

Lesson 12 of 12

Final Project: Build a Blog API with Prisma & PostgreSQL

Time to combine everything, schema design, migrations, relations, transactions, and Express, into one real project.

Requirements

  1. Design a schema.prisma with at least two related models (e.g. User and Post, one-to-many).
  2. Generate and run a migration with npx prisma migrate dev against a real PostgreSQL database.
  3. Build a REST API in Express with full CRUD endpoints for at least one model, backed by Prisma Client.
  4. Implement one list endpoint that supports filtering, sorting, and pagination (where, orderBy, skip/take).
  5. Use prisma.$transaction somewhere the logic genuinely requires it (e.g. an operation that touches two related records atomically).
  6. Write a prisma/seed.ts script that populates a few starter rows.

Stretch goals

  • Add a many-to-many relation (e.g. tags on posts) and an endpoint that filters by tag.
  • Return pagination metadata (total count, page number) alongside the results.
  • Write at least one automated test for an endpoint.

Submit your repository link below when you are done, an instructor will review it before you can mark this lesson complete. Good luck! 🚀

This lesson ends in a project. Build it on your own machine, there's nowhere to submit it here, but the brief above is everything you need.