EEPNext.js Template
Dev Environment

Local Setup

Prerequisites, environment variables, and getting the app running locally.

Prerequisites

ToolVersionNotes
Node.js≥ 24nvm install && nvm use (reads .nvmrc) or brew install node. Install nvm: curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
pnpm≥ 10npm install -g pnpm
DockeranyDocker Desktop or Rancher Desktop (free, works on Apple Silicon)
Trivyanybrew install trivy - required for pre-commit security scan on dependency changes. See aquasecurity/trivy
Gitleaksanybrew install gitleaks - scans staged files for secrets on every commit. Pre-commit blocks if not installed. See gitleaks/gitleaks

Install dependencies

pnpm install

Environment variables

Copy the template and fill in your secrets:

cp .env.local_template .env.local

The key variables to set before the app will run:

VariableWhat it isWhere to get it
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEYClerk public keyClerk dashboard → API Keys
CLERK_SECRET_KEYClerk secret keyClerk dashboard → API Keys
DATABASE_URLPostgres connection stringPre-filled for local Docker (postgresql://postgres:postgres@localhost:5432/app)

The remaining variables (NEXT_PUBLIC_CLERK_SIGN_IN_URL etc.) are pre-filled in the template and work as-is for local dev.

All environment variables are validated at build time using T3 Env. If a required variable is missing or malformed, the build fails immediately with a clear error message rather than silently producing a broken deployment.

See Authentication Setup for Clerk-specific steps and Database for DB setup.


Start the database

docker compose up -d

Then run migrations (safe to re-run, skips already-applied ones):

pnpm db:migrate

Optionally seed demo data:

pnpm db:seed   # resets example_items to 3 fixed rows

Dev servers

The repo contains two apps: the Next.js app (:3000) and the docs site (:3001).

CommandWhat starts
pnpm devApp only - http://localhost:3000
pnpm dev:docsDocs only - http://localhost:3001
pnpm dev:allBoth concurrently, colour-coded output
For most work you just need pnpm dev.

Useful commands

pnpm test          # unit tests (Vitest, single pass)
pnpm test:watch    # watch mode
pnpm typecheck     # tsc --noEmit
pnpm lint          # ESLint
pnpm e2e           # Playwright end-to-end (needs pnpm dev running)
pnpm build         # production build

Prefer the Dev Container if you want a zero-setup environment - it pre-installs everything and wires the database automatically.

On this page