Skip to content

Refresh: Backend with TypeScript, PostgreSQL & Prisma part 1 (Prisma ORM 7)#8000

Merged
nurul3101 merged 3 commits into
mainfrom
blog/refresh-backend-data-modeling-part-1
Jul 3, 2026
Merged

Refresh: Backend with TypeScript, PostgreSQL & Prisma part 1 (Prisma ORM 7)#8000
nurul3101 merged 3 commits into
mainfrom
blog/refresh-backend-data-modeling-part-1

Conversation

@vanrensbird

@vanrensbird vanrensbird commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

What

Refreshes the 2020 post Backend with TypeScript, PostgreSQL & Prisma: Data Modeling & CRUD for Prisma ORM 7. Second post in the blog-refresh series after #7977 (NestJS part 1).

Why

  • GSC impressions grew from 8,379 to 83,020 year over year at position 7.9 with only 71 clicks.
  • It is the Fix favicon and static assets #5 most requested blog page by AI crawlers (7,802 requests from ClaudeBot, GPTBot, PerplexityBot and 4 others in May and June 2026).
  • The live version teaches Prisma 2 era workflows (prisma-client-js into node_modules, migrate dev --preview-feature, pre-2021 avg: aggregate syntax), which agents are currently ingesting as fact.

Changes

  • Rewritten for Prisma ORM 7: rust-free prisma-client generator with explicit output, prisma.config.ts, @prisma/adapter-pg driver adapter, ESM-first setup, GA Migrate commands, current _avg/_max/_min/_count aggregate syntax, and a new groupBy section.
  • Prisma Postgres (npx create-db) is the primary database path; local Docker Postgres kept as an alternative. Setup is now self-contained instead of relying on the archived real-world-grading-app repo's part-1 branch.
  • Dropped the livestream framing and YouTube embed (the recording teaches the Prisma 2 workflow). Happy to reinstate if you prefer.
  • Closing section links Prisma Console, MCP server, Prisma Compute, and Prisma Next.
  • Frontmatter: original author (Daniel Norman) and publish date kept; updatedAt: 2026-07-03 drives the visible "Updated" line and JSON-LD dateModified. Meta description updated.

Testing

  • Every command and code block executed end-to-end today in a fresh project on Prisma ORM 7.8.0 (Node 20+, ESM) against a real Prisma Postgres database created with npx create-db: init, migrate dev, generate, db seed, all CRUD, both aggregates, and groupBy. All printed outputs in the article are real captured outputs and match the originals (e.g. test averages 725/925/930).
  • pnpm types:check passes; pnpm lint:links reports no issues for this file (26 pre-existing errors in unrelated posts).
  • All 19 internal/external links return 200.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Updated the blog tutorial to reflect Prisma ORM 7 and the Node.js ESM-first workflow.
    • Reworked setup, schema/modeling, migrations, client generation, seeding, and query examples to match current best practices.
    • Improved guidance on relations, including many-to-many modeling, and refreshed aggregation (avg/max/min/count + groupBy) examples.
    • Refreshed the article’s frontmatter and added a July 2026 “Update” callout, including revised next steps.

… Prisma ORM 7

Rewritten for the Prisma 7 workflow: rust-free prisma-client generator
with explicit output, prisma.config.ts, @prisma/adapter-pg driver
adapter, ESM-first setup, GA Migrate commands, current aggregate
syntax, and a new groupBy section. Prisma Postgres (npx create-db) is
the primary database path with local Docker as the alternative. Setup
is self-contained instead of relying on the real-world-grading-app
repo. Original author and publish date kept; updatedAt set to
2026-07-03.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vanrensbird vanrensbird requested a review from ankur-arch July 3, 2026 11:44
@vercel

vercel Bot commented Jul 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
blog Ready Ready Preview, Comment Jul 3, 2026 2:20pm
docs Ready Ready Preview, Comment Jul 3, 2026 2:20pm
eclipse Ready Ready Preview, Comment Jul 3, 2026 2:20pm
site Ready Ready Preview, Comment Jul 3, 2026 2:20pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ba26e658-8c63-4e1d-b2d7-4ea5c81b81e8

📥 Commits

Reviewing files that changed from the base of the PR and between 9e03007 and c56bb31.

📒 Files selected for processing (1)
  • apps/blog/content/blog/backend-prisma-typescript-orm-with-postgresql-data-modeling-tsjs1ps7kip1/index.mdx

Walkthrough

A Prisma-focused blog article’s MDX content and frontmatter were updated for Prisma ORM 7, including prisma.config.ts, the prisma-client generator, driver adapters, revised schema modeling, seeding, and aggregation examples. No exported/public entities changed.

Changes

Blog article update for Prisma ORM 7

Layer / File(s) Summary
Frontmatter and intro/setup rewrite
apps/blog/content/blog/.../index.mdx
Frontmatter metadata, a July 2026 update callout, prerequisites, and a Prisma Postgres npx create-db provisioning flow replace older setup instructions.
Schema modeling and relations narrative
apps/blog/content/blog/.../index.mdx
Schema/relation explanation sections are reworked, including explicit many-to-many via CourseEnrollment with UserRole, and relation field comment wording updates.
Migration and seed script rewrite
apps/blog/content/blog/.../index.mdx
prisma.config.ts seed registration, PrismaPg adapter-based PrismaClient instantiation, and nested-write seed examples for users, courses, enrollments, and looped test-result creation are updated.
Aggregation examples and closing content
apps/blog/content/blog/.../index.mdx
Aggregation query snippets and sample outputs move to the _avg/_max/_min/_count shape, a groupBy example is added, and closing next-steps prose covers Prisma Postgres, MCP server, and Compute.

Estimated code review effort: 2 (Simple) | ~15 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: a refresh of the backend Prisma/PostgreSQL TypeScript article for Prisma ORM 7.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@argos-ci

argos-ci Bot commented Jul 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ✅ No changes detected - Jul 3, 2026, 2:27 PM

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@apps/blog/content/blog/backend-prisma-typescript-orm-with-postgresql-data-modeling-tsjs1ps7kip1/index.mdx`:
- Around line 173-186: The Prisma config examples in the article use
process.env["DATABASE_URL"], but the generated prisma.config.ts output should
use env("DATABASE_URL") from prisma/config. Update both “generated file looks
like this” snippets in the blog content so the datasource.url field matches
Prisma ORM 7 CLI scaffolding and references the env helper consistently.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9ef2774b-be81-4ecf-9f26-f9b7723d7de0

📥 Commits

Reviewing files that changed from the base of the PR and between 8ba14fb and 9e03007.

📒 Files selected for processing (1)
  • apps/blog/content/blog/backend-prisma-typescript-orm-with-postgresql-data-modeling-tsjs1ps7kip1/index.mdx

nurul3101
nurul3101 previously approved these changes Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants