Skip to main content
General
Codebase

Common Commands

A practical reference for daily development, tests and local services.

Open MarkdownFull AI corpusFeedback

Use these commands from the repository root. They are defined in package.json, so prefer them over running the underlying tools directly.

Everyday Development

CommandPurpose
npm installInstall project dependencies
npm run devStart the Next.js development server on port 3000
npm run buildCreate a production build
npm run startServe an existing production build
npm run typecheckCheck TypeScript without emitting files

Environment-aware commands

Next.js loads the root .env file for dev, build and start. The test scripts use the repository's with-dev-env wrapper because Vitest and Playwright also need those values outside the Next.js process:

Terminal
npm run with-dev-env -- <command>

You normally do not need to call this wrapper yourself. Use it when running a one-off tool that imports application modules depending on lib/env.ts.

Code Quality

CommandPurpose
npm run formatCheck formatting with Biome
npm run format:writeApply safe formatting changes
npm run lintCheck lint rules with Biome
npm run lint:writeApply safe lint fixes
npm run checkRun Biome formatting and lint checks together

Run the non-writing commands in CI. Review the diff after any command ending in :write before committing its changes.

Tests

CommandPurpose
npm run testRun the unit test suite
npm run test:watchRun unit tests in watch mode
npm run test:coverageRun unit tests and collect coverage
npm run test:dbInclude tests that require the configured test database
npm run test:e2e:setupInstall the Playwright browser
npm run test:e2eRun Playwright end-to-end tests headlessly
npm run test:e2e:headedRun Playwright while displaying the browser
npm run test:e2e:uiOpen Playwright's interactive test runner
npm run test:e2e:debugRun Playwright with its inspector

test:db and the Playwright commands load variables from the root .env file. Use isolated test credentials and never point them at production services.

Local Services

CommandPurpose
npm run docker:upStart the included PostgreSQL container
npm run docker:downStop the included containers
npm run docker:logsFollow container logs
npm run db:studioOpen the Drizzle database browser
npm run stripe:listenForward Stripe CLI events to the local webhook
npm run stripe:trigger -- <event>Ask Stripe CLI to emit a test event
npm run email:devPreview React Email templates on port 3001

Database migration commands differ between the starter kit variants. Follow the Drizzle database guide before changing or applying a schema.

Drizzle database commands

Use these repository scripts instead of calling the underlying tools directly.

Generate a migrationnpm run db:generate
Regenerate migrations from origin/mainnpm run db:regenerate
Apply committed migrationsnpm run db:migrate
Push schema changes without a migrationnpm run db:push
Open Drizzle Studionpm run db:studio

Dependency Maintenance

CommandPurpose
npm run deps:checkList dependency updates without changing files
npm run deps:updateUpdate version ranges in package.json

After updating dependencies, run npm install, review the lockfile and complete the typecheck, lint, test and production build checks before committing.