Skip to content

Document local Prisma env setup#14

Open
jstott8-collab wants to merge 1 commit into
danishfareed:mainfrom
jstott8-collab:patch-1
Open

Document local Prisma env setup#14
jstott8-collab wants to merge 1 commit into
danishfareed:mainfrom
jstott8-collab:patch-1

Conversation

@jstott8-collab

Copy link
Copy Markdown

Summary

Adds an .env.example file for local development.

Why

When running the app from source, Prisma requires DATABASE_URL. Without a .env file, local setup fails with:

Environment variable not found: DATABASE_URL

This example points Prisma at the local SQLite database used by the project.

Suggested README follow-up

The developer setup docs could also mention:

cp .env.example .env
npx prisma db push

before running:

npm run dev

@ZachEngstrom

ZachEngstrom commented Jun 23, 2026

Copy link
Copy Markdown

@jstott8-collab

Hey, thanks for opening this PR! Adding the .env.example file and documenting the database initialization step is a great catch. It addresses a real gap, but it also reveals that the local onboarding documentation glosses over a few cascading environment and dependency guardrails needed for a clean "greenfield" install.

Since your changes opened the door to fixing this workflow, I wanted to document the specific hurdles I ran into on a fresh clone and how they wrap into the larger setup puzzle.


The Broader "Local Setup" Hurdle

1. Missing Prisma Client Generation

  • Symptom: API endpoints (like /api/dashboard) throw Cannot find module .../@prisma/client/runtime/library.js.
  • Cause: The current instructions miss generating the local Prisma binaries inside node_modules before the Next.js dev server starts.
  • Fix: npx prisma generate must run alongside db push.

2. Unpinned Prisma Version Drift

  • Symptom: A fresh npm install pulls down Prisma 7, throwing validation error P1012 because the url = env("DATABASE_URL") property is deprecated in their new schema format.
  • Cause: The project architecture relies on Prisma 5, but the dependencies aren't strictly pinned in package.json.
  • Fix: Lock package definitions explicitly back to @5.22.0.

Making the Onboarding Puzzle Complete

Your PR is the perfect anchor for this. To turn this into a comprehensive fix for our local dev instructions, I'd love to see your README suggestions expanded with these additions into a definitive, step-by-step setup sequence.

Quick Start

git clone https://github.com/danishfareed/Google-Maps-SERP.git
cd Google-Maps-SERP
npm install
npx playwright install chromium
cp .env.example .env
npm install @prisma/client@5.22.0
npm install --save-dev prisma@5.22.0
npx prisma generate
npx prisma db push
rm -rf .next
npm run dev

Open http://localhost:3000 in your browser.

💡 Note on Turbopack Build Caches: If the dev server was previously interrupted, Turbopack's local compilation database can occasionally corrupt, throwing a Rust panic (Unable to open static sorted file ... referenced from 00000784.meta). Explicitly running rm -rf .next before starting the server safely bypasses this state.


Since your PR nicely kickstarted this conversation, would you prefer to roll these extra documentation steps into this PR so you get full credit for fixing the onboarding workflow, or would you rather have me submit a secondary PR on top of yours to handle the README expansion?

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