Running Locally
How to start the development server and what to expect on first boot.
Last updated:
Start the development server
npm run devThe app starts at http://localhost:3000. Next.js will compile the app on first load. Subsequent page loads are instant thanks to hot module replacement.
Tip
.env.local is filled in before starting. Missing environment variables will cause runtime errors — check the terminal output for details.Available npm scripts
| Script | What it does |
|---|---|
npm run dev | Starts the Next.js development server at http://localhost:3000 |
npm run build | Runs prisma generate then builds the production bundle |
npm run start | Starts the production server (after building) |
npm run lint | Runs ESLint across the codebase |
npm run db:generate | Regenerates the Prisma client types (prisma generate) |
npm run db:migrate | Runs Prisma migrations in dev mode (prisma migrate dev) |
npm run db:push | Pushes schema changes directly without migrations (prisma db push) |
npm run db:seed | Seeds the database with initial data (npx tsx prisma/seed.ts) |
npm run db:studio | Opens Prisma Studio at http://localhost:5555 |
Accessing Sanity Studio locally
Sanity Studio is embedded directly in the Next.js app as a catch-all route at /studio. No separate server is needed:
# Studio is available at http://localhost:3000/studio
# when the Next.js dev server is runningNavigate to http://localhost:3000/studio and log in with your Sanity account. You'll see the CMS editor with Post, Category, and Author content types configured.
Note
sanity.config.ts in the project root, and the schema types are in src/sanity/schemaTypes/. The Studio uses project ID pup1pp2q by default — you'll need to update this to your own Sanity project ID in sanity.config.ts (or it's pulled from NEXT_PUBLIC_SANITY_PROJECT_ID).Running Prisma Studio
Prisma Studio provides a visual database browser — useful for inspecting data during development:
npm run db:studio
# Opens at http://localhost:5555Studio lets you create, read, update, and delete records directly — useful for seeding test data or debugging database issues.
Hot reloading and fast refresh
Next.js Fast Refresh is enabled by default. Changes to React components reflect in the browser instantly without losing state. Changes to server-side code (API routes, server components) trigger a soft re-render.
BloggFast also has the React Compiler enabled (reactCompiler: true in next.config.ts), which automatically applies memoization optimizations across the codebase.
Note
.env.local, you must restart the dev server (Ctrl+C then npm run dev) for the new values to take effect.