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
- Design a
schema.prismawith at least two related models (e.g.UserandPost, one-to-many). - Generate and run a migration with
npx prisma migrate devagainst a real PostgreSQL database. - Build a REST API in Express with full CRUD endpoints for at least one model, backed by Prisma Client.
- Implement one list endpoint that supports filtering, sorting, and pagination (
where,orderBy,skip/take). - Use
prisma.$transactionsomewhere the logic genuinely requires it (e.g. an operation that touches two related records atomically). - Write a
prisma/seed.tsscript 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! 🚀